diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2019-07-23 19:57:06 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2019-07-23 19:57:06 +0100 |
commit | 55b5552a6aaa5df093ee66b381649c5ee5dcfc0f (patch) | |
tree | 70a523de23fc960bb4d745aa5f490b760cf12f16 | |
parent | 2d36b3468a9d26a352a3d23e06aab012f6b7fb9f (diff) | |
download | swig-55b5552a6aaa5df093ee66b381649c5ee5dcfc0f.tar.gz |
More C# wstring testing
-rw-r--r-- | Examples/test-suite/csharp/li_std_wstring_runme.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Examples/test-suite/csharp/li_std_wstring_runme.cs b/Examples/test-suite/csharp/li_std_wstring_runme.cs index b69d2c8bb..316113f54 100644 --- a/Examples/test-suite/csharp/li_std_wstring_runme.cs +++ b/Examples/test-suite/csharp/li_std_wstring_runme.cs @@ -54,7 +54,9 @@ public class runme x = "hello"; check_equal(li_std_wstring.test_const_reference(x), x); - /* TODO + /* Postpone, tricky, std::wstring portability problem. + * std::wstring is 2 bytes on Windows, 4 bytes on Linux, LPWSTR is 2 bytes. + * .NET marshalling should work on Windows but not Linux. string s = "abc"; if (!li_std_wstring.test_equal_abc(s)) throw new Exception("Not equal " + s); @@ -66,12 +68,12 @@ public class runme check_equal(e.Message, "throwing test_throw"); } - /* TODO x = "abc\0def"; - check_equal(li_std_wstring.test_value(x), x); + // Unlike other languages, embedded NULL in std::string not supported + // check_equal(li_std_wstring.test_value(x), x); + check_equal(li_std_wstring.test_value(x), "abc"); check_equal(li_std_wstring.test_ccvalue(x), "abc"); check_equal(li_std_wstring.test_wchar_overload(x), "abc"); - */ { // Unicode strings |