Lines Matching refs:out
98 char out[MB_LEN_MAX]; in TEST() local
104 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(out, 0x00a2, &ps)); in TEST()
116 EXPECT_EQ(1U, wcrtomb(out, L'\0', &ps)); in TEST()
256 wchar_t out[8]; in TEST() local
258 out[0] = 'x'; in TEST()
259 ASSERT_EQ(0, mbtowc(out, "hello", 0)); in TEST()
260 ASSERT_EQ('x', out[0]); in TEST()
262 ASSERT_EQ(0, mbtowc(out, "hello", 0)); in TEST()
263 ASSERT_EQ(0, mbtowc(out, "", 0)); in TEST()
264 ASSERT_EQ(1, mbtowc(out, "hello", 1)); in TEST()
265 ASSERT_EQ(L'h', out[0]); in TEST()
275 wchar_t out[8]; in TEST() local
277 out[0] = 'x'; in TEST()
278 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr)); in TEST()
279 ASSERT_EQ('x', out[0]); in TEST()
281 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr)); in TEST()
282 ASSERT_EQ(0U, mbrtowc(out, "", 0, nullptr)); in TEST()
283 ASSERT_EQ(1U, mbrtowc(out, "hello", 1, nullptr)); in TEST()
284 ASSERT_EQ(L'h', out[0]); in TEST()
296 ASSERT_EQ(1U, mbrtowc(out, "abcdef", 6, nullptr)); in TEST()
297 ASSERT_EQ(L'a', out[0]); in TEST()
299 ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, nullptr)); in TEST()
300 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[0]); in TEST()
302 ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, nullptr)); in TEST()
303 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[0]); in TEST()
305 ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, nullptr)); in TEST()
306 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[0]); in TEST()
309 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, nullptr)); in TEST()
313 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf0\x82\x82\xac" "ef", 6, nullptr)); in TEST()
321 wchar_t out[8] = {}; in TEST() local
323 ASSERT_EQ(3U, mbrtowc(out, "\xef\xbf\xbe", 3, nullptr)); in TEST()
324 ASSERT_EQ(static_cast<wchar_t>(0xfffe), out[0]); in TEST()
325 ASSERT_EQ(3U, mbrtowc(out, "\xef\xbf\xbf", 3, nullptr)); in TEST()
326 ASSERT_EQ(static_cast<wchar_t>(0xffff), out[0]); in TEST()
333 wchar_t out[8] = {}; in TEST() local
335 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf5\x80\x80\x80", 4, nullptr)); in TEST()
343 wchar_t out; in test_mbrtowc_incomplete() local
345 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps)); in test_mbrtowc_incomplete()
346 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "cdef", 5, ps)); in test_mbrtowc_incomplete()
347 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out); in test_mbrtowc_incomplete()
350 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xe2", 1, ps)); in test_mbrtowc_incomplete()
351 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\x82", 1, ps)); in test_mbrtowc_incomplete()
352 ASSERT_EQ(1U, mbrtowc(&out, "\xac" "def", 4, ps)); in test_mbrtowc_incomplete()
353 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out); in test_mbrtowc_incomplete()
356 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xf0", 1, ps)); in test_mbrtowc_incomplete()
357 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xa4\xad", 2, ps)); in test_mbrtowc_incomplete()
358 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "ef", 3, ps)); in test_mbrtowc_incomplete()
359 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out); in test_mbrtowc_incomplete()
363 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps)); in test_mbrtowc_incomplete()
364 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(&out, "\x20" "cdef", 5, ps)); in test_mbrtowc_incomplete()
380 wchar_t out[4]; in test_mbsrtowcs() local
383 ASSERT_EQ(4U, mbsrtowcs(out, &valid, 4, ps)); in test_mbsrtowcs()
384 ASSERT_EQ(L'A', out[0]); in test_mbsrtowcs()
385 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[1]); in test_mbsrtowcs()
386 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[2]); in test_mbsrtowcs()
387 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[3]); in test_mbsrtowcs()
391 wmemset(out, L'x', NUM_WCHARS(sizeof(out))); in test_mbsrtowcs()
392 ASSERT_EQ(2U, mbsrtowcs(out, &valid, 4, ps)); in test_mbsrtowcs()
393 ASSERT_EQ(L'e', out[0]); in test_mbsrtowcs()
394 ASSERT_EQ(L'f', out[1]); in test_mbsrtowcs()
395 ASSERT_EQ(L'\0', out[2]); in test_mbsrtowcs()
397 ASSERT_EQ(L'x', out[3]); in test_mbsrtowcs()
402 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &invalid, 4, ps)); in test_mbsrtowcs()
407 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &incomplete, 2, ps)); in test_mbsrtowcs()
435 wchar_t out; in TEST() local
436 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, &ps)); in TEST()
437 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(&out, &invalid, 1, &ps)); in TEST()