Lines Matching refs:bytes

37   char bytes[] = { 'h', 'e', 'l', 'l', 'o', '\0' };  in TEST()  local
38 EXPECT_EQ(0U, mbrlen(&bytes[0], 0, nullptr)); in TEST()
39 EXPECT_EQ(1U, mbrlen(&bytes[0], 1, nullptr)); in TEST()
41 EXPECT_EQ(1U, mbrlen(&bytes[4], 1, nullptr)); in TEST()
42 EXPECT_EQ(0U, mbrlen(&bytes[5], 1, nullptr)); in TEST()
52 char bytes[MB_LEN_MAX]; in TEST() local
55 EXPECT_EQ(1, wctomb(bytes, L'\0')); in TEST()
56 EXPECT_EQ(1U, wcrtomb(bytes, L'\0', nullptr)); in TEST()
59 memset(bytes, 0, sizeof(bytes)); in TEST()
60 EXPECT_EQ(1, wctomb(bytes, L'h')); in TEST()
61 EXPECT_EQ('h', bytes[0]); in TEST()
62 memset(bytes, 0, sizeof(bytes)); in TEST()
63 EXPECT_EQ(1U, wcrtomb(bytes, L'h', nullptr)); in TEST()
64 EXPECT_EQ('h', bytes[0]); in TEST()
70 memset(bytes, 0, sizeof(bytes)); in TEST()
71 EXPECT_EQ(1U, wcrtomb(bytes, L'h', nullptr)); in TEST()
72 EXPECT_EQ('h', bytes[0]); in TEST()
74 memset(bytes, 0, sizeof(bytes)); in TEST()
75 EXPECT_EQ(2U, wcrtomb(bytes, 0x00a2, nullptr)); in TEST()
76 EXPECT_EQ('\xc2', bytes[0]); in TEST()
77 EXPECT_EQ('\xa2', bytes[1]); in TEST()
79 memset(bytes, 0, sizeof(bytes)); in TEST()
80 EXPECT_EQ(3U, wcrtomb(bytes, 0x20ac, nullptr)); in TEST()
81 EXPECT_EQ('\xe2', bytes[0]); in TEST()
82 EXPECT_EQ('\x82', bytes[1]); in TEST()
83 EXPECT_EQ('\xac', bytes[2]); in TEST()
85 memset(bytes, 0, sizeof(bytes)); in TEST()
86 EXPECT_EQ(4U, wcrtomb(bytes, 0x24b62, nullptr)); in TEST()
87 EXPECT_EQ('\xf0', bytes[0]); in TEST()
88 EXPECT_EQ('\xa4', bytes[1]); in TEST()
89 EXPECT_EQ('\xad', bytes[2]); in TEST()
90 EXPECT_EQ('\xa2', bytes[3]); in TEST()
92 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(bytes, 0xffffffff, nullptr)); in TEST()
123 char bytes[BUFSIZ]; in TEST() local
161 memset(bytes, 'x', sizeof(bytes)); in TEST()
162 EXPECT_EQ(0U, wcstombs(bytes, chars, 0)); in TEST()
163 memset(bytes, 'x', sizeof(bytes)); in TEST()
164 EXPECT_EQ(4U, wcstombs(bytes, chars, 4)); in TEST()
165 bytes[5] = 0; in TEST()
166 EXPECT_STREQ("hellx", bytes); in TEST()
167 memset(bytes, 'x', sizeof(bytes)); in TEST()
168 EXPECT_EQ(5U, wcstombs(bytes, chars, 256)); in TEST()
169 EXPECT_STREQ("hello", bytes); in TEST()
170 memset(bytes, 'x', sizeof(bytes)); in TEST()
171 EXPECT_EQ(5U, wcstombs(bytes, chars, 6)); in TEST()
172 EXPECT_STREQ("hello", bytes); in TEST()
174 memset(bytes, 'x', sizeof(bytes)); in TEST()
175 EXPECT_EQ(static_cast<size_t>(-1), wcstombs(bytes, bad_chars, 256)); in TEST()
177 bytes[3] = 0; in TEST()
178 EXPECT_STREQ("hix", bytes); in TEST()
181 memset(bytes, 'x', sizeof(bytes)); in TEST()
183 EXPECT_EQ(0U, wcsrtombs(bytes, &src, 0, nullptr)); in TEST()
187 memset(bytes, 'x', sizeof(bytes)); in TEST()
189 EXPECT_EQ(4U, wcsrtombs(bytes, &src, 4, nullptr)); in TEST()
192 bytes[5] = 0; in TEST()
193 EXPECT_STREQ("hellx", bytes); in TEST()
195 memset(bytes, 'x', sizeof(bytes)); in TEST()
197 EXPECT_EQ(5U, wcsrtombs(bytes, &src, 256, nullptr)); in TEST()
200 EXPECT_STREQ("hello", bytes); in TEST()
202 memset(bytes, 'x', sizeof(bytes)); in TEST()
204 EXPECT_EQ(5U, wcsrtombs(bytes, &src, 6, nullptr)); in TEST()
207 EXPECT_STREQ("hello", bytes); in TEST()
209 memset(bytes, 'x', sizeof(bytes)); in TEST()
211 EXPECT_EQ(static_cast<size_t>(-1), wcsrtombs(bytes, &src, 256, nullptr)); in TEST()
214 bytes[3] = 0; in TEST()
215 EXPECT_STREQ("hix", bytes); in TEST()