diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2005-04-14 20:11:34 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2005-04-14 20:11:34 +0000 |
commit | 34b0dfc9137ffaf995d79ffa9734d2e39f74847a (patch) | |
tree | 6c94c23f6e7bd95ecce2d522d546d2e4b59e2d6d /Examples/test-suite/csharp/li_std_string_runme.cs | |
parent | b6e1fddf456813d0f93aa2c5a420b5be2692d7bf (diff) | |
download | swig-34b0dfc9137ffaf995d79ffa9734d2e39f74847a.tar.gz |
variable tests and exception specification tests added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7150 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/csharp/li_std_string_runme.cs')
-rw-r--r-- | Examples/test-suite/csharp/li_std_string_runme.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Examples/test-suite/csharp/li_std_string_runme.cs b/Examples/test-suite/csharp/li_std_string_runme.cs index ad0bc9d01..f87d8e75b 100644 --- a/Examples/test-suite/csharp/li_std_string_runme.cs +++ b/Examples/test-suite/csharp/li_std_string_runme.cs @@ -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"); } } |