catch read-onlye errors properly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d03d131b18
commit
773018d61c
1 changed files with 12 additions and 3 deletions
|
|
@ -57,8 +57,17 @@ print "You should see the value", example::Point_print($example::ptptr), "\n";
|
|||
|
||||
print "\nNow I'm going to try and modify some read only variables\n";
|
||||
|
||||
print " Tring to set 'path'\n";
|
||||
$example::path = "Whoa!";
|
||||
|
||||
print " Trying to set 'status'\n";
|
||||
$example::status = 0;
|
||||
eval { $example::status = 0; };
|
||||
if (!$@) {
|
||||
die("status");
|
||||
}
|
||||
print " get error for 'status'\n";
|
||||
|
||||
print " Tring to set 'path'\n";
|
||||
eval { $example::path = "Whoa!";};
|
||||
if (!$@) {
|
||||
die("path");
|
||||
}
|
||||
print " get error for 'path'\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue