diff options
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"); } } |