Lines Matching refs:out

97   char out[MB_LEN_MAX];  in TEST()  local
103 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(out, 0x00a2, &ps)); in TEST()
115 EXPECT_EQ(1U, wcrtomb(out, L'\0', &ps)); in TEST()
247 wchar_t out[8]; in TEST() local
249 out[0] = 'x'; in TEST()
250 ASSERT_EQ(0, mbtowc(out, "hello", 0)); in TEST()
251 ASSERT_EQ('x', out[0]); in TEST()
253 ASSERT_EQ(0, mbtowc(out, "hello", 0)); in TEST()
254 ASSERT_EQ(0, mbtowc(out, "", 0)); in TEST()
255 ASSERT_EQ(1, mbtowc(out, "hello", 1)); in TEST()
256 ASSERT_EQ(L'h', out[0]); in TEST()
266 wchar_t out[8]; in TEST() local
268 out[0] = 'x'; in TEST()
269 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr)); in TEST()
270 ASSERT_EQ('x', out[0]); in TEST()
272 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, nullptr)); in TEST()
273 ASSERT_EQ(0U, mbrtowc(out, "", 0, nullptr)); in TEST()
274 ASSERT_EQ(1U, mbrtowc(out, "hello", 1, nullptr)); in TEST()
275 ASSERT_EQ(L'h', out[0]); in TEST()
287 ASSERT_EQ(1U, mbrtowc(out, "abcdef", 6, nullptr)); in TEST()
288 ASSERT_EQ(L'a', out[0]); in TEST()
290 ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, nullptr)); in TEST()
291 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[0]); in TEST()
293 ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, nullptr)); in TEST()
294 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[0]); in TEST()
296 ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, nullptr)); in TEST()
297 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[0]); in TEST()
300 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, nullptr)); in TEST()
304 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf0\x82\x82\xac" "ef", 6, nullptr)); in TEST()
312 wchar_t out[8] = {}; in TEST() local
314 ASSERT_EQ(3U, mbrtowc(out, "\xef\xbf\xbe", 3, nullptr)); in TEST()
315 ASSERT_EQ(static_cast<wchar_t>(0xfffe), out[0]); in TEST()
316 ASSERT_EQ(3U, mbrtowc(out, "\xef\xbf\xbf", 3, nullptr)); in TEST()
317 ASSERT_EQ(static_cast<wchar_t>(0xffff), out[0]); in TEST()
324 wchar_t out[8] = {}; in TEST() local
326 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf5\x80\x80\x80", 4, nullptr)); in TEST()
334 wchar_t out; in test_mbrtowc_incomplete() local
336 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps)); in test_mbrtowc_incomplete()
337 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "cdef", 5, ps)); in test_mbrtowc_incomplete()
338 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out); in test_mbrtowc_incomplete()
341 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xe2", 1, ps)); in test_mbrtowc_incomplete()
342 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\x82", 1, ps)); in test_mbrtowc_incomplete()
343 ASSERT_EQ(1U, mbrtowc(&out, "\xac" "def", 4, ps)); in test_mbrtowc_incomplete()
344 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out); in test_mbrtowc_incomplete()
347 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xf0", 1, ps)); in test_mbrtowc_incomplete()
348 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xa4\xad", 2, ps)); in test_mbrtowc_incomplete()
349 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "ef", 3, ps)); in test_mbrtowc_incomplete()
350 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out); in test_mbrtowc_incomplete()
354 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps)); in test_mbrtowc_incomplete()
355 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(&out, "\x20" "cdef", 5, ps)); in test_mbrtowc_incomplete()
371 wchar_t out[4]; in test_mbsrtowcs() local
374 ASSERT_EQ(4U, mbsrtowcs(out, &valid, 4, ps)); in test_mbsrtowcs()
375 ASSERT_EQ(L'A', out[0]); in test_mbsrtowcs()
376 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[1]); in test_mbsrtowcs()
377 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[2]); in test_mbsrtowcs()
378 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[3]); in test_mbsrtowcs()
382 wmemset(out, L'x', NUM_WCHARS(sizeof(out))); in test_mbsrtowcs()
383 ASSERT_EQ(2U, mbsrtowcs(out, &valid, 4, ps)); in test_mbsrtowcs()
384 ASSERT_EQ(L'e', out[0]); in test_mbsrtowcs()
385 ASSERT_EQ(L'f', out[1]); in test_mbsrtowcs()
386 ASSERT_EQ(L'\0', out[2]); in test_mbsrtowcs()
388 ASSERT_EQ(L'x', out[3]); in test_mbsrtowcs()
393 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &invalid, 4, ps)); in test_mbsrtowcs()
398 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &incomplete, 2, ps)); in test_mbsrtowcs()
426 wchar_t out; in TEST() local
427 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, &ps)); in TEST()
428 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(&out, &invalid, 1, &ps)); in TEST()