Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
21.string.exceptions.cpp
Go to the documentation of this file.
1
29#include <cassert>
30#include <cstddef>
31#include <stdexcept>
32#include <string>
33
34#include <rw_driver.h>
35
36// uses setjmp() and longjmp() to verify correct function if exception
37// exception support is disabled
38#ifdef _RWSTD_NO_EXCEPTIONS
39# include <csetjmp>
40
41int id; // "thrown" from user_throw () defined below
42jmp_buf env; // used to implement fake exception handling
43
44# undef try
45# define try if (0 == (id = setjmp (env)))
46
47# undef catch
48# define catch(ignore) else if (0 != id)
49#endif // _RWSTD_NO_EXCEPTIONS
50
51
52// use a type that string isn't instantiated/specialized on by the library
53// also use a native type to avoid having to specialize char_traits
54typedef int Char;
55
56typedef std::char_traits<Char> CharTraits;
57typedef std::allocator<Char> CharAllocator;
58
59typedef std::basic_string<Char, CharTraits, CharAllocator> String;
60
61
63
64// specialize in order to easily induce exceptional conditions
66String::size_type String::max_size () const
67{
68 return _RWSTD_NEW_CAPACITY (String, this, 0);
69}
70
71} // namespace std
72
73
74#ifndef _RWSTD_NO_REPLACEABLE_NEW_DELETE
75# include <rw_new.h>
76#else
77 // can't check for memory leaks using the replacement
78 // operators new and delete
79# define rwt_check_leaks(psize, ignore) \
80 ((psize) ? *(std::size_t*)(psize) = 0 : 0)
81#endif
82
83
84/* static */ void
85user_throw (int ex_id, char *what)
86{
87 _RW::__rw_free_what_buf (what);
88
89#ifndef _RWSTD_NO_EXCEPTIONS
90
91 throw ex_id;
92
93#else // if defined (_RWSTD_NO_EXCEPTIONS)
94
95 longjmp (env, ex_id);
96
97#endif // _RWSTD_NO_EXCEPTIONS
98}
99
100
102static void
103test_simple_throw ()
104{
105 rw_info (0, __FILE__, __LINE__, "exception handling test setup");
106
107 // establish a chekpoint for memory leaks
108 rwt_check_leaks (0, 0);
109
110#ifdef _RWSTD_NO_EXCEPTIONS
111
112 // prevent library from aborting if exception support is disabled
113 _RW::__rw_throw_proc = user_throw;
114
115#endif // _RWSTD_NO_EXCEPTIONS
116
117 int thrown = 0;
118
119 try {
120 // throw and catch a bogus exception in order to initialize
121 // data structures internal to the library to prevent any
122 // memory allocation from throwing off memory leak detection
124 _RWSTD_FUNC ("test_simple_throw ()"), 0, 0));
125 }
126
127#ifndef _RWSTD_NO_EXCEPTIONS
128
129 catch (std::out_of_range&) {
130 thrown = 1;
131 }
132
133#else // if defined (_RWSTD_NO_EXCEPTIONS)
134
135 catch (int id) {
136 thrown = id == _RWSTD_ERROR_OUT_OF_RANGE;
137 }
138
139#endif // _RWSTD_NO_EXCEPTIONS
140
141 catch (...) {
142 thrown = -1;
143 }
144
145 rw_assert (1 == thrown, __FILE__, __LINE__,
146 "_RWSTD_REQUIRES (_RWSTD_ERROR_OUT_OF_RANGE) failed to "
147 "throw std::out_of_range");
148}
149
150
152// const objects used throughout remaining test cases
153
154const Char s[] = {
155 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
156 'a', 'b', 'c', 'd', 'e', 'f', '\0'
157};
158
159const String s0 (s);
160
161
163// constructor tests
164
165static void
167{
168 rw_info (0, __FILE__, __LINE__, "21.3.1, p4 (size)");
169
170 // establish a chekpoint for memory leaks
171 rwt_check_leaks (0, 0);
172
173 int thrown = 0;
174
175 try {
176 // throws std::out_of_range if pos > str.size ()
177 String s1 (s0, s0.size () + 1);
178 }
179#ifndef _RWSTD_NO_EXCEPTIONS
180
181 catch (std::out_of_range&) {
182 thrown = 1;
183 }
184
185#else // if defined (_RWSTD_NO_EXCEPTIONS)
186
187 catch (int id) {
188 thrown = id == _RWSTD_ERROR_OUT_OF_RANGE;
189 }
190
191#endif // _RWSTD_NO_EXCEPTIONS
192
193 catch (...) {
194 thrown = -1;
195 }
196
197 std::size_t nbytes; /* uninitialized */
198 std::size_t nblocks = rwt_check_leaks (&nbytes, 0);
199 _RWSTD_UNUSED (nblocks);
200
201 rw_assert (1 == thrown, __FILE__, __LINE__,
202 ("string::string (const string&, size_type, size_type, "
203 "const allocator_type&) failed to throw std::out_of_range"));
204
205 rw_assert (s == s0, __FILE__, __LINE__,
206 "original const string modified");
207
208 rw_assert (0 == nbytes, __FILE__, __LINE__,
209 "string::string (const string&, size_type, size_type, "
210 "const allocator_type&) leaked %u bytes", nbytes);
211}
212
213static void
214test_npos_ctor ()
215{
216 rw_info (0, __FILE__, __LINE__, "21.3.1, p4 (npos)");
217
218 _RW::__rw_throw_proc = user_throw;
219
220 // establish a chekpoint for memory leaks
221 rwt_check_leaks (0, 0);
222
223 int thrown = 0;
224
225 try {
226 // throws std::out_of_range if pos > str.size ()
227 String s1 (s0, String::npos);
228 }
229 catch (int id) {
230 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
231 }
232 catch (...) { /* empty */ }
233
234 std::size_t nbytes; /* uninitialized */
235 std::size_t nblocks = rwt_check_leaks (&nbytes, 0);
236 _RWSTD_UNUSED (nblocks);
237
238 rw_assert (1 == thrown, __FILE__, __LINE__,
239 "string::string (const string&, size_type, size_type, "
240 "const allocator_type&) failed to use __rw::__rw_throw()");
241
242 rw_assert (0 == nbytes, __FILE__, __LINE__,
243 "string::string (const string&, size_type, size_type, "
244 "const allocator_type&) leaked %u bytes", nbytes);
245
246 rw_assert (s == s0, __FILE__, __LINE__,
247 "original const string modified");
248}
249
250static void
251test_max_size_ctor1 ()
252{
253 rw_info (0, __FILE__, __LINE__, "21.3.1, p7");
254
255 // establish a chekpoint for memory leaks
256 rwt_check_leaks (0, 0);
257
258 int thrown = 0;
259
260 try {
261 // throws std::out_of_range if n > max_size () (*)
262 // (*) see also lwg issue 83
263 String s1 (s0.data (), s0.max_size () + 1);
264 }
265 catch (int id) {
266 thrown = _RWSTD_ERROR_LENGTH_ERROR == id;
267 }
268 catch (...) { /* empty */ }
269
270 std::size_t nbytes; /* uninitialized */
271 std::size_t nblocks = rwt_check_leaks (&nbytes, 0);
272 _RWSTD_UNUSED (nblocks);
273
274 rw_assert (1 == thrown, __FILE__, __LINE__,
275 "string::string (const char_type*, size_type) "
276 "failed to use __rw::__rw_throw()");
277
278 rw_assert (0 == nbytes, __FILE__, __LINE__,
279 "string::string (const char_type*, size_type)"
280 "leaked %u bytes", nbytes);
281
282 rw_assert (s == s0, __FILE__, __LINE__,
283 "original const string modified");
284}
285
286static void
287test_max_size_ctor2 ()
288{
289 rw_info (0, __FILE__, __LINE__, "21.3.1, p13");
290
291 int thrown = 0;
292
293 try {
294 // throws std::length_error if n > max_size () (*)
295 // (*) see also lwg issue 83
296 String s1 (s0.max_size () + 1, Char ());
297 }
298 catch (int id) {
299 thrown = _RWSTD_ERROR_LENGTH_ERROR == id;
300 }
301 catch (...) { /* empty */ }
302
303 rw_assert (1 == thrown, __FILE__, __LINE__,
304 "string::string (size_type, char_type) "
305 "failed to use __rw::__rw_throw()");
306}
307
308static void
309test_len_ctor ()
310{
311 rw_info (0, __FILE__, __LINE__, "21.3.1, p15");
312
313 int thrown = 0;
314
315 try {
316 // same as 21.3.1, p13 for integral arguments
317 String s1 = String (long (String::npos), long (' '));
318 }
319 catch (int id) {
320 thrown = _RWSTD_ERROR_LENGTH_ERROR == id;
321 }
322 catch (...) { /* empty */ }
323
324 rw_assert (1 == thrown, __FILE__, __LINE__,
325 "string::string (InputIterator, InputIterator)"
326 "failed to use __rw::__rw_throw()");
327}
328
329
331// member functions
332
333static void
334test_resize ()
335{
336 rw_info (0, __FILE__, __LINE__, "21.3.3, p6");
337
338 String s1 (s0);
339
340 // save data, size and capacity of a constructed string
341 const String::const_pointer s1_data = s1.data ();
342 const String::size_type s1_size = s1.size ();
343 const String::size_type s1_cap = s1.capacity ();
344
345 rw_assert (s1.size () == s0.size () && s1 == s0, __FILE__, __LINE__,
346 "std::string::string (const string&)");
347
348 int thrown = 0;
349
350 try {
351 // throws std::length_error if n > max_size ()
352 s1.resize (s1.max_size () + 1U /* , char () */);
353 }
354 catch (int id) {
355 thrown = _RWSTD_ERROR_LENGTH_ERROR == id;
356 }
357 catch (...) { /* empty */ }
358
359 rw_assert (1 == thrown, __FILE__, __LINE__,
360 "string::resize (size_type, char_type)"
361 "failed to use __rw::__rw_throw()");
362
363 // verify that string wasn't modified
364 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
365 && s1_cap == s1.capacity (), __FILE__, __LINE__,
366 "string::resize (size_type, char_type) modified *this");
367}
368
369static void
370test_reserve ()
371{
372 rw_info (0, __FILE__, __LINE__, "21.3.3, p12");
373
374 int thrown = 0;
375
376 String s1 (s0);
377
378 const String::const_pointer s1_data = s1.data ();
379 const String::size_type s1_size = s1.size ();
380 const String::size_type s1_cap = s1.capacity ();
381
382 try {
383 // throws std::length_error if n > max_size ()
384 s1.reserve (s1.max_size () + 1U);
385 }
386 catch (int id) {
387 thrown = _RWSTD_ERROR_LENGTH_ERROR == id;
388 }
389 catch (...) { /* empty */ }
390
391 rw_assert (1 == thrown, __FILE__, __LINE__,
392 "string::reserve (size_type)"
393 "failed to use __rw::__rw_throw()");
394
395 // verify that string wasn't modified
396 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
397 && s1_cap == s1.capacity (), __FILE__, __LINE__,
398 "string::reserve (size_type) modified *this");
399}
400
401static void
402test_at ()
403{
404 rw_info (0, __FILE__, __LINE__, "21.3.4, p3");
405
406 int thrown = 0;
407
408 String s1 (s0);
409
410 const String::const_pointer s1_data = s1.data ();
411 const String::size_type s1_size = s1.size ();
412 const String::size_type s1_cap = s1.capacity ();
413
414 try {
415 // throws std::out_of_range if pos > size ()
416 s1.at (s1.size ());
417 }
418 catch (int id) {
419 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
420 }
421 catch (...) { /* empty */ }
422
423 rw_assert (1 == thrown, __FILE__, __LINE__,
424 "string::at (size_type) failed to use __rw::__rw_throw()");
425
426 // verify that string wasn't modified
427 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
428 && s1_cap == s1.capacity (), __FILE__, __LINE__,
429 "string::at (size_type) modified *this");
430}
431
432static void
434{
435 rw_info (0, __FILE__, __LINE__, "21.3.5.2, p3");
436
437 int thrown = 0;
438
439 String s1 (s0);
440
441 const String::const_pointer s1_data = s1.data ();
442 const String::size_type s1_size = s1.size ();
443 const String::size_type s1_cap = s1.capacity ();
444
445 try {
446 // throws std::out_of_range if pos > size ()
447 s1.append (s1, s1.size () + 1, 0);
448 }
449 catch (int id) {
450 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
451 }
452 catch (...) { /* empty */ }
453
454 rw_assert (1 == thrown, __FILE__, __LINE__,
455 "string::append (const string&, size_type, size_type) "
456 "failed to use __rw::__rw_throw()");
457
458 // verify that string wasn't modified
459 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
460 && s1_cap == s1.capacity (), __FILE__, __LINE__,
461 "string::append (const string&, size_type, size_type) "
462 "modified *this");
463}
464
465static void
467{
468 rw_info (0, __FILE__, __LINE__, "21.3.5.3, p3");
469
470 int thrown = 0;
471
472 String s1 (s0);
473
474 const String::const_pointer s1_data = s1.data ();
475 const String::size_type s1_size = s1.size ();
476 const String::size_type s1_cap = s1.capacity ();
477
478 try {
479 // throws std::out_of_range if pos > size ()
480 s1.assign (s1, s1.size () + 1, 0);
481 }
482 catch (int id) {
483 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
484 }
485 catch (...) { /* empty */ }
486
487 rw_assert (1 == thrown, __FILE__, __LINE__,
488 "string::assign (const string&, size_type, size_type) "
489 "failed to use __rw::__rw_throw()");
490
491 // verify that string wasn't modified
492 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
493 && s1_cap == s1.capacity (), __FILE__, __LINE__,
494 "string::assign (const string&, size_type, size_type) "
495 "modified *this");
496}
497
498static void
499test_insert1 ()
500{
501 rw_info (0, __FILE__, __LINE__, "21.3.5.4, p3 (pos1 > size ())");
502
503 int thrown = 0;
504
505 String s1 (s0);
506
507 const String::const_pointer s1_data = s1.data ();
508 const String::size_type s1_size = s1.size ();
509 const String::size_type s1_cap = s1.capacity ();
510
511 try {
512 // throws std::out_of_range if:
513 // 1) pos1 > size () <-- testing
514 // 2) or pos2 > str.size ()
515 s1.insert (s1.size () + 1, s1, 0, 0);
516 }
517 catch (int id) {
518 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
519 }
520 catch (...) { /* empty */ }
521
522 rw_assert (1 == thrown, __FILE__, __LINE__,
523 "string::insert (size_type, const string&, size_type, "
524 "size_type) failed to use __rw::__rw_throw()");
525
526 // verify that string wasn't modified
527 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
528 && s1_cap == s1.capacity (), __FILE__, __LINE__,
529 "string::insert (size_type, const string&, size_type, "
530 "modified *this");
531}
532
533static void
534test_insert2 ()
535{
536 rw_info (0, __FILE__, __LINE__, "21.3.5.4, p3 (pos2 > str.size ())");
537
538 int thrown = 0;
539
540 String s1 (s0);
541
542 const String::const_pointer s1_data = s1.data ();
543 const String::size_type s1_size = s1.size ();
544 const String::size_type s1_cap = s1.capacity ();
545
546 try {
547 // throws std::out_of_range if:
548 // 1) pos1 > size ()
549 // 2) or pos2 > str.size () <-- testing
550 s1.insert (s1.size (), s1, s1.size () + 1, 0);
551 }
552 catch (int id) {
553 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
554 }
555 catch (...) { /* empty */ }
556
557 rw_assert (1 == thrown, __FILE__, __LINE__,
558 "string::insert (size_type, const string&, size_type, "
559 "size_type) failed to use __rw::__rw_throw()");
560
561 // verify that string wasn't modified
562 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
563 && s1_cap == s1.capacity (), __FILE__, __LINE__,
564 "string::insert (size_type, const string&, size_type, "
565 "modified *this");
566}
567
568static void
569test_erase ()
570{
571 rw_info (0, __FILE__, __LINE__, "21.3.5.5, p2");
572
573 int thrown = 0;
574
575 String s1 (s0);
576
577 const String::const_pointer s1_data = s1.data ();
578 const String::size_type s1_size = s1.size ();
579 const String::size_type s1_cap = s1.capacity ();
580
581 try {
582 // throws std::out_of_range if pos > size ()
583 s1.erase (s1.size () + 1 /* , String::npos */);
584 }
585 catch (int id) {
586 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
587 }
588 catch (...) { /* empty */ }
589
590 rw_assert (1 == thrown, __FILE__, __LINE__,
591 "string::erase (size_type, size_type) "
592 "failed to use __rw::__rw_throw()");
593
594 // verify that string wasn't modified
595 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
596 && s1_cap == s1.capacity (), __FILE__, __LINE__,
597 "string::erase (size_type, size_type) modified *this");
598}
599
600static void
601test_replace1 ()
602{
603 rw_info (0, __FILE__, __LINE__, "21.3.5.6, p3 (pos1 > size ())");
604
605 int thrown = 0;
606
607 String s1 (s0);
608
609 const String::const_pointer s1_data = s1.data ();
610 const String::size_type s1_size = s1.size ();
611 const String::size_type s1_cap = s1.capacity ();
612
613 try {
614 // throws std::out_of_range if:
615 // 1) pos1 > size () <-- testing
616 // 2) or pos2 > str.size ()
617 s1.replace (s1.size () + 1, 0, s0, s0.size (), 0);
618 }
619 catch (int id) {
620 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
621 }
622 catch (...) { /* empty */ }
623
624 rw_assert (1 == thrown, __FILE__, __LINE__,
625 "string::replace (size_type, size_type, const string&, "
626 "size_type, size_type) failed to use __rw::__rw_throw()");
627
628 // verify that string wasn't modified
629 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
630 && s1_cap == s1.capacity (), __FILE__, __LINE__,
631 "string::replace (size_type, size_type, const string&, "
632 "size_type, size_type) modified *this");
633}
634
635static void
636test_replace2 ()
637{
638 rw_info (0, __FILE__, __LINE__, "21.3.5.6, p3 (pos2 > str.size ())");
639
640 int thrown = 0;
641
642 String s1 (s0);
643
644 const String::const_pointer s1_data = s1.data ();
645 const String::size_type s1_size = s1.size ();
646 const String::size_type s1_cap = s1.capacity ();
647
648 try {
649 // throws std::out_of_range if:
650 // 1) pos1 > size ()
651 // 2) or pos2 > str.size () <-- testing
652 s1.replace (s1.size (), 0, s1, s1.size () + 1, 0);
653 }
654 catch (int id) {
655 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
656 }
657 catch (...) { /* empty */ }
658
659 rw_assert (1 == thrown, __FILE__, __LINE__,
660 "string::replace (size_type, size_type, const string&, "
661 "size_type, size_type) failed to use __rw::__rw_throw()");
662
663 // verify that string wasn't modified
664 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
665 && s1_cap == s1.capacity (), __FILE__, __LINE__,
666 "string::replace (size_type, size_type, const string&, "
667 "size_type, size_type) modified *this");
668}
669
670static void
671test_replace3 ()
672{
673 rw_info (0, __FILE__, __LINE__, "21.3.5.6, p5");
674
675 int thrown = 0;
676
677 String s1 (s0);
678
679 const String::const_pointer s1_data = s1.data ();
680 const String::size_type s1_size = s1.size ();
681 const String::size_type s1_cap = s1.capacity ();
682
683 // establish a chekpoint for memory leaks
684 rwt_check_leaks (0, 0);
685
686 try {
687 // make sure max_size() isn't too big
688 assert (s1.max_size () == _RWSTD_NEW_CAPACITY (String, &s1, 0));
689
690 thrown = -1;
691
692 // must not throw
693 String s2 (s1.max_size () - s1.size () + 2, Char ());
694
695 thrown = 0;
696
697 // throws std::length_error if:
698 // size () - xlen >= max_size () - rlen (*)
699 // where xlen = min (n1, this->size () - pos1)
700 // and rlen = min (n2, str.size () - pos2)
701 // (*) see also lwg issue 86
702 s1.replace (0, 1, s2, 0, s2.size ());
703 }
704 catch (int id) {
705 thrown = 0 == thrown && _RWSTD_ERROR_LENGTH_ERROR == id;
706 }
707 catch (...) { /* empty */ }
708
709 std::size_t nbytes; /* uninitialized */
710 std::size_t nblocks = rwt_check_leaks (&nbytes, 0);
711 _RWSTD_UNUSED (nblocks);
712
713 rw_assert (1 == thrown, __FILE__, __LINE__,
714 "string::replace (size_type, size_type, const string&, "
715 "size_type, size_type) failed to use __rw::__rw_throw()");
716
717 // verify that string wasn't modified
718 rw_assert (s1_data == s1.data () && s1_size == s1.size ()
719 && s1_cap == s1.capacity (), __FILE__, __LINE__,
720 "string::replace (size_type, size_type, const string&, "
721 "size_type, size_type) modified *this");
722
723 // tests not only replace() but also string ctor (s2 above)
724 rw_assert (1 == thrown, __FILE__, __LINE__,
725 "string::replace (size_type, size_type, const string&, "
726 "size_type, size_type) leaked %u bytes", nbytes);
727}
728
729static void
730test_copy ()
731{
732 rw_info (0, __FILE__, __LINE__, "21.3.5.7, p2");
733
734 int thrown = 0;
735
736 Char c = '\1';
737
738 String s1 (s0);
739
740 try {
741 // throws std::out_of_range if pos > size ()
742 s1.copy (&c, 1, s1.size () + 1);
743 }
744 catch (int id) {
745 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
746 }
747 catch (...) { /* empty */ }
748
749 rw_assert (1 == thrown, __FILE__, __LINE__,
750 "string::copy (pointer, size_type, size_type) "
751 "failed to use __rw::__rw_throw()");
752
753 // verify that destination buffer wasn't modified
754 rw_assert ('\1' == c, __FILE__, __LINE__,
755 "string::copy (pointer, size_type, size_type) "
756 "modified buffer");
757}
758
759static void
760test_substr ()
761{
762 rw_info (0, __FILE__, __LINE__, "21.3.6.7, p2");
763
764 int thrown = 0;
765
766 String s1 (s0);
767
768 try {
769 // throws std::out_of_range if pos > size ()
770 s1.substr (s1.size () + 1 /* , String::npos */);
771 }
772 catch (int id) {
773 thrown = _RWSTD_ERROR_OUT_OF_RANGE == id;
774 }
775 catch (...) { /* empty */ }
776
777 rw_assert (1 == thrown, __FILE__, __LINE__,
778 "string::substr (size_type, size_type) "
779 "failed to use __rw::__rw_throw()");
780}
781
782
784static int
785run_test (int /*unused*/, char* /*unused*/ [])
786{
787 test_simple_throw ();
788
789 // constructors
791 test_npos_ctor ();
792
793 test_max_size_ctor1 ();
794 test_max_size_ctor2 ();
795
796 test_len_ctor ();
797
798 // member functions
799 test_resize ();
800 test_reserve ();
801 test_at ();
802 test_append ();
803 test_assign ();
804
805 test_insert1 ();
806 test_insert2 ();
807
808 test_erase ();
809
810 test_replace1 ();
811 test_replace2 ();
812 test_replace3 ();
813
814 test_copy ();
815 test_substr ();
816
817 return 0;
818}
819
820/*extern*/ int
821main (int argc, char* argv [])
822{
823 return rw_test (argc, argv, __FILE__,
824 "lib.basic.string",
825 "exception saftety",
826 run_test, "", 0);
827}
828
jmp_buf env
#define s1
Definition 17.names.cpp:242
#define s2
Definition 17.names.cpp:268
#define c
Definition 17.names.cpp:111
void test_append(charT *, Traits *, Allocator *, const RangeBase< std::basic_string< charT, Traits, Allocator > > &rng, const StringTestCaseData< charT > &tdata)
const String s0(s)
std::allocator< Char > CharAllocator
const Char s[]
std::char_traits< Char > CharTraits
void user_throw(int ex_id, char *what)
std::basic_string< Char, CharTraits, CharAllocator > String
void test_assign(int line, int exceptions, const Iterator &dummy, int nelems, const char *seq, std::size_t seqlen, const char *asn, std::size_t asnlen, const char *res, std::size_t reslen)
void test_erase(int line, const char *seq, std::size_t seqlen, std::size_t begoff, std::size_t len, const char *res, std::size_t reslen)
void test_copy(std::size_t N, const InputIterator &input_iter, const OutputIterator &output_iter, const T *)
Definition 25.copy.cpp:63
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
void test_size_ctor(const T *, const char *tname, bool copy)
#define main
#define _RWSTD_SPECIALIZED_CLASS
#define assert(expr)
Definition _cassert.h:40
#define _RWSTD_REQUIRES(pred, args)
Definition _defs.h:1132
#define _RWSTD_UNUSED(arg)
Definition _defs.h:972
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
#define _RWSTD_FUNC(ignore)
Definition _defs.h:1120
#define _RWSTD_NEW_CAPACITY(ignore, what, from)
Definition _defs.h:462
#define _RWSTD_ERROR_LENGTH_ERROR
Definition _error.h:92
#define _RWSTD_ERROR_OUT_OF_RANGE
Definition _error.h:93
Definition json.h:5363
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_info(int, const char *, int, const char *,...)
Definition driver.cpp:1681
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
Definition driver.cpp:1630
_TEST_EXPORT _RWSTD_SIZE_T rwt_check_leaks(_RWSTD_SIZE_T *, const rwt_free_store *)
Definition new.cpp:684