From stdcxx-dev-return-1125-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Thu Mar 23 16:29:50 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 2354 invoked from network); 23 Mar 2006 16:29:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Mar 2006 16:29:44 -0000 Received: (qmail 28910 invoked by uid 500); 23 Mar 2006 16:29:27 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 28853 invoked by uid 500); 23 Mar 2006 16:29:26 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 28811 invoked by uid 99); 23 Mar 2006 16:29:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2006 08:29:25 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of AntonP@moscow.vdiweb.com designates 195.210.189.132 as permitted sender) Received: from [195.210.189.132] (HELO exmsk.moscow.vdiweb.com) (195.210.189.132) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2006 08:29:24 -0800 Received: from [10.11.0.125] ([10.11.0.125]) by exmsk.moscow.vdiweb.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 23 Mar 2006 19:29:02 +0300 Message-ID: <4422CCCE.1090009@moscow.vdiweb.com> Date: Thu, 23 Mar 2006 19:29:02 +0300 From: Anton Pevtsov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040514 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: test for lib.string.insert Content-Type: multipart/mixed; boundary="------------040200000609050603010002" X-OriginalArrivalTime: 23 Mar 2006 16:29:02.0257 (UTC) FILETIME=[E51CD210:01C64E96] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------040200000609050603010002 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The attached file contains the updated test for lib.string.insert. With best wishes, Anton Pevtsov --------------040200000609050603010002 Content-Type: text/plain; name="21.string.insert.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="21.string.insert.cpp" /*************************************************************************** * * 21.string.insert.cpp - string test exercising lib.string.insert * * $Id: 21.string.insert.cpp 280976 2005-09-15 00:12:31Z sebor $ * *************************************************************************** * * Copyright 2006 The Apache Software Foundation or its licensors, * as applicable. * * Copyright 2006 Rogue Wave Software. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * **************************************************************************/ #include // for string #include // for size_t #include // for out_of_range, length_error #include // for rw_enabled() #include // for rw_test() #include // for rw_widen() #include // for InputIter<> /**************************************************************************/ struct MemFun { enum charT { Char, WChar, UChar }; enum Traits { DefaultTraits, UserTraits }; MemFun (charT cid, const char *cname, Traits tid, const char *tname) : cid_ (cid), tid_ (tid), cname_ (cname), tname_ (tname), aname_ ("allocator"), fname_ ("insert") { /* empty */ } charT cid_; // character type id (char or wchar_t) Traits tid_; // traits type id (default or user-defined) const char *cname_; // character type name const char *tname_; // traits name const char *aname_; // allocator name const char *fname_; // function name }; /**************************************************************************/ // for convenience and brevity #define LSTR long_string #define LLEN long_string_len static const std::size_t long_string_len = 4096; static char long_string [long_string_len]; static const char* const exp_exceptions[] = { "unknown exception", "out_of_range", "length_error" }; /**************************************************************************/ typedef enum InsertTags { // insert (size_type pos, const charT* s) i_ptr = 1, // insert (size_type pos, const basic_string& str) i_str = 2, // insert (size_type pos, const charT* s, size_type n) i_num_ptr = 3, // insert (size_type pos1, basic_string& str, size_type pos2, size_type n) i_num_str = 4, // insert (size_type pos, size_type n, charT c) i_num_char = 5, // insert (iterator p, charT c) i_iters_num_char = 6, // insert (iterator p, size_type n, charT c) i_iters_char = 7, // insert (iterator p, InputIterator first, InputIterator last) i_iters_range = 8 } ITags; /**************************************************************************/ static const struct TestCase { int line; int pos1; int pos2; int num; int cnt; char ch; const char* str; std::size_t str_len; const char* src; std::size_t src_len; const char* res; std::size_t res_len; const char* c_res; std::size_t c_res_len; int bthrow; } test_cases [] = { #undef TEST #define TEST(str, pos1, src, pos2, num, cnt, ch, res, c_res, bthrow) \ { __LINE__, pos1, pos2, num, cnt, ch, str, sizeof str - 1, src, \ sizeof src - 1, res, sizeof res - 1, c_res, sizeof c_res - 1, bthrow } // +----------------------------------------- controlled sequence // | +---------------------------------- insert() pos argument // | | +------------------------------- sequence to be inserted // | | | +-------------------- insert() pos2 argument // | | | | +----------------- insert() num argument // | | | | | +-------------- insert() count argument // | | | | | | +----------- character to be inserted // | | | | | | | +------ expected result sequence // | | | | | | | | +--- expected result sequence // | | | | | | | | | for characters // | | | | | | | | | exception info ------+ // | | | | | | | | | 0 - no exception | // | | | | | | | | | 1 - out_of_range | // | | | | | | | | | 2 - length_error | // | | | | | | | | | | // | | | | | | | | +-----------+ | // V V V V V V V V V V TEST ("ab", 0, "c", 0, 1, 1, 'c', "cab", "cab", 0), TEST ("", 0, "", 0, 0, 0, ' ', "", "", 0), TEST ("", 0, "abc", 1, 1, 1, 'b', "b", "b", 0), TEST ("\0", 0, "", 0, 0, 0, ' ', "\0", "\0", 0), TEST ("\0", 1, "", 0, 0, 0, ' ', "\0", "\0", 0), TEST ("", 0, "\0", 0, 1, 1, '\0', "\0", "\0", 0), TEST ("abc", 0, "", 0, 0, 0, ' ', "abc", "abc", 0), TEST ("abc", 1, "", 0, 0, 0, ' ', "abc", "abc", 0), TEST ("abc", 3, "", 0, 0, 0, ' ', "abc", "abc", 0), TEST ("\0", 0, "a", 0, 1, 1, 'a', "a\0", "a\0", 0), TEST ("\0", 1, "a", 0, 1, 1, 'a', "\0a", "\0a", 0), TEST ("\0", 0, "\0\0", 1, 1, 1, '\0', "\0\0", "\0\0", 0), TEST ("\0", 1, "\0\0", 0, 2, 2, '\0', "\0\0\0", "\0\0\0", 0), TEST ("\0", 1, "\0\0", 1, 5, 0, '\0', "\0\0", "\0", 0), TEST ("bcd", 0, "a", 0, 1, 2, 'a', "abcd", "aabcd", 0), TEST ("bcd", 1, "a", 0, 1, 2, 'a', "bacd", "baacd", 0), TEST ("bcd", 2, "a", 0, 2, 2, 'a', "bcad", "bcaad", 0), TEST ("bcd", 3, "a", 0, 1, 2, 'a', "bcda", "bcdaa", 0), TEST ("cde", 0, "ab", 0, 2, 2, 'a', "abcde", "aacde", 0), TEST ("cde", 1, "ab", 0, 1, 1, 'a', "cade", "cade", 0), TEST ("cde", 3, "ab", 1, 1, 3, 'a', "cdeb", "cdeaaa", 0), TEST ("cde", 2, "ab", 1, 5, 3, 'a', "cdbe", "cdaaae", 0), TEST ("ab", 0, "c\0e", 0, 3, 2, '\0', "c\0eab", "\0\0ab", 0), TEST ("ab", 1, "c\0e", 1, 2, 1, '\0', "a\0eb", "a\0b", 0), TEST ("ab", 2, "c\0e", 0, 2, 2, '\0', "abc\0", "ab\0\0", 0), TEST ("a\0b\0\0c", 3, "\0e\0", 0, 3, 2, '\0', "a\0b\0e\0\0\0c", "a\0b\0\0\0\0c", 0), TEST ("a\0b\0\0c", 2, "\0\0e\0", 0, 2, 1, '\0', "a\0\0\0b\0\0c", "a\0\0b\0\0c", 0), TEST ("\0ab\0\0c", 0, "\0e\0", 2, 1, 3, '\0', "\0\0ab\0\0c", "\0\0\0\0ab\0\0c", 0), TEST ("a\0bc\0\0", 6, "\0e", 0, 2, 2, 'a', "a\0bc\0\0\0e", "a\0bc\0\0aa", 0), TEST ("", 0, LSTR, 0, LLEN, LLEN, 'x', LSTR, LSTR, 0), TEST (LSTR, 0, "", 0, 0, 0, 'x', LSTR, LSTR, 0), #ifndef _RWSTD_NO_EXCEPTIONS TEST ("\0", 2, "", 0, 0, 0, ' ', "", "", 1), TEST ("", 0, "\0", 2, 0, 0, ' ', "", "", 2), TEST ("a", 2, "", 0, 0, 0, ' ', "", "", 1), TEST ("", 0, "a", 2, 0, 0, ' ', "", "", 2), TEST (LSTR, LLEN + 10, "", 0, 0, 0, ' ', "", "", 1), TEST ("", 0, LSTR, LLEN + 10, 0, 0, ' ', "", "", 2), #endif // _RWSTD_NO_EXCEPTIONS #undef TEST #define TEST(str, str_len, pos1, src, src_len, pos2, num, cnt, ch, \ res, c_res, bthrow) \ { __LINE__, pos1, pos2, num, cnt, ch, str, str_len - 1, src, \ src_len - 1, res, sizeof res - 1, c_res, sizeof c_res - 1, bthrow } TEST (LSTR + 2, LLEN - 2, 0, "xx", 3, 0, 2, 2, 'x', LSTR, LSTR, 0), TEST (LSTR, LLEN - 2, LLEN - 3, "xx", 3, 0, 2, 2, 'x', LSTR, LSTR, 0), TEST (LSTR + LLEN / 2 - 1, LLEN / 2 + 1, 0, LSTR + LLEN / 2, LLEN / 2, 0, LLEN / 2, LLEN / 2, 'x', LSTR, LSTR, 0), TEST ("last", 5, 4, "test", 5, 0, 4, 4, 't', "lasttest", "lasttttt", 0) }; /**************************************************************************/ template String& test_insert (const ITags which, const TestCase &cs, String &str, typename String::value_type *wsrc, bool test, typename String::iterator *ret_it) { *ret_it = str.end (); if (!test && (i_num_str == which || i_iters_num_char == which)) return str; const String& ref_src = String (wsrc, cs.src_len); const typename String::value_type ctmp = make_char (cs.ch, (typename String::value_type*)0); // construct iterator typename String::iterator it (std::size_t (cs.pos1) >= str.size () ? str.end () : str.begin () + cs.pos1); switch (which) { case i_ptr: { if (test) return str.insert (cs.pos1, wsrc); else return str.insert (cs.pos1, String (wsrc)); } case i_str: { if (test) return str.insert (cs.pos1, ref_src); else return str.insert (cs.pos1, ref_src, 0, String::npos); } case i_num_ptr: { if (test) return str.insert (cs.pos1, wsrc, cs.num); else return str.insert (cs.pos1, String (wsrc, cs.num)); } case i_num_str: { if (test) return str.insert (cs.pos1, ref_src, cs.pos2, cs.num); else return str; } case i_num_char: { if (test) return str.insert (cs.pos1, cs.cnt, make_char ( cs.ch, (typename String::value_type*)0)); else return str.insert (cs.pos1, String (cs.cnt, make_char (cs.ch, (typename String::value_type*)0))); } case i_iters_num_char: { if (test) { str.insert (it, cs.cnt, make_char (cs.ch, (typename String::value_type*)0)); return str; } else return str; } case i_iters_char: { if (test) { *ret_it = str.insert (it, make_char (cs.ch, (typename String::value_type*)0)); return str; } else { str.insert (it, 1, ctmp); return str; } } case i_iters_range: { // construct iterators int last2 = cs.pos2 + cs.num; InputIter src_first = make_iter (wsrc + cs.pos2, wsrc + cs.pos2, wsrc + last2, InputIter (0, 0, 0)); InputIter src_last = make_iter (wsrc + last2, wsrc + cs.pos2, wsrc + last2, InputIter (0, 0, 0)); if (test) { str.insert (it, src_first, src_last); return str; } else return str.insert (it - str.begin (), String (src_first, src_last)); } } return str; } /**************************************************************************/ template void test_insert (charT, Traits*, const ITags which, const MemFun *pfid, const TestCase &cs) { typedef std::basic_string > TestString; static charT wstr [LLEN]; static charT wsrc [LLEN]; static charT wres [LLEN]; // construct strings const bool use_res = (i_num_str == which || i_iters_num_char == which); const bool use_iters = (i_iters_num_char <= which); const char* const pstrres = use_res ? use_iters ? cs.c_res : cs.res : cs.str; const std::size_t res_len = use_res ? use_iters ? cs.c_res_len : cs.res_len : cs.str_len; rw_widen (wstr, cs.str, cs.str_len); rw_widen (wsrc, cs.src, cs.src_len); rw_widen (wres, pstrres, res_len); TestString s_str (wstr, cs.str_len); TestString s_src (wsrc, cs.src_len); TestString s_res (wres, res_len); const int it_off = cs.pos1; const int first_off = cs.pos2; const int last_off = cs.pos2 + cs.num; #ifndef _RWSTD_NO_EXCEPTIONS // is some exception expected ? const char* expected = 0; if (1 == cs.bthrow && !use_iters) expected = exp_exceptions [1]; if (2 == cs.bthrow && i_num_str == which) expected = exp_exceptions [1]; if (3 == cs.bthrow && !use_iters) expected = exp_exceptions [2]; const char* caught = 0; try { #endif // _RWSTD_NO_EXCEPTIONS // do insert typename TestString::iterator res_it = s_str.end (); typename TestString::iterator dummy_it = s_str.end (); const TestString& res_str = test_insert (which, cs, s_str, wsrc, true, &res_it); const TestString& ctl_str = test_insert (which, cs, s_res, wsrc, false, &dummy_it); #define CALLFMAT \ "line %d. std::basic_string<%s, %s<%2$s>, %s<%2$s>>(%{#*s})." \ "insert (%{?}%zu%{;}%{?}begin + %zu%{;}" \ "%{?}, %{/*.*Gs}%{;}%{?}, string(%{/*.*Gs})%{;}%{?}, %zu%{;}" \ "%{?}, %zu%{;}%{?}, %#c%{;}%{?}, begin + %zu%{;}%{?}, begin + %zu%{;})" #define CALLARGS \ __LINE__, pfid->cname_, pfid->tname_, pfid->aname_, int (cs.str_len), \ cs.str, i_num_char >= which, cs.pos1, i_num_char < which, it_off, \ i_ptr == which || i_num_ptr == which, int (sizeof (charT)), \ int (cs.src_len), wsrc, i_str == which || i_num_str == which, \ int (sizeof (charT)), int (s_src.size ()), s_src.c_str (), \ i_num_str == which, cs.pos2, i_num_ptr == which || i_num_str == which \ || i_num_char == which || i_iters_num_char == which, cs.num, \ i_num_char == which || i_iters_char == which \ || i_iters_num_char == which, cs.ch, i_iters_range == which, first_off, \ i_iters_range == which, last_off // verify the results if (! use_iters) { // verify the returned value rw_assert (&res_str == &s_str, 0, cs.line, CALLFMAT " : the returned reference is invalid", CALLARGS); } // verify the returned iterator if (i_iters_char == which && 0 == cs.bthrow) { rw_assert (res_it == res_str.begin () + cs.pos1, 0, cs.line, CALLFMAT " : == begin + %zu, got begin + %td", CALLARGS, cs.pos1, res_it - res_str.begin ()); } const bool success = !TestString::traits_type::compare (res_str.c_str(), ctl_str.c_str(), ctl_str.size ()); rw_assert (success, 0, cs.line, CALLFMAT " expected %{/*.*Gs}, got %{/*.*Gs}", CALLARGS, int (sizeof (charT)), int (ctl_str.size ()), ctl_str.c_str (), int (sizeof (charT)), int (res_str.size ()), res_str.c_str ()); #ifndef _RWSTD_NO_EXCEPTIONS } catch (std::out_of_range) { caught = exp_exceptions[1]; } catch (std::length_error) { caught = exp_exceptions[2]; } catch (...) { caught = exp_exceptions[0]; } #else // if defined (_RWSTD_NO_EXCEPTIONS) _RWSTD_UNUSED (should_throw); #endif // _RWSTD_NO_EXCEPTIONS rw_assert (caught == expected, 0, cs.line, CALLFMAT " %{?}expected %s, caught %s" "%{:}unexpectedly caught %s%{;}", CALLARGS, 0 != expected, expected, caught, caught); } /**************************************************************************/ static int rw_opt_no_char_traits; // for --no-char_traits static int rw_opt_no_user_traits; // for --no-user_traits static int rw_opt_no_user_chars; // for --no-user_chars static int rw_opt_no_exceptions; // for --no-exceptions static int rw_opt_no_insert_ptr; // for --no-insert-ptr static int rw_opt_no_insert_str; // for --no-insert-str static int rw_opt_no_insert_num_ptr; // for --no-insert-num-ptr static int rw_opt_no_insert_num_str; // for --no-insert-num-str static int rw_opt_no_insert_num_char; // for --no-insert-num_char static int rw_opt_no_insert_iters_num_char; // for --no-insert-iters-num-char static int rw_opt_no_insert_iters_char; // for --no-insert-iters-char static int rw_opt_no_insert_iters_range; // for --no-insert-iters-range /**************************************************************************/ static void test_insert (const MemFun *pfid, const ITags which) { rw_info (0, 0, 0, "std::basic_string<%s, %s<%1$s>, %s<%1$s>>::" "insert (%{?}size_type pos%{;}%{?}iterator p%{;}" "%{?}, const char* s%{;}%{?}, const basic_string& str%{;}" "%{?}, size_type pos2%{;}%{?}, size_type n%{;}%{?}, charT c%{;}" "%{?}, InputIterator first%{;}%{?}, InputIterator last%{;})", pfid->cname_, pfid->tname_, pfid->aname_, i_num_char >= which, i_num_char < which, i_ptr == which || i_num_ptr == which, i_str == which || i_num_str == which, i_num_str == which, i_num_ptr == which || i_num_str == which || i_num_char == which || i_iters_num_char == which, i_num_char == which || i_iters_char == which || i_iters_num_char == which, i_iters_range == which, i_iters_range == which); #undef TEST #define TEST(charT, Traits, cs) \ test_insert (charT(), (Traits*)0, which, pfid, cs) static const std::size_t ncases = sizeof test_cases / sizeof *test_cases; for (std::size_t i = 0; i != ncases; ++i) { if (!rw_enabled (test_cases[i].line)) { rw_note (0, 0, __LINE__, "test on line %d disabled", test_cases[i].line); continue; } // do not exercise exceptions if they were disabled if (0 != rw_opt_no_exceptions && 0 != test_cases[i].bthrow) continue; if (MemFun:: DefaultTraits == pfid->tid_) { if (MemFun::Char == pfid->cid_) TEST (char, std::char_traits, test_cases[i]); #ifndef _RWSTD_NO_WCHAR_T else TEST (wchar_t, std::char_traits, test_cases[i]); #endif // _RWSTD_NO_WCHAR_T } else { if (MemFun::Char == pfid->cid_) TEST (char, UserTraits, test_cases[i]); #ifndef _RWSTD_NO_WCHAR_T else if (MemFun::WChar == pfid->cid_) TEST (wchar_t, UserTraits, test_cases[i]); #endif // _RWSTD_NO_WCHAR_T else TEST (UserChar, UserTraits, test_cases[i]); } } } /**************************************************************************/ static void note_test_disabled (const MemFun *pfid, const ITags which) { rw_note (0, 0, 0, "std::basic_string<%s, %s<%1$s>, %s<%1$s>>::" "insert (%{?}size_type pos%{;}%{?}iterator p%{;}" "%{?}, const char* s%{;}%{?}, const basic_string& str%{;}" "%{?}, size_type pos2%{;}%{?}, size_type n%{;}%{?}, charT c%{;}" "%{?}, InputIterator first%{;}%{?}, InputIterator last%{;}) " "test disabled", pfid->cname_, pfid->tname_, pfid->aname_, i_num_char >= which, i_num_char < which, i_ptr == which || i_num_ptr == which, i_str == which || i_num_str == which, i_num_str == which, i_num_ptr == which || i_num_str == which || i_num_char == which || i_iters_num_char == which, i_num_char == which || i_iters_char == which || i_iters_num_char == which, i_iters_range == which, i_iters_range == which); } static void run_test (const MemFun *pfid) { if (MemFun::UserTraits == pfid->tid_ && rw_opt_no_user_traits) { rw_note (1 < rw_opt_no_user_traits++, 0, 0, "user defined traits test disabled"); } else if (MemFun::DefaultTraits == pfid->tid_ && rw_opt_no_char_traits) { rw_note (1 < rw_opt_no_char_traits++, 0, 0, "char_traits test disabled"); } else { if (rw_opt_no_exceptions) rw_note (1 < rw_opt_no_exceptions++, 0, 0, "string::insert exceptions tests disabled"); // exercise all insert overloads #undef TEST #define TEST(option, r_tag) \ if (option) \ note_test_disabled (pfid, r_tag); \ else \ test_insert (pfid, r_tag); // insert (size_type pos, const charT* s) TEST (rw_opt_no_insert_ptr, i_ptr); // insert (size_type pos, const basic_string& str) TEST (rw_opt_no_insert_str, i_str); // insert (size_type pos, const charT* s, size_type n) TEST (rw_opt_no_insert_num_ptr, i_num_ptr); // insert (size_type pos1, basic_string& str, size_type pos2, size_type n) TEST (rw_opt_no_insert_num_str, i_num_str); // insert (size_type pos, size_type n, charT c) TEST (rw_opt_no_insert_num_char, i_num_char); // insert (iterator p, size_type n, charT c) TEST (rw_opt_no_insert_iters_num_char, i_iters_num_char); // insert (iterator p, charT c) TEST (rw_opt_no_insert_iters_char, i_iters_char); // insert (iterator p, InputIterator first, InputIterator last) TEST (rw_opt_no_insert_iters_range, i_iters_range); } } /**************************************************************************/ int run_test (int, char*[]) { if ('\0' == LSTR [0]) { // initialize LSTR for (std::size_t i = 0; i != sizeof LSTR - 1; ++i) LSTR [i] = 'x'; } if (rw_enabled ("char")) { MemFun fid (MemFun::Char, "char", MemFun::DefaultTraits, 0); fid.tname_ = "char_traits"; run_test (&fid); fid.tid_ = MemFun::UserTraits; fid.tname_ = "UserTraits"; run_test (&fid); } else rw_note (0, 0, 0, "string::insert char tests disabled"); if (rw_enabled ("wchar_t")) { MemFun fid (MemFun::WChar, "wchar_t", MemFun::DefaultTraits, 0); fid.tname_ = "char_traits"; run_test (&fid); fid.tid_ = MemFun::UserTraits; fid.tname_ = "UserTraits"; run_test (&fid); } else rw_note (0, 0, 0, "string::insert wchar tests disabled"); if (rw_opt_no_user_chars) { rw_note (0, 0, 0, "user defined chars test disabled"); } else { MemFun fid (MemFun::UChar, "UserChar", MemFun::UserTraits, 0); fid.tname_ = "UserTraits"; run_test (&fid); } // silence a bogus EDG eccp remark #550-D: // variable "exp_exceptions" was set but never used _RWSTD_UNUSED (exp_exceptions); return 0; } /**************************************************************************/ int main (int argc, char** argv) { return rw_test (argc, argv, __FILE__, "lib.string.insert", 0 /* no comment */, run_test, "|-no-char_traits# " "|-no-user_traits# " "|-no-user_chars# " "|-no-exceptions# " "|-no-insert-ptr# " "|-no-insert-str# " "|-no-insert-num-ptr# " "|-no-insert-num-str# " "|-no-insert-num-char# " "|-no-insert-iters-num-char# " "|-no-insert-iters_char# " "|-no-insert-iters-range#", &rw_opt_no_char_traits, &rw_opt_no_user_traits, &rw_opt_no_user_chars, &rw_opt_no_exceptions, &rw_opt_no_insert_ptr, &rw_opt_no_insert_str, &rw_opt_no_insert_num_ptr, &rw_opt_no_insert_num_str, &rw_opt_no_insert_num_char, &rw_opt_no_insert_iters_num_char, &rw_opt_no_insert_iters_char, &rw_opt_no_insert_iters_range); } --------------040200000609050603010002--