Lines Matching refs:L
79 EXPECT_EQ(0, wctomb(nullptr, L'h')); in TEST()
80 EXPECT_EQ(0, wctomb(nullptr, L'\0')); in TEST()
81 EXPECT_EQ(1U, wcrtomb(nullptr, L'\0', nullptr)); in TEST()
82 EXPECT_EQ(1U, wcrtomb(nullptr, L'h', nullptr)); in TEST()
87 EXPECT_EQ(1, wctomb(bytes, L'\0')); in TEST()
88 EXPECT_EQ(1U, wcrtomb(bytes, L'\0', nullptr)); in TEST()
92 EXPECT_EQ(1, wctomb(bytes, L'h')); in TEST()
95 EXPECT_EQ(1U, wcrtomb(bytes, L'h', nullptr)); in TEST()
103 EXPECT_EQ(1U, wcrtomb(bytes, L'h', nullptr)); in TEST()
150 EXPECT_EQ(1U, wcrtomb(out, L'\0', &ps)); in TEST()
158 const wchar_t chars[] = { L'h', L'e', L'l', L'l', L'o', 0 }; in TEST()
159 const wchar_t bad_chars[] = { L'h', L'i', static_cast<wchar_t>(0xffffffff), 0 }; in TEST()
269 const wchar_t* haystack = L"big daddy/giant haystacks!"; in TEST()
270 const wchar_t* empty_haystack = L""; in TEST()
273 ASSERT_EQ(haystack, wcsstr(haystack, L"")); in TEST()
274 ASSERT_EQ(empty_haystack, wcsstr(empty_haystack, L"")); in TEST()
276 ASSERT_EQ(haystack, wcsstr(haystack, L"b")); in TEST()
277 ASSERT_EQ(haystack, wcsstr(haystack, L"big")); in TEST()
278 ASSERT_EQ(haystack + 9, wcsstr(haystack, L"/")); in TEST()
279 ASSERT_EQ(haystack + 9, wcsstr(haystack, L"/giant")); in TEST()
280 ASSERT_EQ(haystack + 25, wcsstr(haystack, L"!")); in TEST()
281 ASSERT_EQ(haystack + 19, wcsstr(haystack, L"stacks!")); in TEST()
283 ASSERT_EQ(nullptr, wcsstr(haystack, L"monkey")); in TEST()
284 ASSERT_EQ(nullptr, wcsstr(empty_haystack, L"monkey")); in TEST()
289 ASSERT_TRUE(wcsstr(L"romrom", L"rom") != nullptr); in TEST()
327 EXPECT_EQ(L'h', out[0]); in TEST()
346 EXPECT_EQ(L'h', out[0]); in TEST()
359 EXPECT_EQ(L'a', out[0]); in TEST()
467 ASSERT_EQ(L'A', out[0]); in test_mbsrtowcs()
474 wmemset(out, L'x', NUM_WCHARS(sizeof(out))); in test_mbsrtowcs()
476 ASSERT_EQ(L'e', out[0]); in test_mbsrtowcs()
477 ASSERT_EQ(L'f', out[1]); in test_mbsrtowcs()
478 ASSERT_EQ(L'\0', out[2]); in test_mbsrtowcs()
480 ASSERT_EQ(L'x', out[3]); in test_mbsrtowcs()
538 TestSingleWcsToInt(fn, L"123", 10, static_cast<T>(123), 3); in TestWcsToInt()
539 TestSingleWcsToInt(fn, L"123", 0, static_cast<T>(123), 3); in TestWcsToInt()
540 TestSingleWcsToInt(fn, L"123#", 10, static_cast<T>(123), 3); in TestWcsToInt()
541 TestSingleWcsToInt(fn, L"01000", 8, static_cast<T>(512), 5); in TestWcsToInt()
542 TestSingleWcsToInt(fn, L"01000", 0, static_cast<T>(512), 5); in TestWcsToInt()
543 TestSingleWcsToInt(fn, L" 123 45", 0, static_cast<T>(123), 6); in TestWcsToInt()
544 TestSingleWcsToInt(fn, L" -123", 0, static_cast<T>(-123), 6); in TestWcsToInt()
545 TestSingleWcsToInt(fn, L"0x10000", 0, static_cast<T>(65536), 7); in TestWcsToInt()
547 TestSingleWcsToInt(fn, L"0b1011", 0, static_cast<T>(0b1011), 6); in TestWcsToInt()
571 TestWcsToIntLimits(wcstol, L"-9223372036854775809", L"9223372036854775808"); in TEST()
573 TestWcsToIntLimits(wcstol, L"-2147483649", L"2147483648"); in TEST()
583 TestWcsToIntLimits(wcstoul, L"-1", L"18446744073709551616"); in TEST()
585 TestWcsToIntLimits(wcstoul, L"-1", L"4294967296"); in TEST()
594 TestWcsToIntLimits(wcstoll, L"-9223372036854775809", L"9223372036854775808"); in TEST()
602 TestWcsToIntLimits(wcstoull, L"-1", L"18446744073709551616"); in TEST()
610 TestWcsToIntLimits(wcstoimax, L"-9223372036854775809", in TEST()
611 L"9223372036854775808"); in TEST()
619 TestWcsToIntLimits(wcstoumax, L"-1", L"18446744073709551616"); in TEST()
634 ASSERT_EQ(L'h', dst[0]); in TEST()
635 ASSERT_EQ(L'e', dst[1]); in TEST()
641 ASSERT_EQ(L'h', dst[0]); in TEST()
642 ASSERT_EQ(L'e', dst[1]); in TEST()
643 ASSERT_EQ(L'l', dst[2]); in TEST()
670 EXPECT_EQ(24U, wcsftime(buf, sizeof(buf), L"%c", &t)); in TEST()
671 EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf); in TEST()
672 EXPECT_EQ(24U, wcsftime_l(buf, sizeof(buf), L"%c", &t, SAFE_LC_GLOBAL_LOCALE)); in TEST()
673 EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf); in TEST()
677 const wchar_t const_wstr[] = L"This is a test of something or other....."; in TEST()
684 EXPECT_STREQ(L"This This is a test of something or other", wstr); in TEST()
688 const wchar_t src[] = L"Source string"; in TEST()
696 const wchar_t src[] = L"Source string"; in TEST()
704 const wchar_t src[] = L"Source string"; in TEST()
712 dst[6] = L'\0'; in TEST()
713 EXPECT_STREQ(dst, L"Source"); in TEST()
715 wmemset(dst, L'x', NUM_WCHARS(sizeof(dst))); in TEST()
718 EXPECT_EQ(dst[src_len], L'\0'); in TEST()
719 EXPECT_EQ(dst[src_len+1], L'\0'); in TEST()
720 EXPECT_EQ(dst[src_len+2], L'\0'); in TEST()
721 EXPECT_EQ(dst[src_len+3], L'\0'); in TEST()
722 EXPECT_EQ(dst[src_len+4], L'x'); in TEST()
726 const wchar_t src[] = L"Source string"; in TEST()
734 const wchar_t src[] = L"Source string"; in TEST()
742 dst[6] = L'\0'; in TEST()
743 EXPECT_STREQ(dst, L"Source"); in TEST()
744 EXPECT_EQ(dst, wcsncpy(dst, L"clobber", 0)); in TEST()
745 EXPECT_STREQ(dst, L"Source"); in TEST()
747 wmemset(dst, L'x', NUM_WCHARS(sizeof(dst))); in TEST()
750 EXPECT_EQ(dst[src_len], L'\0'); in TEST()
751 EXPECT_EQ(dst[src_len+1], L'\0'); in TEST()
752 EXPECT_EQ(dst[src_len+2], L'\0'); in TEST()
753 EXPECT_EQ(dst[src_len+3], L'\0'); in TEST()
754 EXPECT_EQ(dst[src_len+4], L'x'); in TEST()
771 EXPECT_EQ(L'x', wc); in TEST()
775 EXPECT_EQ(L'¢', wc); in TEST()
779 EXPECT_EQ(L'€', wc); in TEST()
783 EXPECT_EQ(L'', wc); in TEST()
790 ASSERT_NE(EOF, fputws(L"hello, world!", fp)); in TEST()
793 ASSERT_STREQ(L"hello, world!", p); in TEST()
794 ASSERT_EQ(wcslen(L"hello, world!"), size); in TEST()
821 wcstol(L"123", nullptr, -1); in TEST()
824 wcstol(L"123", nullptr, 1); in TEST()
827 wcstol(L"123", nullptr, 37); in TEST()
833 wcstoll(L"123", nullptr, -1); in TEST()
836 wcstoll(L"123", nullptr, 1); in TEST()
839 wcstoll(L"123", nullptr, 37); in TEST()
845 wcstoul(L"123", nullptr, -1); in TEST()
848 wcstoul(L"123", nullptr, 1); in TEST()
851 wcstoul(L"123", nullptr, 37); in TEST()
857 wcstoull(L"123", nullptr, -1); in TEST()
860 wcstoull(L"123", nullptr, 1); in TEST()
863 wcstoull(L"123", nullptr, 37); in TEST()
869 wcstoll_l(L"123", nullptr, -1, SAFE_LC_GLOBAL_LOCALE); in TEST()
872 wcstoll_l(L"123", nullptr, 1, SAFE_LC_GLOBAL_LOCALE); in TEST()
875 wcstoll_l(L"123", nullptr, 37, SAFE_LC_GLOBAL_LOCALE); in TEST()
881 wcstoull_l(L"123", nullptr, -1, SAFE_LC_GLOBAL_LOCALE); in TEST()
884 wcstoull_l(L"123", nullptr, 1, SAFE_LC_GLOBAL_LOCALE); in TEST()
887 wcstoull_l(L"123", nullptr, 37, SAFE_LC_GLOBAL_LOCALE); in TEST()
894 ASSERT_EQ(&dst[4], wmempcpy(dst, L"hello", 4)); in TEST()
913 TestSingleWcsToFloat(fn, L"123", static_cast<T>(123.0L), 3); in TestWcsToFloat()
914 TestSingleWcsToFloat(fn, L"123#", static_cast<T>(123.0L), 3); in TestWcsToFloat()
915 TestSingleWcsToFloat(fn, L" 123 45", static_cast<T>(123.0L), 6); in TestWcsToFloat()
916 TestSingleWcsToFloat(fn, L"9.0", static_cast<T>(9.0L), 3); in TestWcsToFloat()
917 TestSingleWcsToFloat(fn, L"-9.0", static_cast<T>(-9.0L), 4); in TestWcsToFloat()
918 TestSingleWcsToFloat(fn, L" \t\v\f\r\n9.0", static_cast<T>(9.0L), 9); in TestWcsToFloat()
923 TestSingleWcsToFloat(fn, L"0.9e1", static_cast<T>(9.0L), 5); in TestWcsToFloatHexFloats()
924 TestSingleWcsToFloat(fn, L"0x1.2p3", static_cast<T>(9.0L), 7); in TestWcsToFloatHexFloats()
925 TestSingleWcsToFloat(fn, L"+1e+100", static_cast<T>(1e100L), 7); in TestWcsToFloatHexFloats()
926 TestSingleWcsToFloat(fn, L"0x10000.80", static_cast<T>(65536.50L), 10); in TestWcsToFloatHexFloats()
931 ASSERT_TRUE(isnan(fn(L"+nan", nullptr))); in TestWcsToFloatInfNan()
932 ASSERT_TRUE(isnan(fn(L"nan", nullptr))); in TestWcsToFloatInfNan()
933 ASSERT_TRUE(isnan(fn(L"-nan", nullptr))); in TestWcsToFloatInfNan()
935 ASSERT_TRUE(isnan(fn(L"+nan(0xff)", nullptr))); in TestWcsToFloatInfNan()
936 ASSERT_TRUE(isnan(fn(L"nan(0xff)", nullptr))); in TestWcsToFloatInfNan()
937 ASSERT_TRUE(isnan(fn(L"-nan(0xff)", nullptr))); in TestWcsToFloatInfNan()
940 ASSERT_TRUE(isnan(fn(L"+nanny", &p))); in TestWcsToFloatInfNan()
941 ASSERT_STREQ(L"ny", p); in TestWcsToFloatInfNan()
942 ASSERT_TRUE(isnan(fn(L"nanny", &p))); in TestWcsToFloatInfNan()
943 ASSERT_STREQ(L"ny", p); in TestWcsToFloatInfNan()
944 ASSERT_TRUE(isnan(fn(L"-nanny", &p))); in TestWcsToFloatInfNan()
945 ASSERT_STREQ(L"ny", p); in TestWcsToFloatInfNan()
947 ASSERT_EQ(0, fn(L"muppet", &p)); in TestWcsToFloatInfNan()
948 ASSERT_STREQ(L"muppet", p); in TestWcsToFloatInfNan()
949 ASSERT_EQ(0, fn(L" muppet", &p)); in TestWcsToFloatInfNan()
950 ASSERT_STREQ(L" muppet", p); in TestWcsToFloatInfNan()
952 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"+inf", nullptr)); in TestWcsToFloatInfNan()
953 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"inf", nullptr)); in TestWcsToFloatInfNan()
954 ASSERT_EQ(-std::numeric_limits<T>::infinity(), fn(L"-inf", nullptr)); in TestWcsToFloatInfNan()
956 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"+infinity", nullptr)); in TestWcsToFloatInfNan()
957 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"infinity", nullptr)); in TestWcsToFloatInfNan()
958 ASSERT_EQ(-std::numeric_limits<T>::infinity(), fn(L"-infinity", nullptr)); in TestWcsToFloatInfNan()
960 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"+infinitude", &p)); in TestWcsToFloatInfNan()
961 ASSERT_STREQ(L"initude", p); in TestWcsToFloatInfNan()
962 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"infinitude", &p)); in TestWcsToFloatInfNan()
963 ASSERT_STREQ(L"initude", p); in TestWcsToFloatInfNan()
964 ASSERT_EQ(-std::numeric_limits<T>::infinity(), fn(L"-infinitude", &p)); in TestWcsToFloatInfNan()
965 ASSERT_STREQ(L"initude", p); in TestWcsToFloatInfNan()
968 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"InFiNiTy", nullptr)); in TestWcsToFloatInfNan()
969 ASSERT_TRUE(isnan(fn(L"NaN", nullptr))); in TestWcsToFloatInfNan()
1010 EXPECT_EQ(1.23, wcstod_l(L"1.23", nullptr, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1018 EXPECT_EQ(1.23f, wcstof_l(L"1.23", nullptr, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1026 EXPECT_EQ(123L, wcstol_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1033 EXPECT_EQ(1.23L, wcstold_l(L"1.23", nullptr, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1037 EXPECT_EQ(123LL, wcstoll_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1042 EXPECT_EQ(123UL, wcstoul_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1049 EXPECT_EQ(123ULL, wcstoull_l(L"123", nullptr, 10, SAFE_LC_GLOBAL_LOCALE)); in TEST()
1180 EXPECT_EQ(2, wcwidth(L'ㅠ')); in TEST()
1184 EXPECT_EQ(2, wcwidth(L'ㄱ')); in TEST()
1185 EXPECT_EQ(2, wcwidth(L'ㅅ')); in TEST()
1189 EXPECT_EQ(2, wcswidth(L"abc", 2)); in TEST()
1190 EXPECT_EQ(2, wcswidth(L"ab\t", 2)); in TEST()
1191 EXPECT_EQ(-1, wcswidth(L"a\tb", 2)); in TEST()
1197 ASSERT_EQ(11U, wcslcpy(dst, L"hello world", 3)); in TEST()
1198 ASSERT_STREQ(L"he", dst); in TEST()
1199 ASSERT_EQ(11U, wcslcpy(dst, L"hello world", 32)); in TEST()
1200 ASSERT_STREQ(L"hello world", dst); in TEST()
1208 ASSERT_EQ(dst, wcscat(dst, L"hello")); in TEST()
1209 ASSERT_STREQ(dst, L"hello"); in TEST()
1210 ASSERT_EQ(dst, wcscat(dst, L" world")); in TEST()
1211 ASSERT_STREQ(dst, L"hello world"); in TEST()
1216 ASSERT_EQ(dst, wcscpy(dst, L"hello")); in TEST()
1217 ASSERT_STREQ(dst, L"hello"); in TEST()
1218 ASSERT_EQ(dst, wcscpy(dst, L"world")); in TEST()
1219 ASSERT_STREQ(dst, L"world"); in TEST()
1223 ASSERT_EQ(0, wcscasecmp(L"hello", L"HELLO")); in TEST()
1224 ASSERT_TRUE(wcscasecmp(L"hello1", L"HELLO2") < 0); in TEST()
1225 ASSERT_TRUE(wcscasecmp(L"hello2", L"HELLO1") > 0); in TEST()
1226 ASSERT_TRUE(wcscasecmp(L"hello", L"HELL") > 0); in TEST()
1227 ASSERT_TRUE(wcscasecmp(L"hell", L"HELLO") < 0); in TEST()
1231 ASSERT_EQ(0U, wcscspn(L"hello world", L"abcdefghijklmnopqrstuvwxyz")); in TEST()
1232 ASSERT_EQ(5U, wcscspn(L"hello world", L" ")); in TEST()
1233 ASSERT_EQ(11U, wcscspn(L"hello world", L"!")); in TEST()
1237 ASSERT_EQ(0U, wcsspn(L"hello world", L"!")); in TEST()
1238 ASSERT_EQ(5U, wcsspn(L"hello world", L"abcdefghijklmnopqrstuvwxyz")); in TEST()
1239 ASSERT_EQ(11U, wcsspn(L"hello world", L"abcdefghijklmnopqrstuvwxyz ")); in TEST()
1243 wchar_t* s = wcsdup(L"hello"); in TEST()
1244 ASSERT_STREQ(s, L"hello"); in TEST()
1251 ASSERT_EQ(1U, wcslcat(dst, L"a", 4)); in TEST()
1252 ASSERT_EQ(7U, wcslcat(dst, L"bcdefg", 4)); in TEST()
1253 ASSERT_STREQ(dst, L"abc"); in TEST()
1260 ASSERT_EQ(0, wcsncasecmp(L"foo", L"bar", 0)); in TEST()
1262 ASSERT_EQ(0, wcsncasecmp(L"hello1", L"HELLO2", 5)); in TEST()
1263 ASSERT_TRUE(wcsncasecmp(L"hello1", L"HELLO2", 6) < 0); in TEST()
1264 ASSERT_TRUE(wcsncasecmp(L"hello2", L"HELLO1", 6) > 0); in TEST()
1265 ASSERT_TRUE(wcsncasecmp(L"hello", L"HELL", 5) > 0); in TEST()
1266 ASSERT_TRUE(wcsncasecmp(L"hell", L"HELLO", 5) < 0); in TEST()
1271 ASSERT_EQ(dst, wcsncat(dst, L"hello, world!", 5)); in TEST()
1272 ASSERT_STREQ(dst, L"hello"); in TEST()
1273 ASSERT_EQ(dst, wcsncat(dst, L"hello, world!", 0)); in TEST()
1274 ASSERT_STREQ(dst, L"hello"); in TEST()
1275 ASSERT_EQ(dst, wcsncat(dst, L", world!", 8)); in TEST()
1276 ASSERT_STREQ(dst, L"hello, world!"); in TEST()
1280 ASSERT_EQ(0, wcsncmp(L"foo", L"bar", 0)); in TEST()
1281 ASSERT_EQ(0, wcsncmp(L"aaaa", L"aaab", 3)); in TEST()
1282 ASSERT_TRUE(wcsncmp(L"aaaa", L"aaab", 4) < 0); in TEST()
1283 ASSERT_TRUE(wcsncmp(L"aaab", L"aaaa", 4) > 0); in TEST()
1287 ASSERT_EQ(2U, wcsnlen(L"hello", 2)); in TEST()
1288 ASSERT_EQ(5U, wcsnlen(L"hello", 5)); in TEST()
1289 ASSERT_EQ(5U, wcsnlen(L"hello", 666)); in TEST()
1293 const wchar_t* s = L"hello, world!"; in TEST()
1294 ASSERT_EQ(nullptr, wcspbrk(s, L"-")); in TEST()
1295 ASSERT_EQ(s, wcspbrk(s, L"abch")); in TEST()
1296 ASSERT_EQ(s + 2, wcspbrk(s, L"l")); in TEST()
1297 ASSERT_EQ(s + 5, wcspbrk(s, L",. !")); in TEST()
1301 wchar_t s[] = L"this is\ta\nstring"; in TEST()
1303 ASSERT_EQ(s, wcstok(s, L"\t\n ", &p)); in TEST()
1304 ASSERT_STREQ(s, L"this"); in TEST()
1305 ASSERT_STREQ(p, L"is\ta\nstring"); in TEST()
1306 ASSERT_EQ(s + 5, wcstok(nullptr, L"\t\n ", &p)); in TEST()
1307 ASSERT_STREQ(s + 5, L"is"); in TEST()
1308 ASSERT_STREQ(p, L"a\nstring"); in TEST()
1309 ASSERT_EQ(s + 8, wcstok(nullptr, L"\t\n ", &p)); in TEST()
1310 ASSERT_STREQ(s + 8, L"a"); in TEST()
1311 ASSERT_STREQ(p, L"string"); in TEST()
1312 ASSERT_EQ(s + 10, wcstok(nullptr, L"\t\n ", &p)); in TEST()
1313 ASSERT_STREQ(s + 10, L"string"); in TEST()
1318 const wchar_t* s = L"hello, world!"; in TEST()
1319 ASSERT_EQ(s, wmemchr(s, L'h', 13)); in TEST()
1320 ASSERT_EQ(s + 5, wmemchr(s, L',', 13)); in TEST()
1321 ASSERT_EQ(s + 12, wmemchr(s, L'!', 13)); in TEST()
1322 ASSERT_EQ(nullptr, wmemchr(s, L'a', 13)); in TEST()
1326 ASSERT_EQ(0, wmemcmp(L"aaaa", L"aaab", 3)); in TEST()
1327 ASSERT_TRUE(wmemcmp(L"aaaa", L"aaab", 4) < 0); in TEST()
1328 ASSERT_TRUE(wmemcmp(L"aaab", L"aaaa", 4) > 0); in TEST()
1333 ASSERT_EQ(dst, wmemcpy(dst, L"hello", 5)); in TEST()
1334 ASSERT_STREQ(dst, L"hello"); in TEST()
1339 ASSERT_EQ(dst, wmemmove(dst, L"hello", 5)); in TEST()
1340 ASSERT_STREQ(dst, L"hello"); in TEST()
1350 ASSERT_EQ(dst, wmemset(dst, L'y', 0)); in TEST()