Lines Matching defs:out
93 char out[MB_LEN_MAX];
99 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(out, 0x00a2, &ps));
111 EXPECT_EQ(1U, wcrtomb(out, L'\0', &ps));
243 wchar_t out[8];
245 out[0] = 'x';
246 ASSERT_EQ(0, mbtowc(out, "hello", 0));
247 ASSERT_EQ('x', out[0]);
249 ASSERT_EQ(0, mbtowc(out, "hello", 0));
250 ASSERT_EQ(0, mbtowc(out, "", 0));
251 ASSERT_EQ(1, mbtowc(out, "hello", 1));
252 ASSERT_EQ(L'h', out[0]);
262 wchar_t out[8];
264 out[0] = 'x';
265 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, NULL));
266 ASSERT_EQ('x', out[0]);
268 ASSERT_EQ(0U, mbrtowc(out, "hello", 0, NULL));
269 ASSERT_EQ(0U, mbrtowc(out, "", 0, NULL));
270 ASSERT_EQ(1U, mbrtowc(out, "hello", 1, NULL));
271 ASSERT_EQ(L'h', out[0]);
283 ASSERT_EQ(1U, mbrtowc(out, "abcdef", 6, NULL));
284 ASSERT_EQ(L'a', out[0]);
286 ASSERT_EQ(2U, mbrtowc(out, "\xc2\xa2" "cdef", 6, NULL));
287 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[0]);
289 ASSERT_EQ(3U, mbrtowc(out, "\xe2\x82\xac" "def", 6, NULL));
290 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[0]);
292 ASSERT_EQ(4U, mbrtowc(out, "\xf0\xa4\xad\xa2" "ef", 6, NULL));
293 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[0]);
296 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, NULL));
300 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(out, "\xf0\x82\x82\xac" "ef", 6, NULL));
308 wchar_t out;
310 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps));
311 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "cdef", 5, ps));
312 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out);
315 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xe2", 1, ps));
316 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\x82", 1, ps));
317 ASSERT_EQ(1U, mbrtowc(&out, "\xac" "def", 4, ps));
318 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out);
321 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xf0", 1, ps));
322 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xa4\xad", 2, ps));
323 ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "ef", 3, ps));
324 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out);
328 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, ps));
329 ASSERT_EQ(static_cast<size_t>(-1), mbrtowc(&out, "\x20" "cdef", 5, ps));
342 wchar_t out[4];
345 ASSERT_EQ(4U, mbsrtowcs(out, &valid, 4, ps));
346 ASSERT_EQ(L'A', out[0]);
347 ASSERT_EQ(static_cast<wchar_t>(0x00a2), out[1]);
348 ASSERT_EQ(static_cast<wchar_t>(0x20ac), out[2]);
349 ASSERT_EQ(static_cast<wchar_t>(0x24b62), out[3]);
353 wmemset(out, L'x', NUM_WCHARS(sizeof(out)));
354 ASSERT_EQ(2U, mbsrtowcs(out, &valid, 4, ps));
355 ASSERT_EQ(L'e', out[0]);
356 ASSERT_EQ(L'f', out[1]);
357 ASSERT_EQ(L'\0', out[2]);
358 // Check that we didn't clobber the rest of out.
359 ASSERT_EQ(L'x', out[3]);
364 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &invalid, 4, ps));
369 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(out, &incomplete, 2, ps));
385 wchar_t out;
386 ASSERT_EQ(static_cast<size_t>(-2), mbrtowc(&out, "\xc2", 1, &ps));
387 ASSERT_EQ(static_cast<size_t>(-1), mbsrtowcs(&out, &invalid, 1, &ps));