Lines Matching refs:out
33 char out[MB_LEN_MAX]; in TEST() local
39 EXPECT_EQ(static_cast<size_t>(-1), c32rtomb(out, 0x00a2, &ps)); in TEST()
51 EXPECT_EQ(1U, c32rtomb(out, L'\0', &ps)); in TEST()
119 char16_t out; in TEST() local
121 out = L'x'; in TEST()
122 ASSERT_EQ(0U, mbrtoc16(&out, "hello", 0, nullptr)); in TEST()
123 ASSERT_EQ(L'x', out); in TEST()
125 ASSERT_EQ(0U, mbrtoc16(&out, "hello", 0, nullptr)); in TEST()
126 ASSERT_EQ(0U, mbrtoc16(&out, "", 0, nullptr)); in TEST()
127 ASSERT_EQ(1U, mbrtoc16(&out, "hello", 1, nullptr)); in TEST()
128 ASSERT_EQ(L'h', out); in TEST()
132 char16_t out; in TEST() local
138 ASSERT_EQ(1U, mbrtoc16(&out, "abcdef", 6, nullptr)); in TEST()
139 ASSERT_EQ(L'a', out); in TEST()
141 ASSERT_EQ(2U, mbrtoc16(&out, "\xc2\xa2" "cdef", 6, nullptr)); in TEST()
142 ASSERT_EQ(static_cast<char16_t>(0x00a2), out); in TEST()
144 ASSERT_EQ(3U, mbrtoc16(&out, "\xe2\x82\xac" "def", 6, nullptr)); in TEST()
145 ASSERT_EQ(static_cast<char16_t>(0x20ac), out); in TEST()
149 char16_t out; in TEST() local
152 mbrtoc16(&out, "\xf4\x8a\xaf\x8d", 6, nullptr)); in TEST()
153 ASSERT_EQ(static_cast<char16_t>(0xdbea), out); in TEST()
154 ASSERT_EQ(4U, mbrtoc16(&out, "\xf4\x8a\xaf\x8d" "ef", 6, nullptr)); in TEST()
155 ASSERT_EQ(static_cast<char16_t>(0xdfcd), out); in TEST()
159 char16_t out; in TEST() local
161 mbrtoc16(&out, "\xf0\x80\xbf\xbf", 6, nullptr)); in TEST()
165 char16_t out; in TEST() local
167 mbrtoc16(&out, "\xf5\x80\x80\x80", 6, nullptr)); in TEST()
174 char16_t out; in test_mbrtoc16_incomplete() local
176 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\xc2", 1, ps)); in test_mbrtoc16_incomplete()
177 ASSERT_EQ(1U, mbrtoc16(&out, "\xa2" "cdef", 5, ps)); in test_mbrtoc16_incomplete()
178 ASSERT_EQ(static_cast<char16_t>(0x00a2), out); in test_mbrtoc16_incomplete()
181 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\xe2", 1, ps)); in test_mbrtoc16_incomplete()
182 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\x82", 1, ps)); in test_mbrtoc16_incomplete()
183 ASSERT_EQ(1U, mbrtoc16(&out, "\xac" "def", 4, ps)); in test_mbrtoc16_incomplete()
184 ASSERT_EQ(static_cast<char16_t>(0x20ac), out); in test_mbrtoc16_incomplete()
187 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\xf4", 1, ps)); in test_mbrtoc16_incomplete()
188 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\x8a\xaf", 2, ps)); in test_mbrtoc16_incomplete()
189 ASSERT_EQ(static_cast<size_t>(-3), mbrtoc16(&out, "\x8d" "ef", 3, ps)); in test_mbrtoc16_incomplete()
190 ASSERT_EQ(static_cast<char16_t>(0xdbea), out); in test_mbrtoc16_incomplete()
191 ASSERT_EQ(1U, mbrtoc16(&out, "\x80" "ef", 3, ps)); in test_mbrtoc16_incomplete()
192 ASSERT_EQ(static_cast<char16_t>(0xdfcd), out); in test_mbrtoc16_incomplete()
196 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc16(&out, "\xc2", 1, ps)); in test_mbrtoc16_incomplete()
197 ASSERT_EQ(static_cast<size_t>(-1), mbrtoc16(&out, "\x20" "cdef", 5, ps)); in test_mbrtoc16_incomplete()
258 char32_t out[8] = {}; in TEST() local
259 ASSERT_EQ(3U, mbrtoc32(out, "\xef\xbf\xbe", 3, nullptr)); in TEST()
260 ASSERT_EQ(0xfffeU, out[0]); in TEST()
261 ASSERT_EQ(3U, mbrtoc32(out, "\xef\xbf\xbf", 3, nullptr)); in TEST()
262 ASSERT_EQ(0xffffU, out[0]); in TEST()
269 char32_t out[8] = {}; in TEST() local
271 ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf5\x80\x80\x80", 4, nullptr)); in TEST()
276 char32_t out[8]; in TEST() local
278 out[0] = L'x'; in TEST()
279 ASSERT_EQ(0U, mbrtoc32(out, "hello", 0, nullptr)); in TEST()
280 ASSERT_EQ(static_cast<char32_t>(L'x'), out[0]); in TEST()
282 ASSERT_EQ(0U, mbrtoc32(out, "hello", 0, nullptr)); in TEST()
283 ASSERT_EQ(0U, mbrtoc32(out, "", 0, nullptr)); in TEST()
284 ASSERT_EQ(1U, mbrtoc32(out, "hello", 1, nullptr)); in TEST()
285 ASSERT_EQ(static_cast<char32_t>(L'h'), out[0]); in TEST()
297 ASSERT_EQ(1U, mbrtoc32(out, "abcdef", 6, nullptr)); in TEST()
298 ASSERT_EQ(static_cast<char32_t>(L'a'), out[0]); in TEST()
300 ASSERT_EQ(2U, mbrtoc32(out, "\xc2\xa2" "cdef", 6, nullptr)); in TEST()
301 ASSERT_EQ(static_cast<char32_t>(0x00a2), out[0]); in TEST()
303 ASSERT_EQ(3U, mbrtoc32(out, "\xe2\x82\xac" "def", 6, nullptr)); in TEST()
304 ASSERT_EQ(static_cast<char32_t>(0x20ac), out[0]); in TEST()
306 ASSERT_EQ(4U, mbrtoc32(out, "\xf0\xa4\xad\xa2" "ef", 6, nullptr)); in TEST()
307 ASSERT_EQ(static_cast<char32_t>(0x24b62), out[0]); in TEST()
310 ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf8\xa1\xa2\xa3\xa4" "f", 6, nullptr)); in TEST()
314 ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf0\x82\x82\xac" "ef", 6, nullptr)); in TEST()
322 char32_t out; in test_mbrtoc32_incomplete() local
324 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc32(&out, "\xc2", 1, ps)); in test_mbrtoc32_incomplete()
325 ASSERT_EQ(1U, mbrtoc32(&out, "\xa2" "cdef", 5, ps)); in test_mbrtoc32_incomplete()
326 ASSERT_EQ(static_cast<char32_t>(0x00a2), out); in test_mbrtoc32_incomplete()
329 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc32(&out, "\xe2", 1, ps)); in test_mbrtoc32_incomplete()
330 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc32(&out, "\x82", 1, ps)); in test_mbrtoc32_incomplete()
331 ASSERT_EQ(1U, mbrtoc32(&out, "\xac" "def", 4, ps)); in test_mbrtoc32_incomplete()
332 ASSERT_EQ(static_cast<char32_t>(0x20ac), out); in test_mbrtoc32_incomplete()
335 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc32(&out, "\xf0", 1, ps)); in test_mbrtoc32_incomplete()
336 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc32(&out, "\xa4\xad", 2, ps)); in test_mbrtoc32_incomplete()
337 ASSERT_EQ(1U, mbrtoc32(&out, "\xa2" "ef", 3, ps)); in test_mbrtoc32_incomplete()
338 ASSERT_EQ(static_cast<char32_t>(0x24b62), out); in test_mbrtoc32_incomplete()
342 ASSERT_EQ(static_cast<size_t>(-2), mbrtoc32(&out, "\xc2", 1, ps)); in test_mbrtoc32_incomplete()
343 ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(&out, "\x20" "cdef", 5, ps)); in test_mbrtoc32_incomplete()