Lines Matching refs:out
95 char out[MB_LEN_MAX]; in TEST() local
101 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(out, 0x00a2, &ps)); in TEST()
113 EXPECT_EQ(1U, wcrtomb(out, L'\0', &ps)); in TEST()
245 wchar_t out[8]; in TEST() local
247 out[0] = 'x'; in TEST()
248 ASSERT_EQ(0, mbtowc(out, "hello", 0)); in TEST()
249 ASSERT_EQ('x', out[0]); in TEST()
251 ASSERT_EQ(0, mbtowc(out, "hello", 0)); in TEST()
252 ASSERT_EQ(0, mbtowc(out, "", 0)); in TEST()
253 ASSERT_EQ(1, mbtowc(out, "hello", 1)); in TEST()
254 ASSERT_EQ(L'h', out[0]); in TEST()
264 wchar_t out[8]; in TEST() local
266 out[0] = 'x'; in TEST()
267 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, NULL)); in TEST()
268 ASSERT_EQ('x', out[0]); in TEST()
270 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, NULL)); in TEST()
271 ASSERT_EQ(0U, mbrtowc(out, "", 0, NULL)); in TEST()
272 ASSERT_EQ(1U, mbrtowc(out, "hello", 1, NULL)); in TEST()
273 ASSERT_EQ(L'h', out[0]); in TEST()
285 ASSERT_EQ(1U, mbrtowc(out, "abcdef", 6, NULL)); in TEST()
286 ASSERT_EQ(L'a', out[0]); in TEST()
288 ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, NULL)); in TEST()
289 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[0]); in TEST()
291 ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, NULL)); in TEST()
292 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[0]); in TEST()
294 ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, NULL)); in TEST()
295 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[0]); in TEST()
298 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, NULL)); in TEST()
302 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf0\x82\x82\xac" "ef", 6, NULL)); in TEST()
310 wchar_t out; in test_mbrtowc_incomplete() local
312 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps)); in test_mbrtowc_incomplete()
313 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "cdef", 5, ps)); in test_mbrtowc_incomplete()
314 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out); in test_mbrtowc_incomplete()
317 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xe2", 1, ps)); in test_mbrtowc_incomplete()
318 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\x82", 1, ps)); in test_mbrtowc_incomplete()
319 ASSERT_EQ(1U, mbrtowc(&out, "\xac" "def", 4, ps)); in test_mbrtowc_incomplete()
320 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out); in test_mbrtowc_incomplete()
323 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xf0", 1, ps)); in test_mbrtowc_incomplete()
324 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xa4\xad", 2, ps)); in test_mbrtowc_incomplete()
325 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "ef", 3, ps)); in test_mbrtowc_incomplete()
326 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out); in test_mbrtowc_incomplete()
330 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps)); in test_mbrtowc_incomplete()
331 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(&out, "\x20" "cdef", 5, ps)); in test_mbrtowc_incomplete()
347 wchar_t out[4]; in test_mbsrtowcs() local
350 ASSERT_EQ(4U, mbsrtowcs(out, &valid, 4, ps)); in test_mbsrtowcs()
351 ASSERT_EQ(L'A', out[0]); in test_mbsrtowcs()
352 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[1]); in test_mbsrtowcs()
353 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[2]); in test_mbsrtowcs()
354 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[3]); in test_mbsrtowcs()
358 wmemset(out, L'x', NUM_WCHARS(sizeof(out))); in test_mbsrtowcs()
359 ASSERT_EQ(2U, mbsrtowcs(out, &valid, 4, ps)); in test_mbsrtowcs()
360 ASSERT_EQ(L'e', out[0]); in test_mbsrtowcs()
361 ASSERT_EQ(L'f', out[1]); in test_mbsrtowcs()
362 ASSERT_EQ(L'\0', out[2]); in test_mbsrtowcs()
364 ASSERT_EQ(L'x', out[3]); in test_mbsrtowcs()
369 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &invalid, 4, ps)); in test_mbsrtowcs()
374 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &incomplete, 2, ps)); in test_mbsrtowcs()
402 wchar_t out; in TEST() local
403 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, &ps)); in TEST()
404 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(&out, &invalid, 1, &ps)); in TEST()