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:
Marcelo Matus 2006-01-23 23:47:10 +00:00
commit 773018d61c

View file

@ -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";