variable tests and exception specification tests added

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7150 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-04-14 20:11:34 +00:00
commit b99589f99f

View file

@ -53,5 +53,42 @@ public class runme
li_std_string.test_reference(stringPtr);
// Check throw exception specification
try {
li_std_string.test_throw();
throw new Exception("Test 5 failed");
} catch (ApplicationException e) {
if (e.Message != "test_throw message")
throw new Exception("Test 5 string check: " + e.Message);
}
try {
li_std_string.test_const_reference_throw();
throw new Exception("Test 6 failed");
} catch (ApplicationException e) {
if (e.Message != "test_const_reference_throw message")
throw new Exception("Test 6 string check: " + e.Message);
}
// Global variables
const string s = "initial string";
if (li_std_string.GlobalString2 != "global string 2")
throw new Exception("GlobalString2 test 1");
li_std_string.GlobalString2 = s;
if (li_std_string.GlobalString2 != s)
throw new Exception("GlobalString2 test 2");
// Member variables
Structure myStructure = new Structure();
if (myStructure.MemberString2 != "member string 2")
throw new Exception("MemberString2 test 1");
myStructure.MemberString2 = s;
if (myStructure.MemberString2 != s)
throw new Exception("MemberString2 test 2");
if (Structure.StaticMemberString2 != "static member string 2")
throw new Exception("StaticMemberString2 test 1");
Structure.StaticMemberString2 = s;
if (Structure.StaticMemberString2 != s)
throw new Exception("StaticMemberString2 test 2");
}
}