5#include "testing/testing.h"
52#define STR_MB_ALPHA_1 "\x41"
53#define STR_MB_ALPHA_2 "\xc2\xaa"
54#define STR_MB_ALPHA_3 "\xe0\xa0\x80"
55#define STR_MB_ALPHA_4 "\xf0\x90\x80\x80"
61#define STR_MB_ALPHA_5 "\xf8\x80\x80\x80\x80"
62#define STR_MB_ALPHA_6 "\xfc\x80\x80\x80\x80\x80"
79 {
"You should see the Greek word 'kosme': \"\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5\" |",
80 "You should see the Greek word 'kosme': \"\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5\" |",
"\x00"},
86 {
"2.1.1 1 byte (U-00000000): \"\x00\" |",
87 "2.1.1 1 byte (U-00000000): \"\" |",
"\x01"},
88 {
"2.1.2 2 bytes (U-00000080): \"\xc2\x80\" |",
89 "2.1.2 2 bytes (U-00000080): \"\xc2\x80\" |",
"\x00"},
90 {
"2.1.3 3 bytes (U-00000800): \"\xe0\xa0\x80\" |",
91 "2.1.3 3 bytes (U-00000800): \"\xe0\xa0\x80\" |",
"\x00"},
92 {
"2.1.4 4 bytes (U-00010000): \"\xf0\x90\x80\x80\" |",
93 "2.1.4 4 bytes (U-00010000): \"\xf0\x90\x80\x80\" |",
"\x00"},
94 {
"2.1.5 5 bytes (U-00200000): \"\xf8\x88\x80\x80\x80\" |",
95 "2.1.5 5 bytes (U-00200000): \"\xf8\x88\x80\x80\x80\" |",
"\x00"},
96 {
"2.1.6 6 bytes (U-04000000): \"\xfc\x84\x80\x80\x80\x80\" |",
97 "2.1.6 6 bytes (U-04000000): \"\xfc\x84\x80\x80\x80\x80\" |",
"\x00"},
99 {
"2.2.1 1 byte (U-0000007F): \"\x7f\" |",
100 "2.2.1 1 byte (U-0000007F): \"\x7f\" |",
"\x00"},
101 {
"2.2.2 2 bytes (U-000007FF): \"\xdf\xbf\" |",
102 "2.2.2 2 bytes (U-000007FF): \"\xdf\xbf\" |",
"\x00"},
103 {
"2.2.3 3 bytes (U-0000FFFF): \"\xef\xbf\xbf\" |",
104 "2.2.3 3 bytes (U-0000FFFF): \"\" |",
"\x03"},
105 {
"2.2.4 4 bytes (U-001FFFFF): \"\xf7\xbf\xbf\xbf\" |",
106 "2.2.4 4 bytes (U-001FFFFF): \"\xf7\xbf\xbf\xbf\" |",
"\x00"},
107 {
"2.2.5 5 bytes (U-03FFFFFF): \"\xfb\xbf\xbf\xbf\xbf\" |",
108 "2.2.5 5 bytes (U-03FFFFFF): \"\xfb\xbf\xbf\xbf\xbf\" |",
"\x00"},
109 {
"2.2.6 6 bytes (U-7FFFFFFF): \"\xfd\xbf\xbf\xbf\xbf\xbf\" |",
110 "2.2.6 6 bytes (U-7FFFFFFF): \"\xfd\xbf\xbf\xbf\xbf\xbf\" |",
"\x00"},
112 {
"2.3.1 U-0000D7FF = ed 9f bf = \"\xed\x9f\xbf\" |",
113 "2.3.1 U-0000D7FF = ed 9f bf = \"\xed\x9f\xbf\" |",
"\x00"},
114 {
"2.3.2 U-0000E000 = ee 80 80 = \"\xee\x80\x80\" |",
115 "2.3.2 U-0000E000 = ee 80 80 = \"\xee\x80\x80\" |",
"\x00"},
116 {
"2.3.3 U-0000FFFD = ef bf bd = \"\xef\xbf\xbd\" |",
117 "2.3.3 U-0000FFFD = ef bf bd = \"\xef\xbf\xbd\" |",
"\x00"},
118 {
"2.3.4 U-0010FFFF = f4 8f bf bf = \"\xf4\x8f\xbf\xbf\" |",
119 "2.3.4 U-0010FFFF = f4 8f bf bf = \"\xf4\x8f\xbf\xbf\" |",
"\x00"},
120 {
"2.3.5 U-00110000 = f4 90 80 80 = \"\xf4\x90\x80\x80\" |",
121 "2.3.5 U-00110000 = f4 90 80 80 = \"\xf4\x90\x80\x80\" |",
"\x00"},
126 {
"3.1.1 First continuation byte 0x80: \"\x80\" |",
127 "3.1.1 First continuation byte 0x80: \"\" |",
"\x01"},
128 {
"3.1.2 Last continuation byte 0xbf: \"\xbf\" |",
129 "3.1.2 Last continuation byte 0xbf: \"\" |",
"\x01"},
130 {
"3.1.3 2 continuation bytes: \"\x80\xbf\" |",
131 "3.1.3 2 continuation bytes: \"\" |",
"\x02"},
132 {
"3.1.4 3 continuation bytes: \"\x80\xbf\x80\" |",
133 "3.1.4 3 continuation bytes: \"\" |",
"\x03"},
134 {
"3.1.5 4 continuation bytes: \"\x80\xbf\x80\xbf\" |",
135 "3.1.5 4 continuation bytes: \"\" |",
"\x04"},
136 {
"3.1.6 5 continuation bytes: \"\x80\xbf\x80\xbf\x80\" |",
137 "3.1.6 5 continuation bytes: \"\" |",
"\x05"},
138 {
"3.1.7 6 continuation bytes: \"\x80\xbf\x80\xbf\x80\xbf\" |",
139 "3.1.7 6 continuation bytes: \"\" |",
"\x06"},
140 {
"3.1.8 7 continuation bytes: \"\x80\xbf\x80\xbf\x80\xbf\x80\" |",
141 "3.1.8 7 continuation bytes: \"\" |",
"\x07"},
143 {
"3.1.9 \"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
144 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
145 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
146 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\" |",
147 "3.1.9 \"\" |",
"\x40"},
150 {
"3.2.1 \"\xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf "
151 "\xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \" |",
152 "3.2.1 \" \" |",
"\x20"},
154 {
"3.2.2 \"\xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \" |",
155 "3.2.2 \" \" |",
"\x10"},
157 {
"3.2.3 \"\xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \" |",
158 "3.2.3 \" \" |",
"\x08"},
160 {
"3.2.4 \"\xf8 \xf9 \xfa \xfb \" |",
161 "3.2.4 \" \" |",
"\x04"},
163 {
"3.2.4 \"\xfc \xfd \" |",
164 "3.2.4 \" \" |",
"\x02"},
169 {
"3.3.1 2-byte sequence with last byte missing (U+0000): \"\xc0\" |",
170 "3.3.1 2-byte sequence with last byte missing (U+0000): \"\" |",
"\x01"},
171 {
"3.3.2 3-byte sequence with last byte missing (U+0000): \"\xe0\x80\" |",
172 "3.3.2 3-byte sequence with last byte missing (U+0000): \"\" |",
"\x02"},
173 {
"3.3.3 4-byte sequence with last byte missing (U+0000): \"\xf0\x80\x80\" |",
174 "3.3.3 4-byte sequence with last byte missing (U+0000): \"\" |",
"\x03"},
175 {
"3.3.4 5-byte sequence with last byte missing (U+0000): \"\xf8\x80\x80\x80\" |",
176 "3.3.4 5-byte sequence with last byte missing (U+0000): \"\" |",
"\x04"},
177 {
"3.3.5 6-byte sequence with last byte missing (U+0000): \"\xfc\x80\x80\x80\x80\" |",
178 "3.3.5 6-byte sequence with last byte missing (U+0000): \"\" |",
"\x05"},
179 {
"3.3.6 2-byte sequence with last byte missing (U-000007FF): \"\xdf\" |",
180 "3.3.6 2-byte sequence with last byte missing (U-000007FF): \"\" |",
"\x01"},
181 {
"3.3.7 3-byte sequence with last byte missing (U-0000FFFF): \"\xef\xbf\" |",
182 "3.3.7 3-byte sequence with last byte missing (U-0000FFFF): \"\" |",
"\x02"},
183 {
"3.3.8 4-byte sequence with last byte missing (U-001FFFFF): \"\xf7\xbf\xbf\" |",
184 "3.3.8 4-byte sequence with last byte missing (U-001FFFFF): \"\" |",
"\x03"},
185 {
"3.3.9 5-byte sequence with last byte missing (U-03FFFFFF): \"\xfb\xbf\xbf\xbf\" |",
186 "3.3.9 5-byte sequence with last byte missing (U-03FFFFFF): \"\" |",
"\x04"},
187 {
"3.3.10 6-byte sequence with last byte missing (U-7FFFFFFF): \"\xfd\xbf\xbf\xbf\xbf\" |",
188 "3.3.10 6-byte sequence with last byte missing (U-7FFFFFFF): \"\" |",
"\x05"},
191 {
"3.4 \"\xc0\xe0\x80\xf0\x80\x80\xf8\x80\x80\x80\xfc\x80\x80\x80\x80"
192 "\xdf\xef\xbf\xf7\xbf\xbf\xfb\xbf\xbf\xbf\xfd\xbf\xbf\xbf\xbf\""
194 "3.4 \"\" |",
"\x1e"},
197 {
"3.5.1 fe = \"\xfe\" |",
198 "3.5.1 fe = \"\" |",
"\x01"},
199 {
"3.5.2 ff = \"\xff\" |",
200 "3.5.2 ff = \"\" |",
"\x01"},
201 {
"3.5.3 fe fe ff ff = \"\xfe\xfe\xff\xff\" |",
202 "3.5.3 fe fe ff ff = \"\" |",
"\x04"},
222 {
"4.1.1 U+002F = c0 af = \"\xc0\xaf\" |",
223 "4.1.1 U+002F = c0 af = \"\" |",
"\x02"},
224 {
"4.1.2 U+002F = e0 80 af = \"\xe0\x80\xaf\" |",
225 "4.1.2 U+002F = e0 80 af = \"\" |",
"\x03"},
226 {
"4.1.3 U+002F = f0 80 80 af = \"\xf0\x80\x80\xaf\" |",
227 "4.1.3 U+002F = f0 80 80 af = \"\" |",
"\x04"},
228 {
"4.1.4 U+002F = f8 80 80 80 af = \"\xf8\x80\x80\x80\xaf\" |",
229 "4.1.4 U+002F = f8 80 80 80 af = \"\" |",
"\x05"},
230 {
"4.1.5 U+002F = fc 80 80 80 80 af = \"\xfc\x80\x80\x80\x80\xaf\" |",
231 "4.1.5 U+002F = fc 80 80 80 80 af = \"\" |",
"\x06"},
236 {
"4.2.1 U-0000007F = c1 bf = \"\xc1\xbf\" |",
237 "4.2.1 U-0000007F = c1 bf = \"\" |",
"\x02"},
238 {
"4.2.2 U-000007FF = e0 9f bf = \"\xe0\x9f\xbf\" |",
239 "4.2.2 U-000007FF = e0 9f bf = \"\" |",
"\x03"},
240 {
"4.2.3 U-0000FFFF = f0 8f bf bf = \"\xf0\x8f\xbf\xbf\" |",
241 "4.2.3 U-0000FFFF = f0 8f bf bf = \"\" |",
"\x04"},
242 {
"4.2.4 U-001FFFFF = f8 87 bf bf bf = \"\xf8\x87\xbf\xbf\xbf\" |",
243 "4.2.4 U-001FFFFF = f8 87 bf bf bf = \"\" |",
"\x05"},
244 {
"4.2.5 U+0000 = fc 83 bf bf bf bf = \"\xfc\x83\xbf\xbf\xbf\xbf\" |",
245 "4.2.5 U+0000 = fc 83 bf bf bf bf = \"\" |",
"\x06"},
249 {
"4.3.1 U+0000 = c0 80 = \"\xc0\x80\" |",
250 "4.3.1 U+0000 = c0 80 = \"\" |",
"\x02"},
251 {
"4.3.2 U+0000 = e0 80 80 = \"\xe0\x80\x80\" |",
252 "4.3.2 U+0000 = e0 80 80 = \"\" |",
"\x03"},
253 {
"4.3.3 U+0000 = f0 80 80 80 = \"\xf0\x80\x80\x80\" |",
254 "4.3.3 U+0000 = f0 80 80 80 = \"\" |",
"\x04"},
255 {
"4.3.4 U+0000 = f8 80 80 80 80 = \"\xf8\x80\x80\x80\x80\" |",
256 "4.3.4 U+0000 = f8 80 80 80 80 = \"\" |",
"\x05"},
257 {
"4.3.5 U+0000 = fc 80 80 80 80 80 = \"\xfc\x80\x80\x80\x80\x80\" |",
258 "4.3.5 U+0000 = fc 80 80 80 80 80 = \"\" |",
"\x06"},
265 {
"5.1.1 U+D800 = ed a0 80 = \"\xed\xa0\x80\" |",
266 "5.1.1 U+D800 = ed a0 80 = \"\" |",
"\x03"},
267 {
"5.1.2 U+DB7F = ed ad bf = \"\xed\xad\xbf\" |",
268 "5.1.2 U+DB7F = ed ad bf = \"\" |",
"\x03"},
269 {
"5.1.3 U+DB80 = ed ae 80 = \"\xed\xae\x80\" |",
270 "5.1.3 U+DB80 = ed ae 80 = \"\" |",
"\x03"},
271 {
"5.1.4 U+DBFF = ed af bf = \"\xed\xaf\xbf\" |",
272 "5.1.4 U+DBFF = ed af bf = \"\" |",
"\x03"},
273 {
"5.1.5 U+DC00 = ed b0 80 = \"\xed\xb0\x80\" |",
274 "5.1.5 U+DC00 = ed b0 80 = \"\" |",
"\x03"},
275 {
"5.1.6 U+DF80 = ed be 80 = \"\xed\xbe\x80\" |",
276 "5.1.6 U+DF80 = ed be 80 = \"\" |",
"\x03"},
277 {
"5.1.7 U+DFFF = ed bf bf = \"\xed\xbf\xbf\" |",
278 "5.1.7 U+DFFF = ed bf bf = \"\" |",
"\x03"},
280 {
"5.2.1 U+D800 U+DC00 = ed a0 80 ed b0 80 = \"\xed\xa0\x80\xed\xb0\x80\" |",
281 "5.2.1 U+D800 U+DC00 = ed a0 80 ed b0 80 = \"\" |",
"\x06"},
282 {
"5.2.2 U+D800 U+DFFF = ed a0 80 ed bf bf = \"\xed\xa0\x80\xed\xbf\xbf\" |",
283 "5.2.2 U+D800 U+DFFF = ed a0 80 ed bf bf = \"\" |",
"\x06"},
284 {
"5.2.3 U+DB7F U+DC00 = ed ad bf ed b0 80 = \"\xed\xad\xbf\xed\xb0\x80\" |",
285 "5.2.3 U+DB7F U+DC00 = ed ad bf ed b0 80 = \"\" |",
"\x06"},
286 {
"5.2.4 U+DB7F U+DFFF = ed ad bf ed bf bf = \"\xed\xad\xbf\xed\xbf\xbf\" |",
287 "5.2.4 U+DB7F U+DFFF = ed ad bf ed bf bf = \"\" |",
"\x06"},
288 {
"5.2.5 U+DB80 U+DC00 = ed ae 80 ed b0 80 = \"\xed\xae\x80\xed\xb0\x80\" |",
289 "5.2.5 U+DB80 U+DC00 = ed ae 80 ed b0 80 = \"\" |",
"\x06"},
290 {
"5.2.6 U+DB80 U+DFFF = ed ae 80 ed bf bf = \"\xed\xae\x80\xed\xbf\xbf\" |",
291 "5.2.6 U+DB80 U+DFFF = ed ae 80 ed bf bf = \"\" |",
"\x06"},
292 {
"5.2.7 U+DBFF U+DC00 = ed af bf ed b0 80 = \"\xed\xaf\xbf\xed\xb0\x80\" |",
293 "5.2.7 U+DBFF U+DC00 = ed af bf ed b0 80 = \"\" |",
"\x06"},
294 {
"5.2.8 U+DBFF U+DFFF = ed af bf ed bf bf = \"\xed\xaf\xbf\xed\xbf\xbf\" |",
295 "5.2.8 U+DBFF U+DFFF = ed af bf ed bf bf = \"\" |",
"\x06"},
310 {
"5.3.1 U+FFFE = ef bf be = \"\xef\xbf\xbe\" |",
311 "5.3.1 U+FFFE = ef bf be = \"\" |",
"\x03"},
312 {
"5.3.2 U+FFFF = ef bf bf = \"\xef\xbf\xbf\" |",
313 "5.3.2 U+FFFF = ef bf bf = \"\" |",
"\x03"},
317 {
nullptr,
nullptr,
nullptr},
330 memcpy(buff, tst,
sizeof(buff));
334 printf(
"[%02d] -> [%02d] \"%s\" -> \"%s\"\n", errors_num, errors_found_num, tst, buff);
336 EXPECT_STREQ(buff, tst_stripped);
353TEST(
string, StringNLenUTF8_Incomplete)
355 const char *ref_str =
358 const size_t ref_str_len = 21;
360#define EXPECT_BYTE_OFFSET(truncate_ofs, expect_nchars) \
362 size_t buf_ofs = 0; \
363 strcpy(buf, ref_str); \
364 buf[truncate_ofs] = '\0'; \
365 EXPECT_EQ(BLI_strnlen_utf8_ex(buf, ref_str_len, &buf_ofs), expect_nchars); \
366 EXPECT_EQ(buf_ofs, truncate_ofs); \
397#undef EXPECT_BYTE_OFFSET
406TEST(
string, Utf8OffsetFromIndex_ClampedIndex)
410 const char *test_strings[] = {
420 for (
int i = 0; i <
ARRAY_SIZE(test_strings); i++) {
421 const char *
str = test_strings[i];
422 const size_t str_len = strlen(
str);
439 size_t i = 0, result_len = 0;
440 while ((i < str_len) && (
str[i] !=
'\0')) {
446template<
size_t Size,
size_t SizeWithPadding>
449 char utf8_src_with_pad[SizeWithPadding] = {0};
451 memcpy(utf8_src_with_pad, utf8_src, Size);
453 char32_t unicode_dst_a[Size], unicode_dst_b[Size];
455 memset(unicode_dst_a, 0xff,
sizeof(unicode_dst_a));
456 const size_t index_a =
utf8_as_char32(utf8_src, Size, unicode_dst_a);
460 for (
int pass = 0; pass < 2; pass++) {
461 memset(unicode_dst_b, 0xff,
sizeof(unicode_dst_b));
463 utf8_src_with_pad, pass ? Size : SizeWithPadding, unicode_dst_b);
466 EXPECT_EQ_ARRAY(unicode_dst_a, unicode_dst_b, Size);
486 for (
int i = 0; i <= 0xff; i++) {
487 memset(utf8_src, i,
sizeof(utf8_src));
493 for (
int ofs = 1; ofs <
int(Size); ofs++) {
494 utf8_src[ofs] = char(i + (ofs *
mul));
498 for (
int ofs = 1; ofs <
int(Size); ofs++) {
499 utf8_src[ofs] = char(i - (ofs *
mul));
508 for (
int i = 0; i < 256; i++) {
539TEST(
string, StrCursorStepNextUtf32Empty)
541 const char32_t empty[] =
U"";
542 const size_t len = 0;
555TEST(
string, StrCursorStepNextUtf32Single)
558 const char32_t single[] =
U"0";
559 const size_t len = 1;
571TEST(
string, StrCursorStepNextUtf32Simple)
573 const char32_t simple[] =
U"012";
574 const size_t len = 3;
589TEST(
string, StrCursorStepNextUtf32AllCombining)
591 const char32_t allcombining[] =
U"\u0300\u0300\u0300";
592 const size_t len = 3;
609TEST(
string, StrCursorStepNextUtf32Complex)
612 const char32_t complex[] =
U"\u0300\u0041\u0300\u0320\u0042";
613 const size_t len = 5;
634TEST(
string, StrCursorStepNextUtf32Invalid)
637 const char32_t invalid[] =
U"\u00C0\u0300\u0009\u0300\u000D\u0300\u000A\u0300";
638 const size_t len = 8;
665TEST(
string, StrCursorStepPrevUtf32Empty)
667 const char32_t emtpy[] =
U"";
668 const size_t len = 0;
679TEST(
string, StrCursorStepPrevUtf32Single)
681 const char32_t single[] =
U"0";
682 const size_t len = 1;
694TEST(
string, StrCursorStepPrevUtf32Simple)
696 const char32_t simple[] =
U"012";
697 const size_t len = 3;
711TEST(
string, StrCursorStepPrevUtf32AllCombining)
713 const char32_t allcombining[] =
U"\u0300\u0300\u0300";
714 const size_t len = 3;
731TEST(
string, StrCursorStepPrevUtf32Complex)
734 const char32_t complex[] =
U"\u0300\u0041\u0300\u0320\u0042";
735 const size_t len = 5;
756TEST(
string, StrCursorStepPrevUtf32Invalid)
759 const char32_t invalid[] =
U"\u00C0\u0300\u0009\u0300\u000D\u0300\u000A\u0300";
760 const size_t len = 8;
786TEST(
string, StrCursorStepNextUtf8Empty)
788 const char empty[] =
"";
789 const size_t len = 0;
801TEST(
string, StrCursorStepNextUtf8Single)
803 const char single[] =
"0";
804 const size_t len = 1;
816TEST(
string, StrCursorStepNextUtf8Simple)
818 const char simple[] =
"012";
819 const size_t len = 3;
834TEST(
string, StrCursorStepNextUtf8AllCombining)
836 const char allcombining[] =
"\xCC\x80\xCC\x80\xCC\x80";
837 const size_t len = 6;
860TEST(
string, StrCursorStepNextUtf8AllComplex)
863 const char complex[] =
"\xCC\x80\x41\xC2\xA9\xCC\x80\xCC\xA0\x42";
864 const size_t len = 10;
895TEST(
string, StrCursorStepNextUtf8Invalid)
898 const char invalid[] =
"\xC0\xCC\x80\x09\x0D\x0A\xCC\x80";
899 const size_t len = 8;
926TEST(
string, StrCursorStepPrevUtf8Empty)
928 const char empty[] =
"";
929 const size_t len = 0;
942TEST(
string, StrCursorStepPrevUtf8Single)
944 const char single[] =
"0";
945 const size_t len = 1;
957TEST(
string, StrCursorStepPrevUtf8Simple)
959 const char simple[] =
"012";
960 const size_t len = 3;
974TEST(
string, StrCursorStepPrevUtf8AllCombining)
976 const char allcombining[] =
"\xCC\x80\xCC\x80\xCC\x80";
977 const size_t len = 6;
1000TEST(
string, StrCursorStepPrevUtf8Complex)
1003 const char complex[] =
"\xCC\x80\x41\xC2\xA9\xCC\x80\xCC\xA0\x42";
1004 const size_t len = 10;
1035TEST(
string, StrCursorStepPrevUtf8Invalid)
1038 const char invalid[] =
"\xC0\xCC\x80\x09\x0D\x0A\xCC\x80";
1039 const size_t len = 8;
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
struct RNG * BLI_rng_new(unsigned int seed)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
void BLI_rng_get_char_n(RNG *rng, char *bytes, size_t bytes_len) ATTR_NONNULL(1
bool BLI_str_cursor_step_prev_utf32(const char32_t *str, int str_maxlen, int *pos)
bool BLI_str_cursor_step_next_utf8(const char *str, int str_maxlen, int *pos)
bool BLI_str_cursor_step_prev_utf8(const char *str, int str_maxlen, int *pos)
bool BLI_str_cursor_step_next_utf32(const char32_t *str, int str_maxlen, int *pos)
int BLI_str_utf8_offset_from_index(const char *str, size_t str_len, int index_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t size_t BLI_strnlen_utf8(const char *strc, size_t strc_maxlen) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
size_t BLI_strlen_utf8(const char *strc) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_str_utf8_as_unicode_step_safe(const char *__restrict p, size_t p_len, size_t *__restrict index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int BLI_str_utf8_invalid_strip(char *str, size_t length) ATTR_NONNULL(1)
void utf8_as_char32_test_at_buffer_size()
#define EXPECT_BYTE_OFFSET(truncate_ofs, expect_nchars)
static size_t utf8_as_char32(const char *str, const char str_len, char32_t *r_result)
void utf8_as_char32_test_compare_with_pad_bytes(const char utf8_src[Size])
void utf8_as_char32_test_compare(const char utf8_src[Size])
TEST(string, Utf8InvalidBytes)
static const char * utf8_invalid_tests[][3]
static void mul(btAlignedObjectArray< T > &items, const Q &value)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int