Fix Interop/SizeConst/SizeConstTest to successfully run in all locales. (#20268)
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>
Tue, 19 Mar 2019 01:01:29 +0000 (18:01 -0700)
committerGitHub <noreply@github.com>
Tue, 19 Mar 2019 01:01:29 +0000 (18:01 -0700)
This test initially would fail when run on a multibyte character set with characters for the original value of `s.arr` such as zh-CH. We cannot change the marshaler since there is not a good way to determine how many bytes/character we need at type-load-time (when the size of the native type is determined).

This change allows us to accurately run this test on Windows machines with multi-byte character sets.

Fixes #7793.

tests/src/Interop/SizeConst/SizeConstTest.cs

index a4d85c8..b4b9055 100644 (file)
@@ -26,7 +26,7 @@ class Test
     {
         // always marshal managedArray.Length
         S_CHARArray_ByValTStr s = new S_CHARArray_ByValTStr();
-        s.arr = "有个可爱";
+        s.arr = "abcd";
         TakeByValTStr(s, s.arr.Length);
 
         // off by one byte since  sizeconst == 4 and