41#define FindLastOf(sig) StringIds::find_last_of_ ## sig
43static const char*
const exceptions[] = {
44 "unknown exception",
"out_of_range",
"length_error",
45 "bad_alloc",
"exception"
56#define TEST(str, arg, res) \
57 { __LINE__, -1, -1, -1, -1, -1, \
58 str, sizeof str - 1, arg, \
59 sizeof arg - 1, 0, res, 0 \
79 TEST (
"abcdefghij",
"a", 0),
80 TEST (
"abcdefghij",
"f", 5),
81 TEST (
"abcdefghij",
"j", 9),
83 TEST (
"edfcbbhjig",
"cba", 5),
84 TEST (
"edfcbahjig",
"bca", 5),
85 TEST (
"edfcbahcba",
"cba", 9),
86 TEST (
"cbacbbhjig",
"cab", 5),
88 TEST (
"e\0cb\0\0g",
"b\0\0g", 3),
89 TEST (
"e\0cb\0\0g",
"ecb", 3),
91 TEST (
"\0cb\0\0ge",
"bc\0", 2),
92 TEST (
"e\0cbg\0\0",
"eg\0", 4),
93 TEST (
"e\0cdg\0\0",
"abc", 2),
95 TEST (
"a\0b",
"eb\0gg\0\0", 2),
99 TEST (
"bcaedfajih",
"a", 6),
100 TEST (
"bcedfaajih",
"a", 6),
101 TEST (
"bcaaedfaji",
"a", 7),
103 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 9),
104 TEST (
"aaaaabaaaa",
"cccccccccb", 5),
105 TEST (
"aabaabaaaa",
"cccccccccb", 5),
106 TEST (
"bbb",
"aaaaaaaaba", 2),
111 TEST (
"x@4096",
"x", 4095),
112 TEST (
"x@4096",
"xxx", 4095),
113 TEST (
"x@4096",
"aax", 4095),
115 TEST (
"xxxxxxxxxx",
"x@4096", 9),
116 TEST (
"xxax@2048",
"y@4096a", 2),
118 TEST (
"abcdefghij", 0, 9),
120 TEST (
"x@4096", 0, 4095),
122 TEST (
"last test",
"test", 8)
130cstr_test_cases [] = {
133#define TEST(str, arg, res) \
134 { __LINE__, -1, -1, -1, -1, -1, \
135 str, sizeof str - 1, arg, \
136 sizeof arg - 1, 0, res, 0 \
152 TEST (
"\0",
"\0", 0),
156 TEST (
"abcdefghij",
"a", 0),
157 TEST (
"abcdefghij",
"f", 5),
158 TEST (
"abcdefghij",
"j", 9),
160 TEST (
"edfcbbhjig",
"cba", 5),
161 TEST (
"edfcbahjig",
"bca", 5),
162 TEST (
"edfcbahcba",
"cba", 9),
163 TEST (
"cbacbbhjig",
"cab", 5),
165 TEST (
"e\0cb\0\0g",
"b\0\0g", 6),
166 TEST (
"e\0cb\0\0g",
"ecb", 3),
167 TEST (
"\0cb\0\0ge",
"\0\0ge", 6),
168 TEST (
"\0cb\0\0ge",
"bc\0", 4),
169 TEST (
"e\0cbg\0\0",
"eg\0", 6),
170 TEST (
"\0cbdaaaaa",
"eg\0", 0),
171 TEST (
"e\0cdg\0\0",
"abc", 2),
172 TEST (
"a\0b",
"e\0gbg\0\0", 2),
173 TEST (
"a\0b",
"ea\0gg\0\0", 1),
174 TEST (
"\0ab",
"e\0gg\0\0a", 1),
177 TEST (
"bcaedfajih",
"a", 6),
178 TEST (
"bcedfaajih",
"a", 6),
179 TEST (
"bcaaedfaji",
"a", 7),
181 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 9),
182 TEST (
"aaaaabaaaa",
"cccccccccb", 5),
183 TEST (
"aabaabaaaa",
"cccccccccb", 5),
184 TEST (
"bbb",
"aaaaaaaaba", 2),
189 TEST (
"x@4096",
"x", 4095),
190 TEST (
"x@4096",
"xxx", 4095),
191 TEST (
"x@4096",
"aax", 4095),
193 TEST (
"xxxxxxxxxx",
"x@4096", 9),
194 TEST (
"xxax@2048",
"y@4096a", 2),
196 TEST (
"abcdefghij", 0, 9),
197 TEST (
"\0cb\0\0ge", 0, 6),
198 TEST (
"x@4096", 0, 4095),
200 TEST (
"last test",
"test", 8)
208cptr_size_test_cases [] = {
211#define TEST(str, arg, off, res) { \
234 TEST (
"ab",
"a", 0, 0),
247 TEST (
"abcdefghij",
"a", 0, 0),
248 TEST (
"abcdefghij",
"a", 2, 0),
250 TEST (
"abcdefghij",
"f", 7, 5),
251 TEST (
"abcdefghij",
"j", 9, 9),
253 TEST (
"edfcbbhjig",
"cba", 9, 5),
254 TEST (
"edfcbahjag",
"cba", 7, 5),
255 TEST (
"edfcbahjig",
"cba", 4, 4),
256 TEST (
"edfcbahcba",
"cba", 1,
NPOS),
257 TEST (
"edfcbahcba",
"cba", 9, 9),
258 TEST (
"edfcbahcba",
"cba", 3, 3),
259 TEST (
"cbacbahjig",
"cba", 4, 4),
261 TEST (
"e\0cb\0\0g",
"b\0\0g", 5, 3),
262 TEST (
"e\0cb\0\0g",
"b\0\0g", 2,
NPOS),
263 TEST (
"e\0cb\0\0g",
"ecb", 7, 3),
264 TEST (
"\0cb\0\0ge",
"\0\0ge", 6,
NPOS),
265 TEST (
"\0cb\0\0ge",
"cb\0", 0,
NPOS),
266 TEST (
"\0cb\0\0ge",
"cb\0", 1, 1),
267 TEST (
"\0cb\0\0ge",
"cb\0", 2, 2),
269 TEST (
"e\0cbg\0\0",
"bg", 5, 4),
270 TEST (
"a\0b",
"e\0gbg\0\0", 3,
NPOS),
271 TEST (
"a\0b",
"eb\0gg\0\0", 3, 2),
272 TEST (
"a\0b",
"e\0gg\0\0a", 3,
NPOS),
275 TEST (
"bcaedfajih",
"a", 8, 6),
276 TEST (
"bcedfaajih",
"a", 6, 6),
277 TEST (
"bcaaedfaji",
"a", 8, 7),
279 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 9, 9),
280 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 4, 4),
281 TEST (
"aaaaabaaaa",
"cccccccccb", 8, 5),
282 TEST (
"aabaabaaaa",
"cccccccccb", 9, 5),
283 TEST (
"aabaabaaaa",
"cccccccccb", 3, 2),
284 TEST (
"bbb",
"aaaaaaaaba", 2, 2),
285 TEST (
"bab",
"aaaaaaaaba", 0, 0),
286 TEST (
"bbb",
"aaaaaaaaaa", 3,
NPOS),
290 TEST (
"x@4096",
"x", 4096, 4095),
291 TEST (
"x@4096",
"xxx", 4095, 4095),
292 TEST (
"x@4096",
"xxx", 0, 0),
293 TEST (
"x@4096",
"xxx", 4087, 4087),
294 TEST (
"x@4096",
"aax", 4087, 4087),
296 TEST (
"xxxxxxxxxx",
"x@4096", 6, 6),
297 TEST (
"xxax@2048",
"y@4096a", 2050, 2),
299 TEST (
"x@4096",
"xxx", 3, 3),
300 TEST (
"x@4096",
"xxx", 2, 2),
302 TEST (
"abcdefghij", 0, 0, 0),
303 TEST (
"abcdefghij", 0, 9, 9),
305 TEST (
"x@4096", 0, 0, 0),
306 TEST (
"x@4096", 0, 1, 1),
309 TEST (
"abcdefghij",
"abc", 10, 2),
310 TEST (
"abcdefghij",
"cba", 10, 2),
312 TEST (
"last test",
"test", 9, 8)
320cptr_size_size_test_cases [] = {
323#define TEST(str, arg, off, size, res, bthrow) \
324 { __LINE__, off, size, -1, -1, -1, \
325 str, sizeof str - 1, arg, \
326 sizeof arg - 1, 0, res, bthrow \
340 TEST (
"ab",
"a", 0, 1, 0, 0),
349 TEST (
"\0",
"\0", 0, 1, 0, 0),
350 TEST (
"\0",
"\0", 1, 1, 0, 0),
351 TEST (
"\0\0",
"\0\0", 1, 1, 1, 0),
354 TEST (
"edfcbbhjig",
"cba", 0, 3,
NPOS, 0),
355 TEST (
"edfcbbhjig",
"cba", 0, 2,
NPOS, 0),
356 TEST (
"edfcbbhjig",
"cba", 9, 2, 5, 0),
357 TEST (
"edfcbahjig",
"cba", 8, 3, 5, 0),
358 TEST (
"edfcbahjig",
"cba", 2, 3,
NPOS, 0),
359 TEST (
"edfcbahjig",
"cba", 2, 1,
NPOS, 0),
360 TEST (
"edfcbahcba",
"cba", 8, 3, 8, 0),
361 TEST (
"edfcbehcba",
"cab", 8, 2, 7, 0),
362 TEST (
"edfcbahcba",
"cba", 9, 3, 9, 0),
363 TEST (
"cbacbahjig",
"cba", 5, 3, 5, 0),
364 TEST (
"cbacbahjig",
"cba", 2, 1, 0, 0),
365 TEST (
"cbacbahjcg",
"cba", 7, 1, 3, 0),
367 TEST (
"e\0cb\0\0g",
"b\0\0g", 0, 4,
NPOS, 0),
368 TEST (
"e\0cb\0\0g",
"b\0\0g", 7, 4, 6, 0),
369 TEST (
"e\0cb\0\0b",
"b\0\0g", 4, 1, 3, 0),
370 TEST (
"\0b\0\0gb\0",
"b\0\0g", 7, 2, 6, 0),
371 TEST (
"\0b\0\0gb\0",
"b\0\0g", 2, 2, 2, 0),
372 TEST (
"\0b\0\0b\0g",
"b\0g\0", 7, 3, 6, 0),
373 TEST (
"e\0cb\0\0g",
"ecb", 7, 2, 2, 0),
374 TEST (
"\0cb\0\0ge",
"\0\0ge", 6, 4, 6, 0),
375 TEST (
"\0cb\0\0ge",
"\0\0ge", 2, 0,
NPOS, 0),
376 TEST (
"\0cb\0\0ge",
"cb\0", 1, 3, 1, 0),
377 TEST (
"e\0cbg\0\0",
"bg", 1, 2,
NPOS, 0),
378 TEST (
"a\0b",
"e\0gbg\0\0", 2, 1,
NPOS, 0),
379 TEST (
"a\0b",
"eb\0gg\0\0", 1, 2,
NPOS, 0),
380 TEST (
"a\0b",
"e\0gg\0\0a", 3, 6, 1, 0),
381 TEST (
"a\0b",
"e\0gg\0\0a", 0, 7, 0, 0),
382 TEST (
"a\0b",
"eb\0gg\0\0", 1, 3, 1, 0),
384 TEST (
"e\0a\0",
"e\0a\0\0", 2, 4, 2, 0),
385 TEST (
"e\0a\0",
"e\0a\0\0", 3, 5, 3, 0),
386 TEST (
"ee\0a\0",
"b\0c\0\0", 3, 4, 2, 0),
387 TEST (
"e\0a\0b",
"fdbcb\0a", 3, 5,
NPOS, 0),
389 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 9, 10, 9, 0),
390 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 8, 10, 8, 0),
391 TEST (
"aaaaabaaaa",
"cccccccccc", 9, 10,
NPOS, 0),
392 TEST (
"aaaaabaaaa",
"cccbcccccc", 8, 4, 5, 0),
393 TEST (
"aaaabaaaaa",
"cccca", 9, 5, 9, 0),
394 TEST (
"aabaabaaaa",
"cbccccccca", 7, 5, 5, 0),
395 TEST (
"bbb",
"aaaaaaaaba", 1, 2,
NPOS, 0),
396 TEST (
"bbb",
"aaaaaaaaaa", 0, 9,
NPOS, 0),
397 TEST (
"bab",
"aaaaaaaaba", 0, 0,
NPOS, 0),
398 TEST (
"bab",
"ccccccccba", 1, 10, 1, 0),
400 TEST (
"x@4096",
"", 4096, 0,
NPOS, 0),
401 TEST (
"x@4096",
"a", 4096, 1,
NPOS, 0),
402 TEST (
"x@4096",
"x", 4096, 1, 4095, 0),
403 TEST (
"x@4096",
"xxx", 4088, 3, 4088, 0),
404 TEST (
"x@4096",
"axa", 4088, 3, 4088, 0),
405 TEST (
"abc",
"x@4096", 2, 10,
NPOS, 0),
406 TEST (
"xxxxxxxxxx",
"x@4096", 0,4096, 0, 0),
407 TEST (
"xxxxxxxxxx",
"x@4096", 2, 4, 2, 0),
408 TEST (
"xxax@2048",
"y@4096a", 2050,4097, 2, 0),
410 TEST (
"x@4096",
"xxx", 4093, 3, 4093, 0),
411 TEST (
"x@4096",
"xxx", 4094, 3, 4094, 0),
412 TEST (
"x@4096",
"xxx", 4094, 2, 4094, 0),
414 TEST (
"abcdefghij", 0, 0, 9, 0, 0),
415 TEST (
"abcdefghij", 0, 8, 9, 8, 0),
416 TEST (
"\0cb\0\0ge", 0, 5, 7, 5, 0),
417 TEST (
"\0cb\0ge\0", 0, 6, 1, 6, 0),
418 TEST (
"\0c\0e\0cg", 0, 6, 2, 5, 0),
419 TEST (
"x@4096", 0, 0, 4096, 0, 0),
420 TEST (
"x@4096", 0, 1, 4096, 1, 0),
421 TEST (
"x@4096", 0, 5, 4091, 5, 0),
422 TEST (
"x@4096", 0, 4091, 1, 4091, 0),
425 TEST (
"abcdefghij",
"abc", 10, 3, 2, 0),
426 TEST (
"abcdefghij",
"cba", 10, 1, 2, 0),
429 TEST (
"abcdefghij",
"cbaj", 9, -1, 9, 0),
430 TEST (
"x@4096",
"xxx", 4095, -1, 4095, 0),
431 TEST (
"abcdefghij",
"jx@4096", 9, -1, 9, 0),
433 TEST (
"last test",
"test", 9, 4, 8, 0)
441cstr_size_test_cases [] = {
444#define TEST(str, arg, off, res) \
445 { __LINE__, off, -1, -1, -1, -1, \
446 str, sizeof str - 1, arg, \
447 sizeof arg - 1, 0, res, 0 \
457 TEST (
"ab",
"a", 0, 0),
465 TEST (
"\0",
"\0", 0, 0),
466 TEST (
"\0",
"\0", 1, 0),
470 TEST (
"abcdefghij",
"a", 0, 0),
471 TEST (
"abcdefghij",
"a", 2, 0),
473 TEST (
"abcdefghij",
"f", 7, 5),
474 TEST (
"abcdefghij",
"j", 9, 9),
476 TEST (
"edfcbbhjig",
"cba", 9, 5),
477 TEST (
"edfcbahjag",
"cba", 7, 5),
478 TEST (
"edfcbahjig",
"cba", 4, 4),
479 TEST (
"edfcbahcba",
"cba", 1,
NPOS),
480 TEST (
"edfcbahcba",
"cba", 9, 9),
481 TEST (
"edfcbahcba",
"cba", 3, 3),
482 TEST (
"cbacbahjig",
"cba", 4, 4),
484 TEST (
"e\0cb\0\0g",
"b\0\0g", 5, 5),
485 TEST (
"e\0cb\0\0g",
"b\0\0g", 2, 1),
486 TEST (
"e\0cb\0\0g",
"ecb", 7, 3),
487 TEST (
"\0cb\0\0ge",
"\0\0ge", 6, 6),
488 TEST (
"\0cb\0\0ge",
"cb\0", 0, 0),
489 TEST (
"\0cb\0\0ge",
"cb\0", 1, 1),
490 TEST (
"\0cb\0\0ge",
"cb\0", 2, 2),
492 TEST (
"e\0cbg\0\0",
"bg", 5, 4),
493 TEST (
"a\0b",
"e\0gbg\0\0", 2, 2),
494 TEST (
"a\0b",
"eb\0gg\0\0", 2, 2),
495 TEST (
"a\0b",
"e\0gg\0\0a", 3, 1),
498 TEST (
"bcaedfajih",
"a", 8, 6),
499 TEST (
"bcedfaajih",
"a", 6, 6),
500 TEST (
"bcaaedfaji",
"a", 8, 7),
502 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 9, 9),
503 TEST (
"aaaaaaaaaa",
"aaaaaaaaaa", 4, 4),
504 TEST (
"aaaaabaaaa",
"cccccccccb", 8, 5),
505 TEST (
"aabaabaaaa",
"cccccccccb", 9, 5),
506 TEST (
"aabaabaaaa",
"cccccccccb", 3, 2),
507 TEST (
"bbb",
"aaaaaaaaba", 2, 2),
508 TEST (
"bab",
"aaaaaaaaba", 0, 0),
509 TEST (
"bbb",
"aaaaaaaaaa", 3,
NPOS),
513 TEST (
"x@4096",
"x", 4096, 4095),
514 TEST (
"x@4096",
"xxx", 4095, 4095),
515 TEST (
"x@4096",
"xxx", 0, 0),
516 TEST (
"x@4096",
"xxx", 4087, 4087),
517 TEST (
"x@4096",
"aax", 4087, 4087),
519 TEST (
"xxxxxxxxxx",
"x@4096", 6, 6),
520 TEST (
"xxax@2048",
"y@4096a", 2050, 2),
522 TEST (
"x@4096",
"xxx", 3, 3),
523 TEST (
"x@4096",
"xxx", 2, 2),
525 TEST (
"abcdefghij", 0, 0, 0),
526 TEST (
"abcdefghij", 0, 9, 9),
527 TEST (
"\0cb\0\0ge", 0, 5, 5),
528 TEST (
"x@4096", 0, 0, 0),
529 TEST (
"x@4096", 0, 1, 1),
532 TEST (
"abcdefghij",
"abc", 10, 2),
533 TEST (
"abcdefghij",
"cba", 10, 2),
535 TEST (
"last test",
"test", 9, 8)
546#define TEST(str, val, res) \
547 { __LINE__, -1, -1, -1, -1, \
548 val, str, sizeof str - 1, \
563 TEST (
"\0",
'\0', 0),
564 TEST (
"\0\0",
'\0', 1),
567 TEST (
"e\0cb\0\0g",
'\0', 5),
568 TEST (
"e\0cb\0\0g",
'b', 3),
570 TEST (
"\0cbge\0\0",
'\0', 6),
571 TEST (
"\0cbge\0\0",
'b', 2),
574 TEST (
"x@4096",
'x', 4095),
577 TEST (
"xxax@2048",
'a', 2),
579 TEST (
"last test",
't', 8)
587val_size_test_cases [] = {
590#define TEST(str, val, off, res) \
591 { __LINE__, off, -1, -1, -1, \
592 val, str, sizeof str - 1, \
603 TEST (
"ab",
'a', 0, 0),
608 TEST (
"\0",
'\0', 1, 0),
610 TEST (
"\0\0",
'\0', 2, 1),
612 TEST (
"\0\0",
'\0', 3, 1),
614 TEST (
"e\0cb\0\0g",
'\0', 1, 1),
615 TEST (
"e\0cb\0\0g",
'\0', 5, 5),
618 TEST (
"e\0cb\0\0g",
'b', 4, 3),
620 TEST (
"\0cbge\0\0",
'\0', 0, 0),
621 TEST (
"\0cbge\0\0",
'\0', 5, 5),
622 TEST (
"\0cbge\0\0",
'\0', 9, 6),
623 TEST (
"\0cbge\0\0",
'b', 5, 2),
624 TEST (
"\0bgeb\0\0",
'b', 5, 4),
627 TEST (
"x@4096",
'x', 0, 0),
628 TEST (
"x@4096",
'x', 5, 5),
629 TEST (
"x@4096",
'x', 4096, 4095),
632 TEST (
"x@4096",
'x', 4095, 4095),
633 TEST (
"x@4096",
'x', 4106, 4095),
634 TEST (
"xxax@2048",
'a', 2050, 2),
636 TEST (
"last test",
't', 9, 8)
641template <
class charT,
class Traits,
class Allocator>
646 typedef std::basic_string <charT, Traits, Allocator>
String;
648 static const std::size_t BUFSIZE = 256;
650 static charT wstr_buf [BUFSIZE];
651 static charT warg_buf [BUFSIZE];
653 std::size_t str_len =
sizeof wstr_buf /
sizeof *wstr_buf;
654 std::size_t arg_len =
sizeof warg_buf /
sizeof *warg_buf;
660 const String s_str (wstr, str_len);
661 const String s_arg (warg, arg_len);
663 if (wstr != wstr_buf)
666 if (warg != warg_buf)
677 const charT*
const arg_ptr = tcase.
arg ? s_arg.c_str () : s_str.c_str ();
678 const String& arg_str = tcase.
arg ? s_arg : s_str;
681 std::size_t
size = tcase.
size >= 0 ? tcase.
size : s_arg.max_size () + 1;
683#ifndef _RWSTD_NO_EXCEPTIONS
686 const char* expected = 0;
688 expected = exceptions [2];
703 switch (
func.which_) {
706 res = s_str.find_last_of (arg_ptr);
710 res = s_str.find_last_of (arg_str);
715 res = s_str.find_last_of (arg_ptr, tcase.
off);
720 res = s_str.find_last_of (arg_ptr, tcase.
off,
size);
725 res = s_str.find_last_of (arg_str, tcase.
off);
730 res = s_str.find_last_of (arg_val);
735 res = s_str.find_last_of (arg_val, tcase.
off);
740 RW_ASSERT (
"test logic error: unknown find_last_of overload");
744 std::size_t exp_res =
749 "line %d. %{$FUNCALL} == %{?}%zu%{;}%{?}npos%{;}, "
750 "got %{?}%zu%{;}%{?}npos%{;}",
752 String::npos !=
res,
res, String::npos ==
res);
755#ifndef _RWSTD_NO_EXCEPTIONS
757 catch (
const std::length_error &ex) {
760 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
761 "unexpectedly%{;} caught std::%s(%#s)",
762 __LINE__, 0 != expected, expected,
caught, ex.what ());
767 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
768 "unexpectedly%{;} caught std::%s(%#s)",
769 __LINE__, 0 != expected, expected,
caught, ex.what ());
774 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
775 "unexpectedly%{;} caught %s",
776 __LINE__, 0 != expected, expected,
caught);
787 else if (-1 != tcase.
bthrow) {
789 "line %d. %{$FUNCALL} %{?}expected %s, caught %s"
790 "%{:}unexpectedly caught %s%{;}",
799int main (
int argc,
char** argv)
806 FindLastOf (sig), sig ## _test_cases, \
807 sizeof sig ## _test_cases / sizeof *sig ## _test_cases \
813 TEST (cptr_size_size),
819 const std::size_t test_count =
sizeof tests /
sizeof *tests;
822 "lib.string.find.last.of",
void test_find_last_of(charT, Traits *, Allocator *, const StringFunc &func, const StringTestCase &tcase)
#define TEST(str, arg, res)
std::char_traits< S > Traits
UserChar make_char(char c, UserChar *)
_TEST_EXPORT char * rw_expand(char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, _RWSTD_SIZE_T *=0)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
StringState rw_get_string_state(const String &str)
#define DEFINE_STRING_TEST_DISPATCH(fname)
_TEST_EXPORT int rw_run_string_test(int, char **, const char *, const char *, StringTestFunc *, const StringTest *, _RWSTD_SIZE_T)
int assert_equal(const StringState &, int, int, const char *) const