Home | History | Annotate | Download | only in tests

Lines Matching defs:bytes

33   char bytes[] = { 'h', 'e', 'l', 'l', 'o', '\0' };
34 EXPECT_EQ(0U, mbrlen(&bytes[0], 0, NULL));
35 EXPECT_EQ(1U, mbrlen(&bytes[0], 1, NULL));
37 EXPECT_EQ(1U, mbrlen(&bytes[4], 1, NULL));
38 EXPECT_EQ(0U, mbrlen(&bytes[5], 1, NULL));
48 char bytes[MB_LEN_MAX];
51 EXPECT_EQ(1, wctomb(bytes, L'\0'));
52 EXPECT_EQ(1U, wcrtomb(bytes, L'\0', NULL));
55 memset(bytes, 0, sizeof(bytes));
56 EXPECT_EQ(1, wctomb(bytes, L'h'));
57 EXPECT_EQ('h', bytes[0]);
58 memset(bytes, 0, sizeof(bytes));
59 EXPECT_EQ(1U, wcrtomb(bytes, L'h', NULL));
60 EXPECT_EQ('h', bytes[0]);
66 memset(bytes, 0, sizeof(bytes));
67 EXPECT_EQ(1U, wcrtomb(bytes, L'h', NULL));
68 EXPECT_EQ('h', bytes[0]);
70 memset(bytes, 0, sizeof(bytes));
71 EXPECT_EQ(2U, wcrtomb(bytes, 0x00a2, NULL));
72 EXPECT_EQ('\xc2', bytes[0]);
73 EXPECT_EQ('\xa2', bytes[1]);
75 memset(bytes, 0, sizeof(bytes));
76 EXPECT_EQ(3U, wcrtomb(bytes, 0x20ac, NULL));
77 EXPECT_EQ('\xe2', bytes[0]);
78 EXPECT_EQ('\x82', bytes[1]);
79 EXPECT_EQ('\xac', bytes[2]);
81 memset(bytes, 0, sizeof(bytes));
82 EXPECT_EQ(4U, wcrtomb(bytes, 0x24b62, NULL));
83 EXPECT_EQ('\xf0', bytes[0]);
84 EXPECT_EQ('\xa4', bytes[1]);
85 EXPECT_EQ('\xad', bytes[2]);
86 EXPECT_EQ('\xa2', bytes[3]);
88 EXPECT_EQ(static_cast<size_t>(-1), wcrtomb(bytes, 0xffffffff, NULL));
119 char bytes[BUFSIZ];
157 memset(bytes, 'x', sizeof(bytes));
158 EXPECT_EQ(0U, wcstombs(bytes, chars, 0));
159 memset(bytes, 'x', sizeof(bytes));
160 EXPECT_EQ(4U, wcstombs(bytes, chars, 4));
161 bytes[5] = 0;
162 EXPECT_STREQ("hellx", bytes);
163 memset(bytes, 'x', sizeof(bytes));
164 EXPECT_EQ(5U, wcstombs(bytes, chars, 256));
165 EXPECT_STREQ("hello", bytes);
166 memset(bytes, 'x', sizeof(bytes));
167 EXPECT_EQ(5U, wcstombs(bytes, chars, 6));
168 EXPECT_STREQ("hello", bytes);
170 memset(bytes, 'x', sizeof(bytes));
171 EXPECT_EQ(static_cast<size_t>(-1), wcstombs(bytes, bad_chars, 256));
173 bytes[3] = 0;
174 EXPECT_STREQ("hix", bytes);
177 memset(bytes, 'x', sizeof(bytes));
179 EXPECT_EQ(0U, wcsrtombs(bytes, &src, 0, NULL));
183 memset(bytes, 'x', sizeof(bytes));
185 EXPECT_EQ(4U, wcsrtombs(bytes, &src, 4, NULL));
188 bytes[5] = 0;
189 EXPECT_STREQ("hellx", bytes);
191 memset(bytes, 'x', sizeof(bytes));
193 EXPECT_EQ(5U, wcsrtombs(bytes, &src, 256, NULL));
196 EXPECT_STREQ("hello", bytes);
198 memset(bytes, 'x', sizeof(bytes));
200 EXPECT_EQ(5U, wcsrtombs(bytes, &src, 6, NULL));
203 EXPECT_STREQ("hello", bytes);
205 memset(bytes, 'x', sizeof(bytes));
207 EXPECT_EQ(static_cast<size_t>(-1), wcsrtombs(bytes, &src, 256, NULL));
210 bytes[3] = 0;
211 EXPECT_STREQ("hix", bytes);