Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit d642356

Browse files
committed
[[ Bug 20504 ]] Fix wide string prefix on Win32
This patch ensures L is used on Win32 to indicate a UTF-16 codeunit string.
1 parent 9b54bb2 commit d642356

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libfoundation/test/test_string.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,19 @@ TEST(string, surrogate_unicode_props)
175175
check_bidi_of_surrogate_range(kSPUA_B_Lower, kSPUA_B_Upper);
176176
}
177177

178+
#ifdef WIN32
179+
#define WIDE_PREFIX L
180+
#else
181+
#define WIDE_PREFIX u
182+
#endif
183+
178184
TEST(string, normalize_compare)
179185
{
180186
MCAutoStringRef t_decomposed;
181-
MCStringCreateWithWString((const unichar_t*)u"\u0065\u0301\u0065\u0301\u0065\u0301", &t_decomposed);
187+
MCStringCreateWithWString((const unichar_t*) WIDE_PREFIX "\u0065\u0301\u0065\u0301\u0065\u0301", &t_decomposed);
182188

183189
MCAutoStringRef t_composed;
184-
MCStringCreateWithWString((const unichar_t*)u"\u00e9\u00e9\u00e9", &t_composed);
190+
MCStringCreateWithWString((const unichar_t*) WIDE_PREFIX "\u00e9\u00e9\u00e9", &t_composed);
185191

186192
ASSERT_TRUE(MCStringIsEqualTo(*t_decomposed, *t_composed, kMCStringOptionCompareCaseless));
187193

0 commit comments

Comments
 (0)