Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
21.string.op.plus.cpp
Go to the documentation of this file.
1
29#include <string> // for string
30#include <stdexcept> // for out_of_range, length_error
31
32#include <cstddef> // for size_t
33
34#include <rw_strings.h> // for StringMembers
35#include <rw_alg_test.h> // for InputIter
36#include <rw_driver.h> // for rw_test()
37#include <rw_allocator.h> // for UserAlloc
38#include <rw_char.h> // for rw_expand()
39#include <rw_new.h> // for bad_alloc, replacement operator new
40
41
43// for convenience and brevity
44#define OpPlus(which) StringIds::op_plus_ ## which
45
46static const char* const exceptions[] = {
47 "unknown exception", "out_of_range", "length_error",
48 "bad_alloc", "exception"
49};
50
51
53// exercises:
54// operator + (const value_type*, const basic_string&)
55static const StringTestCase
56cptr_cstr_test_cases [] = {
57
58#undef TEST
59#define TEST(str, src, res, bthrow) \
60 { __LINE__, -1, -1, -1, -1, -1, \
61 str, sizeof str - 1, src, sizeof src - 1, \
62 res, sizeof res - 1, bthrow \
63 }
64
65 // +----------------------------------------- first sequence
66 // | +------------------------ second sequence
67 // | | +------- expected result sequence
68 // | | | +- exception info
69 // | | | | 0 - no exception
70 // | | | |
71 // | | | +---------+
72 // V V V V
73 TEST ("ab", "c", "abc", 0),
74
75 TEST ("", "", "", 0),
76 TEST ("", "a", "a", 0),
77 TEST ("a", "", "a", 0),
78
79 TEST ("<U0>", "", "", 0),
80 TEST ("", "<U0>", "<U0>", 0),
81 TEST ("<U0>", "<U0>", "<U0>", 0),
82
83 TEST ("abcdefg", "jih", "abcdefgjih", 0),
84 TEST ("jih", "abcdefg", "jihabcdefg", 0),
85
86 TEST ("<U0>ab<U0>@2c", "e<U0>", "e<U0>", 0),
87 TEST ("e<U0>", "<U0>ab<U0>@2c", "e<U0>ab<U0>@2c", 0),
88 TEST ("ab<U0>@2c<U0>", "e<U0>", "abe<U0>", 0),
89 TEST ("e<U0>", "ab<U0>@2c<U0>", "eab<U0>@2c<U0>", 0),
90
91 TEST ("x@2048", "x@2048", "x@4096", 0),
92 TEST ("a@2048", "b@2048", "a@2048b@2048", 0),
93 TEST ("a@2048<U0>", "b@2048", "a@2048b@2048", 0),
94 TEST ("a@2048", "b@2048<U0>", "a@2048b@2048<U0>", 0),
95
96 TEST ("x@10", "x@118", "x@128", 0),
97 TEST ("x@128", "x@79", "x@207", 0),
98 TEST ("x@207", "x@127", "x@334", 0),
99 TEST ("x@334", "x@206", "x@540", 0),
100 TEST ("x@540", "x@333", "x@873", 0),
101 TEST ("x@539", "x@873", "x@1412", 0),
102 TEST ("x@872", "x@1412", "x@2284", 0),
103 TEST ("x@1411", "x@2284", "x@3695", 0),
104 TEST ("x@1412", "x@2284", "x@3696", 0),
105
106 TEST (0, "abc", "abcabc", 0),
107 TEST (0, "<U0>ab<U0>", "<U0>ab<U0>", 0),
108 TEST (0, "x@2048", "x@4096", 0),
109
110 TEST ("last", "test", "lasttest", 0)
111};
112
113
114
116// exercises:
117// operator + (const basic_string&, const basic_string&)
118static const StringTestCase
119cstr_cstr_test_cases [] = {
120
121#undef TEST
122#define TEST(str, src, res, bthrow) \
123 { __LINE__, -1, -1, -1, -1, -1, \
124 str, sizeof str - 1, src, sizeof src - 1, \
125 res, sizeof res - 1, bthrow \
126 }
127
128 // +----------------------------------------- first sequence
129 // | +------------------------ second sequence
130 // | | +---------- expected result sequence
131 // | | | +- exception info
132 // | | | | 0 - no exception
133 // | | | |
134 // | | | +-------------+
135 // V V V V
136 TEST ("ab", "c", "abc", 0),
137
138 TEST ("", "", "", 0),
139 TEST ("", "a", "a", 0),
140 TEST ("a", "", "a", 0),
141
142 TEST ("<U0>", "", "<U0>", 0),
143 TEST ("", "<U0>", "<U0>", 0),
144 TEST ("<U0>", "<U0>", "<U0>@2", 0),
145
146 TEST ("abcdefg", "jih", "abcdefgjih", 0),
147 TEST ("jih", "abcdefg", "jihabcdefg", 0),
148
149 TEST ("<U0>ab<U0>@2c", "e<U0>", "<U0>ab<U0>@2ce<U0>", 0),
150 TEST ("e<U0>", "<U0>ab<U0>@2c", "e<U0>@2ab<U0>@2c", 0),
151 TEST ("ab<U0>@2c<U0>", "e<U0>", "ab<U0>@2c<U0>e<U0>", 0),
152 TEST ("e<U0>", "ab<U0>@2c<U0>", "e<U0>ab<U0>@2c<U0>", 0),
153
154 TEST ("x@2048", "x@2048", "x@4096", 0),
155 TEST ("a@2048", "b@2048", "a@2048b@2048", 0),
156 TEST ("a@2048<U0>", "b@2048", "a@2048<U0>b@2048", 0),
157 TEST ("a@2048", "b@2048<U0>", "a@2048b@2048<U0>", 0),
158
159 TEST ("x@10", "x@118", "x@128", 0),
160 TEST ("x@128", "x@79", "x@207", 0),
161 TEST ("x@207", "x@127", "x@334", 0),
162 TEST ("x@334", "x@206", "x@540", 0),
163 TEST ("x@540", "x@333", "x@873", 0),
164 TEST ("x@539", "x@873", "x@1412", 0),
165 TEST ("x@872", "x@1412", "x@2284", 0),
166 TEST ("x@1411", "x@2284", "x@3695", 0),
167 TEST ("x@1412", "x@2284", "x@3696", 0),
168
169 TEST (0, "abc", "abcabc", 0),
170 TEST (0, "<U0>ab<U0>", "<U0>ab<U0>@2ab<U0>", 0),
171 TEST (0, "x@2048", "x@4096", 0),
172
173 TEST ("abc", 0, "abcabc", 0),
174 TEST ("<U0>ab<U0>", 0, "<U0>ab<U0>@2ab<U0>", 0),
175 TEST ("x@2048", 0, "x@4096", 0),
176
177 TEST ("last", "test", "lasttest", 0)
178};
179
180
182// exercises:
183// operator + (const basic_string&, const value_type*)
184static const StringTestCase
185cstr_cptr_test_cases [] = {
186
187#undef TEST
188#define TEST(str, src, res, bthrow) \
189 { __LINE__, -1, -1, -1, -1, -1, \
190 str, sizeof str - 1, src, sizeof src - 1, \
191 res, sizeof res - 1, bthrow \
192 }
193
194 // +----------------------------------------- first sequence
195 // | +------------------------ second sequence
196 // | | +---------- expected result sequence
197 // | | | +- exception info
198 // | | | | 0 - no exception
199 // | | | |
200 // | | | +----------+
201 // V V V V
202 TEST ("ab", "c", "abc", 0),
203
204 TEST ("", "", "", 0),
205 TEST ("", "a", "a", 0),
206 TEST ("a", "", "a", 0),
207
208 TEST ("<U0>", "", "<U0>", 0),
209 TEST ("", "<U0>", "", 0),
210 TEST ("<U0>", "<U0>", "<U0>", 0),
211
212 TEST ("abcdefg", "jih", "abcdefgjih", 0),
213 TEST ("jih", "abcdefg", "jihabcdefg", 0),
214
215 TEST ("<U0>ab<U0>@2c", "e<U0>", "<U0>ab<U0>@2ce", 0),
216 TEST ("e<U0>", "<U0>ab<U0>@2c", "e<U0>", 0),
217 TEST ("ab<U0>@2c<U0>", "e<U0>", "ab<U0>@2c<U0>e", 0),
218 TEST ("e<U0>", "ab<U0>@2c<U0>", "e<U0>ab", 0),
219
220 TEST ("x@2048", "x@2048", "x@4096", 0),
221 TEST ("a@2048", "b@2048", "a@2048b@2048", 0),
222 TEST ("a@2048<U0>", "b@2048", "a@2048<U0>b@2048", 0),
223 TEST ("a@2048", "b@2048<U0>", "a@2048b@2048", 0),
224
225 TEST ("x@10", "x@118", "x@128", 0),
226 TEST ("x@128", "x@79", "x@207", 0),
227 TEST ("x@207", "x@127", "x@334", 0),
228 TEST ("x@334", "x@206", "x@540", 0),
229 TEST ("x@540", "x@333", "x@873", 0),
230 TEST ("x@539", "x@873", "x@1412", 0),
231 TEST ("x@872", "x@1412", "x@2284", 0),
232 TEST ("x@1411", "x@2284", "x@3695", 0),
233 TEST ("x@1412", "x@2284", "x@3696", 0),
234
235 TEST ("abc", 0, "abcabc", 0),
236 TEST ("<U0>ab<U0>", 0, "<U0>ab<U0>", 0),
237 TEST ("x@2048", 0, "x@4096", 0),
238
239 TEST ("last", "test", "lasttest", 0)
240};
241
242
244// exercises:
245// operator + (const basic_string&, value_type)
246static const StringTestCase
247cstr_val_test_cases [] = {
248
249#undef TEST
250#define TEST(arg, val, res) \
251 { __LINE__, -1, -1, -1, -1, val, \
252 0, 0, arg, sizeof arg - 1, \
253 res, sizeof res - 1, 0 \
254 }
255
256 // +----------------------------------------- first sequence
257 // | +----------------------- character to be added
258 // | | +--------- expected result sequence
259 // | | |
260 // | | |
261 // V V V
262 TEST ("ab", 'c', "abc"),
263
264 TEST ("", 'a', "a"),
265 TEST ("", '\0', "<U0>"),
266
267 TEST ("<U0>", 'a', "<U0>a"),
268 TEST ("<U0>", '\0', "<U0>@2"),
269
270 TEST ("<U0>ab<U0>@2c", 'e', "<U0>ab<U0>@2ce"),
271 TEST ("<U0>ab<U0>@2c", '\0', "<U0>ab<U0>@2c<U0>"),
272 TEST ("ab<U0>@2c<U0>", 'e', "ab<U0>@2c<U0>e"),
273 TEST ("ab<U0>@2c<U0>", '\0', "ab<U0>@2c<U0>@2"),
274
275 TEST ("abcdefghj", 'i', "abcdefghji"),
276
277 TEST ("x@4095", 'x', "x@4096"),
278 TEST ("x@4095", '\0', "x@4095<U0>"),
279
280 TEST ("x@127", 'x', "x@128"),
281 TEST ("x@206", 'x', "x@207"),
282 TEST ("x@333", 'x', "x@334"),
283 TEST ("x@539", 'x', "x@540"),
284 TEST ("x@1411", 'x', "x@1412"),
285 TEST ("x@2283", 'x', "x@2284"),
286 TEST ("x@3694", 'x', "x@3695"),
287 TEST ("x@540", 'x', "x@541"),
288
289 TEST ("last", 't', "lastt")
290};
291
292
294// exercises:
295// operator + (value_type, const basic_string&)
296static const StringTestCase
297val_cstr_test_cases [] = {
298
299#undef TEST
300#define TEST(val, arg, res) \
301 { __LINE__, -1, -1, -1, -1, val, \
302 "", 0, arg, sizeof arg - 1, \
303 res, sizeof res - 1, 0 \
304 }
305
306 // +----------------------------------------- first sequence
307 // | +--------------------------- character to be added
308 // | | +--------- expected result sequence
309 // | | |
310 // | | |
311 // V V V
312 TEST ('c', "ab", "cab"),
313
314 TEST ('a', "", "a"),
315 TEST ('\0', "", "<U0>"),
316
317 TEST ('a', "<U0>", "a<U0>"),
318 TEST ('\0', "<U0>", "<U0>@2"),
319
320 TEST ('e', "<U0>ab<U0>@2c", "e<U0>ab<U0>@2c"),
321 TEST ('\0', "<U0>ab<U0>@2c", "<U0>@2ab<U0>@2c"),
322 TEST ('e', "ab<U0>@2c<U0>", "eab<U0>@2c<U0>"),
323 TEST ('\0', "ab<U0>@2c<U0>", "<U0>ab<U0>@2c<U0>"),
324
325 TEST ('i', "abcdefghj", "iabcdefghj"),
326
327 TEST ('x', "x@4095", "x@4096"),
328 TEST ('\0', "x@4095", "<U0>x@4095"),
329
330 TEST ('x', "x@127", "x@128"),
331 TEST ('x', "x@206", "x@207"),
332 TEST ('x', "x@333", "x@334"),
333 TEST ('x', "x@539", "x@540"),
334 TEST ('x', "x@1411", "x@1412"),
335 TEST ('x', "x@2283", "x@2284"),
336 TEST ('x', "x@3694", "x@3695"),
337 TEST ('x', "x@540", "x@541"),
338
339 TEST ('t', "last", "tlast")
340};
341
342
344template <class charT, class Traits, class Allocator>
346 const StringFunc &func,
347 const StringTestCase &tcase)
348{
349 typedef std::basic_string <charT, Traits, Allocator> String;
350 typedef typename UserTraits<charT>::MemFun UTMemFun;
351
352 static const std::size_t BUFSIZE = 256;
353
354 static charT wstr_buf [BUFSIZE];
355 static charT warg_buf [BUFSIZE];
356
357 std::size_t str_len = sizeof wstr_buf / sizeof *wstr_buf;
358 std::size_t arg_len = sizeof warg_buf / sizeof *warg_buf;
359
360 charT* wstr = rw_expand (wstr_buf, tcase.str, tcase.str_len, &str_len);
361 charT* warg = rw_expand (warg_buf, tcase.arg, tcase.arg_len, &arg_len);
362
363 static charT wres_buf [BUFSIZE];
364 std::size_t res_len = sizeof wres_buf / sizeof *wres_buf;
365 charT* wres = rw_expand (wres_buf, tcase.res, tcase.nres, &res_len);
366
367 // construct the string object to be modified
368 // and the (possibly unused) argument string
369 /* const */ String s_str (wstr, str_len);
370 const String s_arg (warg, arg_len);
371
372 if (wstr != wstr_buf)
373 delete[] wstr;
374
375 if (warg != warg_buf)
376 delete[] warg;
377
378 wstr = 0;
379 warg = 0;
380
381 String s_res;
382
383 // save the state of the string object before the call
384 // to detect wxception safety violations (changes to
385 // the state of the object after an exception)
386 const StringState str_state (rw_get_string_state (s_res));
387
388 const charT* const arg1_ptr = tcase.str ? s_str.c_str () : s_arg.c_str ();
389 const String& arg1_str = tcase.str ? s_str : s_arg;
390 const charT* const arg2_ptr = tcase.arg ? s_arg.c_str () : s_str.c_str ();
391 const String& arg2_str = tcase.arg ? s_arg : s_str;
392 const charT arg_val = make_char (char (tcase.val), (charT*)0);
393
394 std::size_t total_length_calls = 0;
395 std::size_t n_length_calls = 0;
396 std::size_t* const rg_calls = rw_get_call_counters ((Traits*)0, (charT*)0);
397
398 if (rg_calls)
399 total_length_calls = rg_calls [UTMemFun::length];
400
401 rwt_free_store* const pst = rwt_get_free_store (0);
402 SharedAlloc* const pal = SharedAlloc::instance ();
403
404 // iterate for`throw_after' starting at the next call to operator new,
405 // forcing each call to throw an exception, until the function finally
406 // succeeds (i.e, no exception is thrown)
407 std::size_t throw_count;
408 for (throw_count = 0; ; ++throw_count) {
409
410 // (name of) expected and caught exception
411 const char* expected = 0;
412 const char* caught = 0;
413
414#ifndef _RWSTD_NO_EXCEPTIONS
415
416 if (0 == tcase.bthrow) {
417 // by default excercise the exception safety of the function
418 // by iteratively inducing an exception at each call to operator
419 // new or Allocator::allocate() until the call succeeds
420 expected = exceptions [3]; // bad_alloc
421 *pst->throw_at_calls_ [0] = pst->new_calls_ [0] + throw_count + 1;
422 pal->throw_at_calls_ [pal->m_allocate] =
423 pal->throw_at_calls_ [pal->m_allocate] + throw_count + 1;
424 }
425 else {
426 // exceptions disabled for this test case
427 }
428
429#else // if defined (_RWSTD_NO_EXCEPTIONS)
430
431 if (tcase.bthrow) {
432 if (wres != wres_buf)
433 delete[] wres;
434
435 return;
436 }
437
438#endif // _RWSTD_NO_EXCEPTIONS
439
440 // start checking for memory leaks
441 rw_check_leaks (s_res.get_allocator ());
442
443 try {
444
445 switch (func.which_) {
446 case OpPlus (cptr_cstr):
447 s_res = arg1_ptr + arg2_str;
448 if (rg_calls)
449 n_length_calls = rg_calls [UTMemFun::length];
450 break;
451
452 case OpPlus (cstr_cstr):
453 s_res = arg1_str + arg2_str;
454 break;
455
456 case OpPlus (cstr_cptr):
457 s_res = arg1_str + arg2_ptr;
458 if (rg_calls)
459 n_length_calls = rg_calls [UTMemFun::length];
460 break;
461
462 case OpPlus (cstr_val):
463 s_res = arg1_str + arg_val;
464 break;
465
466 case OpPlus (val_cstr):
467 s_res = arg_val + arg2_str;
468 break;
469
470 default:
471 RW_ASSERT ("test logic error: unknown operator+ overload");
472 return;
473 }
474
475 // verfiy that strings length are equal
476 rw_assert (res_len == s_res.size (), 0, tcase.line,
477 "line %d. %{$FUNCALL} expected %{#*s} "
478 "with length %zu, got %{/*.*Gs} with length %zu",
479 __LINE__, int (tcase.nres), tcase.res, res_len,
480 int (sizeof (charT)), int (s_res.size ()),
481 s_res.c_str (), s_res.size ());
482
483 if (res_len == s_res.size ()) {
484 // if the result length matches the expected length
485 // (and only then), also verify that the modified
486 // string matches the expected result
487 const std::size_t match =
488 rw_match (tcase.res, s_res.c_str(), s_res.size ());
489
490 rw_assert (match == res_len, 0, tcase.line,
491 "line %d. %{$FUNCALL} expected %{#*s}, "
492 "got %{/*.*Gs}, difference at offset %zu",
493 __LINE__, int (tcase.nres), tcase.res,
494 int (sizeof (charT)), int (s_res.size ()),
495 s_res.c_str (), match);
496 }
497
498 // verify that Traits::length was used
499 if ((OpPlus (cptr_cstr) == func.which_
500 || OpPlus (cstr_cptr) == func.which_) && rg_calls) {
501 rw_assert (n_length_calls - total_length_calls > 0,
502 0, tcase.line, "line %d. %{$FUNCALL} doesn't "
503 "use traits::length()", __LINE__);
504 }
505 }
506
507#ifndef _RWSTD_NO_EXCEPTIONS
508
509 catch (const std::bad_alloc &ex) {
510 caught = exceptions [3];
511 rw_assert (0 == tcase.bthrow, 0, tcase.line,
512 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
513 "unexpectedly%{;} caught std::%s(%#s)",
514 __LINE__, 0 != expected, expected, caught, ex.what ());
515 }
516 catch (const std::exception &ex) {
517 caught = exceptions [4];
518 rw_assert (0, 0, tcase.line,
519 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
520 "unexpectedly%{;} caught std::%s(%#s)",
521 __LINE__, 0 != expected, expected, caught, ex.what ());
522 }
523 catch (...) {
524 caught = exceptions [0];
525 rw_assert (0, 0, tcase.line,
526 "line %d. %{$FUNCALL} %{?}expected %s,%{:}"
527 "unexpectedly%{;} caught %s",
528 __LINE__, 0 != expected, expected, caught);
529 }
530
531#endif // _RWSTD_NO_EXCEPTIONS
532
533 // FIXME: verify the number of blocks the function call
534 // is expected to allocate and detect any memory leaks
535 rw_check_leaks (s_res.get_allocator (), tcase.line,
536 std::size_t (-1), std::size_t (-1));
537
538 if (caught) {
539 // verify that an exception thrown during allocation
540 // didn't cause a change in the state of the object
541 str_state.assert_equal (rw_get_string_state (s_res),
542 __LINE__, tcase.line, caught);
543
544 if (0 == tcase.bthrow) {
545 // allow this call to operator new to succeed and try
546 // to make the next one to fail during the next call
547 // to the same function again
548 continue;
549 }
550 }
551 else if (0 < tcase.bthrow) {
552 rw_assert (caught == expected, 0, tcase.line,
553 "line %d. %{$FUNCALL} %{?}expected %s, caught %s"
554 "%{:}unexpectedly caught %s%{;}",
555 __LINE__, 0 != expected, expected, caught, caught);
556 }
557
558 break;
559 }
560
561#ifndef _RWSTD_NO_REPLACEABLE_NEW_DELETE
562
563 // verify that if exceptions are enabled and when capacity changes
564 // at least one exception is thrown
565 const std::size_t expect_throws = str_state.capacity_ < s_res.capacity ();
566
567#else // if defined (_RWSTD_NO_REPLACEABLE_NEW_DELETE)
568
569 const std::size_t expect_throws =
570 (StringIds::UserAlloc == func.alloc_id_)
571 ? str_state.capacity_ < s_res.capacity () : 0;
572
573#endif // _RWSTD_NO_REPLACEABLE_NEW_DELETE
574
575 // we may got no more 2 bad_allocs
576 rw_assert (expect_throws <= throw_count && throw_count <= 2, 0, tcase.line,
577 "line %d: %{$FUNCALL}: expected at least 1 %s exception "
578 "while changing capacity from %zu to %zu, got %zu",
579 __LINE__, exceptions [3],
580 str_state.capacity_, s_res.capacity (), throw_count);
581
582 // disable bad_alloc exceptions
583 *pst->throw_at_calls_ [0] = 0;
584 pal->throw_at_calls_ [pal->m_allocate] = 0;
585
586 if (wres != wres_buf)
587 delete[] wres;
588}
589
590
593
594int main (int argc, char** argv)
595{
596 static const StringTest
597 tests [] = {
598
599#undef TEST
600#define TEST(tag) { \
601 StringIds::op_plus_ ## tag, tag ## _test_cases, \
602 sizeof tag ## _test_cases / sizeof *tag ## _test_cases \
603 }
604
605 TEST (cptr_cstr),
606 TEST (cstr_cptr),
607 TEST (cstr_cstr),
608 TEST (cstr_val),
609 TEST (val_cstr)
610 };
611
612 const std::size_t test_count = sizeof tests / sizeof *tests;
613
614 return rw_run_string_test (argc, argv, __FILE__,
615 "lib.string::op+",
616 test_op_plus, tests, test_count);
617}
#define charT
Definition 17.names.cpp:456
void test_op_plus(charT, Traits *, Allocator *, const StringFunc &func, const StringTestCase &tcase)
#define OpPlus(which)
#define TEST(str, src, res, bthrow)
std::char_traits< S > Traits
#define main
int caught
_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 *)
Definition rw_char.h:74
_TEST_EXPORT char * rw_expand(char *, const char *, _RWSTD_SIZE_T=_RWSTD_SIZE_MAX, _RWSTD_SIZE_T *=0)
_RWSTD_SIZE_T * rw_get_call_counters(std::char_traits< charT > *, charT *)
Definition rw_char.h:495
_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 *,...)
Definition driver.cpp:1630
_TEST_EXPORT rwt_free_store * rwt_get_free_store(rwt_free_store *)
Definition new.cpp:597
StringState rw_get_string_state(const String &str)
Definition rw_strings.h:752
#define DEFINE_STRING_TEST_DISPATCH(fname)
Definition rw_strings.h:885
_TEST_EXPORT int rw_run_string_test(int, char **, const char *, const char *, StringTestFunc *, const StringTest *, _RWSTD_SIZE_T)
#define RW_ASSERT(expr)
static SharedAlloc * instance(SharedAlloc *=0)
_RWSTD_SIZE_T throw_at_calls_[n_funs]
_RWSTD_SIZE_T capacity_
Definition rw_strings.h:741
int assert_equal(const StringState &, int, int, const char *) const
_RWSTD_SIZE_T arg_len
Definition rw_strings.h:600
_RWSTD_SIZE_T str_len
Definition rw_strings.h:597
const char * str
Definition rw_strings.h:596
const char * arg
Definition rw_strings.h:599
_RWSTD_SIZE_T nres
Definition rw_strings.h:603
const char * res
Definition rw_strings.h:602
_RWSTD_SIZE_T * throw_at_calls_[2]
Definition rw_new.h:83
_RWSTD_SIZE_T new_calls_[2]
Definition rw_new.h:47