Home | History | Annotate | Download | only in tests

Lines Matching refs:mbrtowc

102   EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(nullptr, "\xc2", 1, &ps));
109 EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(nullptr, "\xc2", 1, &ps));
114 EXPECT_EQ(static_cast<size_t>(-2), mbrtowc(nullptr, "\xf0\xa4", 1, &ps));
221 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(nullptr, "\xc2", 1, &ps));
265 TEST(wchar, mbrtowc) {
269 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr));
272 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr));
273 ASSERT_EQ(0U, mbrtowc(out, "", 0, nullptr));
274 ASSERT_EQ(1U, mbrtowc(out, "hello", 1, nullptr));
277 ASSERT_EQ(0U, mbrtowc(nullptr, "hello", 0, nullptr));
278 ASSERT_EQ(0U, mbrtowc(nullptr, "", 0, nullptr));
279 ASSERT_EQ(1U, mbrtowc(nullptr, "hello", 1, nullptr));
281 ASSERT_EQ(0U, mbrtowc(nullptr, nullptr, 0, nullptr));
287 ASSERT_EQ(1U, mbrtowc(out, "abcdef", 6, nullptr));
290 ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, nullptr));
293 ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, nullptr));
296 ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, nullptr));
300 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, nullptr));
304 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf0\x82\x82\xac" "ef", 6, nullptr));
314 ASSERT_EQ(3U, mbrtowc(out, "\xef\xbf\xbe", 3, nullptr));
316 ASSERT_EQ(3U, mbrtowc(out, "\xef\xbf\xbf", 3, nullptr));
326 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf5\x80\x80\x80", 4, nullptr));
336 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps));
337 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "cdef", 5, ps));
341 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xe2", 1, ps));
342 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\x82", 1, ps));
343 ASSERT_EQ(1U, mbrtowc(&out, "\xac" "def", 4, ps));
347 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xf0", 1, ps));
348 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xa4\xad", 2, ps));
349 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "ef", 3, ps));
354 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps));
355 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(&out, "\x20" "cdef", 5, ps));
427 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, &ps));
672 n = mbrtowc(&wc, "x", MB_CUR_MAX, nullptr);
676 n = mbrtowc(&wc, "\xc2\xa2", MB_CUR_MAX, nullptr);
680 n = mbrtowc(&wc, "\xe2\x82\xac", MB_CUR_MAX, nullptr);
684 n = mbrtowc(&wc, "\xf0\xa4\xad\xa2", MB_CUR_MAX, nullptr);