41#define Append(sig) StringIds::append_ ## sig
42#define PushBack(sig) StringIds::push_back_ ## sig
44static const char*
const exceptions[] = {
45 "unknown exception",
"out_of_range",
"length_error",
46 "bad_alloc",
"exception"
57#define TEST(str, arg, res, bthrow) { \
58 __LINE__, -1, -1, -1, -1, -1, \
59 str, sizeof str - 1, \
60 arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
74 TEST (
"ab",
"c",
"abc", 0),
77 TEST (
"",
"<U0>",
"", 0),
78 TEST (
"",
"abc",
"abc", 0),
80 TEST (
"<U0>",
"",
"<U0>", 0),
81 TEST (
"<U0>",
"a",
"<U0>a", 0),
82 TEST (
"<U0>",
"<U0>@2",
"<U0>", 0),
84 TEST (
"ab",
"cd",
"abcd", 0),
85 TEST (
"bcd",
"a",
"bcda", 0),
86 TEST (
"cde",
"ab",
"cdeab", 0),
87 TEST (
"abc",
"",
"abc", 0),
88 TEST (
"ab",
"c<U0>e",
"abc", 0),
90 TEST (
"<U0>@2ab",
"cdefghij",
"<U0>@2abcdefghij", 0),
91 TEST (
"a<U0>@2b",
"cdefghij",
"a<U0>@2bcdefghij", 0),
92 TEST (
"ab<U0>@2",
"cdefghij",
"ab<U0>@2cdefghij", 0),
93 TEST (
"a<U0>b<U0>@2c",
"e<U0>",
"a<U0>b<U0>@2ce", 0),
94 TEST (
"<U0>ab<U0>@2c",
"e<U0>",
"<U0>ab<U0>@2ce", 0),
95 TEST (
"abcdefghij",
"abcdefghij",
"abcdefghijabcdefghij", 0),
97 TEST (
"",
"x@4096",
"x@4096", 0),
98 TEST (
"x@4096",
"",
"x@4096", 0),
99 TEST (
"x@4096",
"x@4096",
"x@8192", 0),
101 TEST (
"x@10",
"x@118",
"x@128", 0),
102 TEST (
"x@128",
"x@79",
"x@207", 0),
103 TEST (
"x@207",
"x@127",
"x@334", 0),
104 TEST (
"x@334",
"x@206",
"x@540", 0),
105 TEST (
"x@540",
"x@333",
"x@873", 0),
106 TEST (
"x@539",
"x@873",
"x@1412", 0),
107 TEST (
"x@872",
"x@1412",
"x@2284", 0),
108 TEST (
"x@1411",
"x@2284",
"x@3695", 0),
109 TEST (
"x@1412",
"x@2284",
"x@3696", 0),
112 TEST (
"abc", 0,
"abcabc", 0),
113 TEST (
"a<U0>@2bc", 0,
"a<U0>@2bca", 0),
114 TEST (
"<U0>@2abc", 0,
"<U0>@2abc", 0),
115 TEST (
"abc<U0>@2", 0,
"abc<U0>@2abc", 0),
117 TEST (
"last",
"test",
"lasttest", 0)
125cstr_test_cases [] = {
128#define TEST(s, arg, res, bthrow) { \
129 __LINE__, -1, -1, -1, -1, -1, \
131 arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
145 TEST (
"ab",
"c",
"abc", 0),
147 TEST (
"",
"",
"", 0),
148 TEST (
"",
"<U0>",
"<U0>", 0),
149 TEST (
"",
"abc",
"abc", 0),
151 TEST (
"<U0>",
"",
"<U0>", 0),
152 TEST (
"<U0>",
"a",
"<U0>a", 0),
153 TEST (
"<U0>",
"<U0>@2",
"<U0>@3", 0),
155 TEST (
"ab",
"cd",
"abcd", 0),
156 TEST (
"bcd",
"a",
"bcda", 0),
157 TEST (
"cde",
"ab",
"cdeab", 0),
158 TEST (
"abc",
"",
"abc", 0),
159 TEST (
"ab",
"c<U0>e",
"abc<U0>e", 0),
161 TEST (
"<U0>@2ab",
"cdefghij",
"<U0>@2abcdefghij", 0),
162 TEST (
"a<U0>@2b",
"cdefghij",
"a<U0>@2bcdefghij", 0),
163 TEST (
"ab<U0>@2",
"cdefghij",
"ab<U0>@2cdefghij", 0),
164 TEST (
"a<U0>b<U0>@2c",
"e<U0>",
"a<U0>b<U0>@2ce<U0>", 0),
165 TEST (
"<U0>ab<U0>@2c",
"e<U0>",
"<U0>ab<U0>@2ce<U0>", 0),
166 TEST (
"ab<U0>@2c<U0>",
"<U0>e",
"ab<U0>@2c<U0>@2e", 0),
167 TEST (
"abcdefghij",
"abcdefghij",
"abcdefghijabcdefghij", 0),
169 TEST (
"",
"x@4096",
"x@4096", 0),
170 TEST (
"x@4096",
"",
"x@4096", 0),
171 TEST (
"x@4096",
"x@4096",
"x@8192", 0),
173 TEST (
"x@10",
"x@118",
"x@128", 0),
174 TEST (
"x@128",
"x@79",
"x@207", 0),
175 TEST (
"x@207",
"x@127",
"x@334", 0),
176 TEST (
"x@334",
"x@206",
"x@540", 0),
177 TEST (
"x@540",
"x@333",
"x@873", 0),
178 TEST (
"x@539",
"x@873",
"x@1412", 0),
179 TEST (
"x@872",
"x@1412",
"x@2284", 0),
180 TEST (
"x@1411",
"x@2284",
"x@3695", 0),
181 TEST (
"x@1412",
"x@2284",
"x@3696", 0),
184 TEST (
"abc", 0,
"abcabc", 0),
185 TEST (
"a<U0>@2bc", 0,
"a<U0>@2bca<U0>@2bc", 0),
186 TEST (
"<U0>@2abc", 0,
"<U0>@2abc<U0>@2abc", 0),
187 TEST (
"abc<U0>@2", 0,
"abc<U0>@2abc<U0>@2", 0),
189 TEST (
"last",
"test",
"lasttest", 0)
197cptr_size_test_cases [] = {
200#define TEST(str, arg, size, res, bthrow) { \
201 __LINE__, -1, size, -1, -1, -1, \
202 str, sizeof str - 1, \
203 arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
218 TEST (
"ab",
"c", 1,
"abc", 0),
220 TEST (
"",
"", 0,
"", 0),
221 TEST (
"",
"abc", 1,
"a", 0),
222 TEST (
"",
"<U0>", 1,
"<U0>", 0),
224 TEST (
"<U0>",
"", 0,
"<U0>", 0),
225 TEST (
"<U0>",
"a", 0,
"<U0>", 0),
226 TEST (
"<U0>",
"a", 1,
"<U0>a", 0),
227 TEST (
"<U0>",
"<U0>@2", 1,
"<U0>@2", 0),
228 TEST (
"<U0>",
"<U0>@2", 2,
"<U0>@3", 0),
230 TEST (
"cde",
"ab", 2,
"cdeab", 0),
231 TEST (
"cde",
"ab", 1,
"cdea", 0),
233 TEST (
"<U0>e<U0>",
"a<U0>b<U0>@2c", 0,
"<U0>e<U0>", 0),
234 TEST (
"<U0>e<U0>",
"<U0>ab<U0>@2c", 3,
"<U0>e<U0>@2ab", 0),
236 TEST (
"a<U0>b<U0>@2c",
"<U0>e<U0>", 3,
"a<U0>b<U0>@2c<U0>e<U0>", 0),
237 TEST (
"a<U0>b<U0>@2c",
"<U0>@2e<U0>", 2,
"a<U0>b<U0>@2c<U0>@2", 0),
238 TEST (
"<U0>ab<U0>@2c",
"<U0>e<U0>", 1,
"<U0>ab<U0>@2c<U0>", 0),
239 TEST (
"a<U0>bc<U0>@2",
"<U0>e", 2,
"a<U0>bc<U0>@3e", 0),
241 TEST (
"x@10",
"x@118", 118,
"x@128", 0),
242 TEST (
"x@128",
"x@79", 79,
"x@207", 0),
243 TEST (
"x@207",
"x@127", 127,
"x@334", 0),
244 TEST (
"x@207",
"x@207", 127,
"x@334", 0),
245 TEST (
"x@334",
"x@206", 206,
"x@540", 0),
246 TEST (
"x@540",
"x@333", 333,
"x@873", 0),
247 TEST (
"x@539",
"x@873", 873,
"x@1412", 0),
248 TEST (
"x@873",
"x@540", 539,
"x@1412", 0),
249 TEST (
"x@872",
"x@1412", 1412,
"x@2284", 0),
250 TEST (
"x@1411",
"x@2284", 2284,
"x@3695", 0),
251 TEST (
"x@1411",
"x@3695", 2284,
"x@3695", 0),
252 TEST (
"x@1412",
"x@2284", 2284,
"x@3696", 0),
254 TEST (
"", 0, 0,
"", 0),
255 TEST (
"abc", 0, 0,
"abc", 0),
256 TEST (
"abc", 0, 1,
"abca", 0),
257 TEST (
"abc", 0, 2,
"abcab", 0),
258 TEST (
"a<U0>bc", 0, 2,
"a<U0>bca<U0>", 0),
259 TEST (
"<U0>abc<U0>@2", 0, 1,
"<U0>abc<U0>@3", 0),
260 TEST (
"a<U0>bc<U0>@2", 0, 3,
"a<U0>bc<U0>@2a<U0>b", 0),
261 TEST (
"a@4096", 0, 1111,
"a@5207", 0),
262 TEST (
"b@4096", 0, 2222,
"b@6318", 0),
264 TEST (
"",
"x@4096", 4096,
"x@4096", 0),
265 TEST (
"x@4096",
"", 0,
"x@4096", 0),
267 TEST (
"last",
"test", 4,
"lasttest", 0)
279#define cstr_size_size_test_cases range_test_cases
282#define TEST(str, arg, off, size, res, bthrow) { \
283 __LINE__, -1, -1, off, size, -1, \
284 str, sizeof str - 1, \
285 arg, sizeof arg - 1, res, sizeof res - 1, bthrow \
301 TEST (
"ab",
"c", 0, 1,
"abc", 0),
303 TEST (
"",
"", 0, 0,
"", 0),
304 TEST (
"",
"abc", 1, 1,
"b", 0),
305 TEST (
"",
"<U0>", 0, 1,
"<U0>", 0),
307 TEST (
"<U0>",
"", 0, 0,
"<U0>", 0),
309 TEST (
"abc",
"", 0, 0,
"abc", 0),
311 TEST (
"<U0>",
"a", 0, 1,
"<U0>a", 0),
312 TEST (
"<U0>",
"<U0>@2", 1, 1,
"<U0>@2", 0),
313 TEST (
"<U0>",
"<U0>@2", 0, 2,
"<U0>@3", 0),
314 TEST (
"<U0>",
"<U0>@2", 1, 5,
"<U0>@2", 0),
316 TEST (
"cde",
"ab", 0, 2,
"cdeab", 0),
317 TEST (
"cde",
"ab", 0, 1,
"cdea", 0),
318 TEST (
"cde",
"ab", 1, 5,
"cdeb", 0),
320 TEST (
"ab",
"c<U0>e", 0, 3,
"abc<U0>e", 0),
321 TEST (
"ab",
"c<U0>e", 1, 2,
"ab<U0>e", 0),
322 TEST (
"ab",
"c<U0>e", 0, 2,
"abc<U0>", 0),
324 TEST (
"<U0>e<U0>",
"<U0>ab<U0>@2c", 0, 9,
"<U0>e<U0>@2ab<U0>@2c", 0),
325 TEST (
"<U0>e<U0>",
"<U0>ab<U0>@2c", 0, 3,
"<U0>e<U0>@2ab", 0),
326 TEST (
"a<U0>b<U0>@2c",
"<U0>e<U0>", 0, 3,
"a<U0>b<U0>@2c<U0>e<U0>", 0),
327 TEST (
"a<U0>b<U0>@2c",
"<U0>@2e<U0>", 0, 2,
"a<U0>b<U0>@2c<U0>@2", 0),
328 TEST (
"<U0>ab<U0>@2c",
"<U0>e<U0>", 2, 1,
"<U0>ab<U0>@2c<U0>", 0),
329 TEST (
"a<U0>bc<U0>@2",
"<U0>e", 0, 2,
"a<U0>bc<U0>@3e", 0),
331 TEST (
"", 0, 0, 0,
"", 0),
332 TEST (
"abc", 0, 1, 0,
"abc", 0),
333 TEST (
"abc", 0, 1, 1,
"abcb", 0),
334 TEST (
"abc", 0, 0, 2,
"abcab", 0),
335 TEST (
"a<U0>bc<U0>@2", 0, 4, 2,
"a<U0>bc<U0>@3<U0>", 0),
336 TEST (
"a<U0>bc<U0>@2", 0, 1, 3,
"a<U0>bc<U0>@3bc", 0),
337 TEST (
"a<U0>bc<U0>@2", 0, 3, 9,
"a<U0>bc<U0>@2c<U0>@2", 0),
338 TEST (
"abcdef", 0, 1, 2,
"abcdefbc", 0),
340 TEST (
"a@1000",
"b@1000", 0, 999,
"a@1000b@999", 0),
341 TEST (
"a@1000",
"b@1001", 0, 1000,
"a@1000b@1000", 0),
342 TEST (
"a@1000",
"b@1002", 0, 102,
"a@1000b@102", 0),
343 TEST (
"",
"x@4096", 0, 4096,
"x@4096", 0),
344 TEST (
"x@4096",
"", 0, 0,
"x@4096", 0),
345 TEST (
"x@4096",
"a@4096", 100, 10,
"x@4096a@10", 0),
347 TEST (
"x@10",
"x@118", 0, 118,
"x@128", 0),
348 TEST (
"x@128",
"x@129", 50, 79,
"x@207", 0),
349 TEST (
"x@207",
"x@127", 0, 127,
"x@334", 0),
350 TEST (
"x@207",
"x@207", 10, 127,
"x@334", 0),
351 TEST (
"x@334",
"x@208", 2, 206,
"x@540", 0),
352 TEST (
"x@540",
"x@336", 3, 333,
"x@873", 0),
353 TEST (
"x@539",
"x@873", 0, 873,
"x@1412", 0),
354 TEST (
"x@873",
"x@540", 1, 539,
"x@1412", 0),
355 TEST (
"x@872",
"x@1412", 0, 1412,
"x@2284", 0),
356 TEST (
"x@1411",
"x@2288", 4, 2284,
"x@3695", 0),
357 TEST (
"x@1411",
"x@3695", 128, 2284,
"x@3695", 0),
358 TEST (
"x@1412",
"x@2284", 0, 2284,
"x@3696", 0),
360 TEST (
"",
"<U0>", 2, 0,
"", 1),
361 TEST (
"",
"a", 2, 0,
"", 1),
362 TEST (
"",
"x@4096", 4106, 0,
"", 1),
364 TEST (
"last",
"test", 0, 4,
"lasttest", 0)
372size_val_test_cases [] = {
375#define TEST(str, size, val, res, bthrow) { \
376 __LINE__, -1, size, -1, -1, val, \
377 str, sizeof str - 1, \
378 0, 0, res, sizeof res - 1, bthrow \
393 TEST (
"ab", 1,
'c',
"abc", 0),
395 TEST (
"", 0,
' ',
"", 0),
396 TEST (
"", 1,
'b',
"b", 0),
397 TEST (
"", 3,
'b',
"bbb", 0),
399 TEST (
"<U0>", 0,
' ',
"<U0>", 0),
400 TEST (
"", 2,
'\0',
"<U0>@2", 0),
402 TEST (
"<U0>", 1,
'a',
"<U0>a", 0),
403 TEST (
"<U0>", 1,
'\0',
"<U0>@2", 0),
404 TEST (
"<U0>", 2,
'\0',
"<U0>@3", 0),
405 TEST (
"<U0>", 0,
'\0',
"<U0>", 0),
407 TEST (
"cde", 1,
'a',
"cdea", 0),
408 TEST (
"cde", 2,
'a',
"cdeaa", 0),
409 TEST (
"cde", 3,
'a',
"cdeaaa", 0),
411 TEST (
"ab", 2,
'\0',
"ab<U0>@2", 0),
412 TEST (
"ab", 1,
'\0',
"ab<U0>", 0),
413 TEST (
"ab", 2,
'\0',
"ab<U0>@2", 0),
415 TEST (
"a<U0>b<U0>@2c", 2,
'\0',
"a<U0>b<U0>@2c<U0>@2", 0),
416 TEST (
"a<U0>b<U0>@2c", 1,
'\0',
"a<U0>b<U0>@2c<U0>", 0),
417 TEST (
"<U0>ab<U0>@2c", 3,
'\0',
"<U0>ab<U0>@2c<U0>@3", 0),
418 TEST (
"a<U0>bc<U0>@2", 2,
'a',
"a<U0>bc<U0>@2aa", 0),
420 TEST (
"", 4096,
'x',
"x@4096", 0),
421 TEST (
"x@4096", 0,
'x',
"x@4096", 0),
423 TEST (
"x@127", 1,
'x',
"x@128", 0),
424 TEST (
"x@200", 7,
'x',
"x@207", 0),
425 TEST (
"x@331", 3,
'x',
"x@334", 0),
426 TEST (
"x@539", 1,
'x',
"x@540", 0),
427 TEST (
"x@539", 873,
'x',
"x@1412", 0),
428 TEST (
"x@873", 1411,
'x',
"x@2284", 0),
429 TEST (
"x@3694", 1,
'x',
"x@3695", 0),
430 TEST (
"x@540", 1,
'x',
"x@541", 0),
432 TEST (
"last", 4,
't',
"lasttttt", 0)
440push_back_val_test_cases [] = {
443#define TEST(str, val, res, bthrow) { \
444 __LINE__, -1, -1, -1, -1, val, \
445 str, sizeof str - 1, \
446 0, 0, res, sizeof res - 1, bthrow \
458 TEST (
"ab",
'c',
"abc", 0),
460 TEST (
"",
'a',
"a", 0),
461 TEST (
"",
'\0',
"<U0>", 0),
462 TEST (
"<U0>",
'a',
"<U0>a", 0),
463 TEST (
"<U0>",
'\0',
"<U0>@2", 0),
465 TEST (
"a<U0>b<U0>@2c",
'\0',
"a<U0>b<U0>@2c<U0>", 0),
466 TEST (
"a<U0>bc<U0>@2",
'a',
"a<U0>bc<U0>@2a", 0),
467 TEST (
"<U0>abc<U0>@2",
'a',
"<U0>abc<U0>@2a", 0),
469 TEST (
"x@4095",
'x',
"x@4096", 0),
471 TEST (
"x@127",
'x',
"x@128", 0),
472 TEST (
"x@206",
'x',
"x@207", 0),
473 TEST (
"x@333",
'x',
"x@334", 0),
474 TEST (
"x@539",
'x',
"x@540", 0),
475 TEST (
"x@1411",
'x',
"x@1412", 0),
476 TEST (
"x@2283",
'x',
"x@2284", 0),
477 TEST (
"x@3694",
'x',
"x@3695", 0),
478 TEST (
"x@540",
'x',
"x@541", 0),
480 TEST (
"last",
't',
"lastt", 0)
487template <
class String,
class Iterator>
514 return str.append (first,
last);
522template <
class String,
class Iterator>
539 const std::size_t srclen_ = tcase.
arg ? tdata.
arglen_ :
str.size ();
541 const std::size_t
off =
543 const std::size_t ext = tdata.
ext2_;
545 if (0 == tcase.
arg) {
552 return str.append (first,
last);
560 return str.append (first,
last);
566template <
class charT,
class Traits,
class Allocator>
568 std::basic_string <charT, Traits, Allocator> > &rng,
571 typedef std::basic_string <charT, Traits, Allocator>
String;
572 typedef typename String::size_type SizeT;
573 typedef typename String::iterator StringIter;
589 const charT*
const ptr_arg = tcase.
arg ?
arg.c_str () :
str.c_str ();
593 std::size_t total_length_calls = 0;
594 std::size_t n_length_calls = 0;
598 total_length_calls = rg_calls [TraitsFunc::length];
606 std::size_t throw_count;
607 for (throw_count = 0; ; ++throw_count) {
610 const char* expected = 0;
613#ifndef _RWSTD_NO_EXCEPTIONS
616 expected = exceptions [1];
617 else if (2 == tcase.
bthrow)
618 expected = exceptions [2];
619 else if (0 == tcase.
bthrow) {
623 expected = exceptions [3];
640 const String* ret_ptr = 0;
647 switch (
func.which_) {
650 ret_ptr = &
str.append (ptr_arg);
652 n_length_calls = rg_calls [TraitsFunc::length];
656 ret_ptr = &
str.append (str_arg);
660 ret_ptr = &
str.append (ptr_arg, tcase.
size);
663 case Append (cstr_size_size):
664 ret_ptr = &
str.append (str_arg,
665 SizeT (tcase.
off2), SizeT (tcase.
size2));
669 ret_ptr = &
str.append (tcase.
size, val_arg);
673 ret_ptr = &rng (
str, tdata);
677 str.push_back (val_arg);
682 RW_ASSERT (!
"logic error: unknown append overload");
688 const std::ptrdiff_t ret_off = ret_ptr - &
str;
692 "line %d. %{$FUNCALL} returned invalid reference, "
693 "offset is %td", __LINE__, ret_off);
696 static const int cwidth =
sizeof (
charT);
700 "line %d. %{$FUNCALL} expected %{/*.*Gs}, "
701 "length %zu, got %{/*.*Gs}, length %zu",
704 int (
str.size ()),
str.c_str (),
str.size ());
710 const std::size_t match =
714 "line %d. %{$FUNCALL} expected %{/*.*Gs}, "
715 "got %{/*.*Gs}, difference at offset %zu",
717 cwidth, int (
str.size ()),
str.c_str (), match);
721 if (
Append (cptr) ==
func.which_ && rg_calls) {
722 rw_assert (n_length_calls - total_length_calls > 0,
723 0, tcase.
line,
"line %d. %{$FUNCALL} doesn't "
724 "use traits::length()", __LINE__);
728#ifndef _RWSTD_NO_EXCEPTIONS
730 catch (
const std::out_of_range &ex) {
733 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
734 "unexpectedly%{;} caught std::%s(%#s)",
735 __LINE__, 0 != expected, expected,
caught, ex.what ());
737 catch (
const std::length_error &ex) {
740 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
741 "unexpectedly%{;} caught std::%s(%#s)",
742 __LINE__, 0 != expected, expected,
caught, ex.what ());
747 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
748 "unexpectedly%{;} caught std::%s(%#s)",
749 __LINE__, 0 != expected, expected,
caught, ex.what ());
754 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
755 "unexpectedly%{;} caught std::%s(%#s)",
756 __LINE__, 0 != expected, expected,
caught, ex.what ());
761 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
762 "unexpectedly%{;} caught %s",
763 __LINE__, 0 != expected, expected,
caught);
771 std::size_t (-1), std::size_t (-1));
786 else if (0 < tcase.
bthrow) {
788 "line %d. %{$FUNCALL} %{?}expected %s, caught %s"
789 "%{:}unexpectedly caught %s%{;}",
796#ifndef _RWSTD_NO_REPLACEABLE_NEW_DELETE
800 const std::size_t expect_throws = str_state.
capacity_ <
str.capacity ();
804 const std::size_t expect_throws =
814 "line %d: %{$FUNCALL}: expected exactly 1 %s exception "
815 "while changing capacity from %zu to %zu, got %zu",
816 __LINE__, exceptions [3],
820 "line %d: %{$FUNCALL}: expected at least 1 %s exception "
821 "while changing capacity from %zu to %zu, got %zu",
822 __LINE__, exceptions [3],
832template <
class charT,
class Traits,
class Allocator>
836 typedef std::basic_string<charT, Traits, Allocator>
String;
845#define TEST(Iterator) do { \
846 typedef typename String::Iterator Iter; \
848 AppendRangeOverload<String, Iter> rng; \
849 test_append ((charT*)0, (Traits*)0, (Allocator*)0, rng, tdata); \
865#define TEST(Iterator) do { \
866 typedef Iterator<charT> Iter; \
868 AppendRange<String, Iter> rng; \
869 test_append ((charT*)0, (Traits*)0, (Allocator*)0, rng, tdata); \
878 rw_error (0, 0, __LINE__,
"bad iterator id");
892int main (
int argc,
char** argv)
899 Append (sig), sig ## _test_cases, \
900 sizeof sig ## _test_cases / sizeof *sig ## _test_cases \
906 TEST (cstr_size_size),
911 StringIds::push_back_val, push_back_val_test_cases,
912 sizeof push_back_val_test_cases /
sizeof *push_back_val_test_cases
916 const std::size_t test_count =
sizeof tests /
sizeof *tests;
921 test_append_func_array, tests, test_count);
void test_append(charT *, Traits *, Allocator *, const RangeBase< std::basic_string< charT, Traits, Allocator > > &rng, const StringTestCaseData< charT > &tdata)
#define TEST(str, arg, res, bthrow)
std::char_traits< S > Traits
const StringTestCase & tcase_
_TEST_EXPORT void rw_check_leaks(const SharedAlloc *=0, int=0, _RWSTD_SIZE_T=0, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX)
UserChar make_char(char c, UserChar *)
_RWSTD_SIZE_T * rw_get_call_counters(std::char_traits< charT > *, charT *)
_TEST_EXPORT _RWSTD_SIZE_T rw_match(const char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_error(int, const char *, int, const char *,...)
_TEST_EXPORT rwt_free_store * rwt_get_free_store(rwt_free_store *)
StringState rw_get_string_state(const String &str)
_TEST_EXPORT int rw_run_string_test(int, char **, const char *, const char *, StringTestFunc *, const StringTest *, _RWSTD_SIZE_T)
#define DEFINE_STRING_TEST_FUNCTIONS(fname)
String::value_type StringChar
String::iterator StringIter
virtual String & operator()(String &str, const StringTestCaseData< StringChar > &tdata) const
String::iterator StringIter
virtual String & operator()(String &str, const StringTestCaseData< StringChar > &tdata) const
String::value_type StringChar
static StringPtr begin(String &str, StringPtr *)
static SharedAlloc * instance(SharedAlloc *=0)
_RWSTD_SIZE_T throw_at_calls_[n_funs]
StringIds::OverloadId which_
StringIds::IteratorId iter_id_
int assert_equal(const StringState &, int, int, const char *) const
_RWSTD_SIZE_T * throw_at_calls_[2]
_RWSTD_SIZE_T new_calls_[2]