Home | History | Annotate | Download | only in tests

Lines Matching defs:bytes

35   char bytes[] = { 'h', 'e', 'l', 'l', 'o', '\0' };
36 EXPECT_EQ(0U, mbrlen(&bytes[0], 0, NULL));
37 EXPECT_EQ(1U, mbrlen(&bytes[0], 1, NULL));
39 EXPECT_EQ(1U, mbrlen(&bytes[4], 1, NULL));
40 EXPECT_EQ(0U, mbrlen(&bytes[5], 1, NULL));
50 char bytes[MB_LEN_MAX];
53 EXPECT_EQ(1, wctomb(bytes, L'\0'));
54 EXPECT_EQ(1U, wcrtomb(bytes, L'\0', NULL));
57 memset(bytes, 0, sizeof(bytes));
58 EXPECT_EQ(1, wctomb(bytes, L'h'));
59 EXPECT_EQ('h', bytes[0]);
60 memset(bytes, 0, sizeof(bytes));
61 EXPECT_EQ(1U, wcrtomb(bytes, L'h', NULL));
62 EXPECT_EQ('h', bytes[0]);
68 memset(bytes, 0, sizeof(bytes));
69 EXPECT_EQ(1U, wcrtomb(bytes, L'h', NULL));
70 EXPECT_EQ('h', bytes[0]);
72 memset(bytes, 0, sizeof(bytes));
73 EXPECT_EQ(2U, wcrtomb(bytes, 0x00a2, NULL));
74 EXPECT_EQ('\xc2', bytes[0]);
75 EXPECT_EQ('\xa2', bytes[1]);
77 memset(bytes, 0, sizeof(bytes));
78 EXPECT_EQ(3U, wcrtomb(bytes, 0x20ac, NULL));
79 EXPECT_EQ('\xe2', bytes[0]);
80 EXPECT_EQ('\x82', bytes[1]);
81 EXPECT_EQ('\xac', bytes[2]);
83 memset(bytes, 0, sizeof(bytes));
84 EXPECT_EQ(4U, wcrtomb(bytes, 0x24b62, NULL));
85 EXPECT_EQ('\xf0', bytes[0]);
86 EXPECT_EQ('\xa4', bytes[1]);
87 EXPECT_EQ('\xad', bytes[2]);
88 EXPECT_EQ('\xa2', bytes[3]);
90 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(bytes, 0xffffffff, NULL));
121 char bytes[BUFSIZ];
159 memset(bytes, 'x', sizeof(bytes));
160 EXPECT_EQ(0U, wcstombs(bytes, chars, 0));
161 memset(bytes, 'x', sizeof(bytes));
162 EXPECT_EQ(4U, wcstombs(bytes, chars, 4));
163 bytes[5] = 0;
164 EXPECT_STREQ("hellx", bytes);
165 memset(bytes, 'x', sizeof(bytes));
166 EXPECT_EQ(5U, wcstombs(bytes, chars, 256));
167 EXPECT_STREQ("hello", bytes);
168 memset(bytes, 'x', sizeof(bytes));
169 EXPECT_EQ(5U, wcstombs(bytes, chars, 6));
170 EXPECT_STREQ("hello", bytes);
172 memset(bytes, 'x', sizeof(bytes));
173 EXPECT_EQ(static_cast<size_t>(-1), wcstombs(bytes, bad_chars, 256));
175 bytes[3] = 0;
176 EXPECT_STREQ("hix", bytes);
179 memset(bytes, 'x', sizeof(bytes));
181 EXPECT_EQ(0U, wcsrtombs(bytes, &src, 0, NULL));
185 memset(bytes, 'x', sizeof(bytes));
187 EXPECT_EQ(4U, wcsrtombs(bytes, &src, 4, NULL));
190 bytes[5] = 0;
191 EXPECT_STREQ("hellx", bytes);
193 memset(bytes, 'x', sizeof(bytes));
195 EXPECT_EQ(5U, wcsrtombs(bytes, &src, 256, NULL));
198 EXPECT_STREQ("hello", bytes);
200 memset(bytes, 'x', sizeof(bytes));
202 EXPECT_EQ(5U, wcsrtombs(bytes, &src, 6, NULL));
205 EXPECT_STREQ("hello", bytes);
207 memset(bytes, 'x', sizeof(bytes));
209 EXPECT_EQ(static_cast<size_t>(-1), wcsrtombs(bytes, &src, 256, NULL));
212 bytes[3] = 0;
213 EXPECT_STREQ("hix", bytes);