Mon, 10 Feb 2025 21:30:51 +0100
fix test_json_escaped_unicode_strings when compiled with suncc
tests/test_json.c | file | annotate | diff | comparison | revisions |
--- a/tests/test_json.c Mon Feb 10 19:24:26 2025 +0100 +++ b/tests/test_json.c Mon Feb 10 21:30:51 2025 +0100 @@ -195,10 +195,10 @@ CxJsonValue *wide = cxJsonObjGet(obj, "wide"); CX_TEST_ASSERT(cxJsonIsString(wide)); - CX_TEST_ASSERT(0 == cx_strcmp( - cxJsonAsCxString(wide), - CX_STR(u8"\u03a3\u29b0")) - ); + // suncc compiler bug: + // u8 string literals don't work inside CX_TEST_ASSERT and CX_STR + cxstring wide_str = cx_str(u8"\u03a3\u29b0"); + CX_TEST_ASSERT(0 == cx_strcmp(cxJsonAsCxString(wide), wide_str)); CxJsonValue *surrogatepair1 = cxJsonObjGet(obj, "surrogatepair1"); CX_TEST_ASSERT(cxJsonIsString(surrogatepair1));