stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r395732 - in /incubator/stdcxx/trunk/tests/strings: 21.string.append.cpp 21.string.assign.cpp
Date Thu, 20 Apr 2006 23:31:52 GMT
Author: sebor
Date: Thu Apr 20 16:31:50 2006
New Revision: 395732

URL: http://svn.apache.org/viewcvs?rev=395732&view=rev
Log:
2006-04-20  Martin Sebor  <sebor@roguewave.com>

	* 21.string.append.cpp (test_append): Replaced get_append_format()
	with a direct call to StringMembers::format.
	* 21.string.assign.cpp (test_assign): Same for get_assign_format().

Modified:
    incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp

Modified: incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.append.cpp?rev=395732&r1=395731&r2=395732&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.append.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.append.cpp Thu Apr 20 16:31:50 2006
@@ -797,25 +797,16 @@
 
 /**************************************************************************/
 
-static char*
-get_append_format (const MemFun         *pfid,
-                   const AppendOverload  which,
-                   const TestCase       &cs)
-{
-    return StringMembers::format (pfid->cid_, pfid->tid_,
-                                  StringMembers::DefaultAllocator,
-                                  which, cs);
-}
-
-/**************************************************************************/
-
 static void
 test_append (const MemFun *pfid, const AppendOverload which,
              const TestCase& cs, bool exc_safety_test)
 {
     // format the description of the function call including
     // the values of arguments for use in diagnostics
-    char* const funcall = get_append_format (pfid, which, cs);
+    char* const funcall =
+        StringMembers::format (pfid->cid_, pfid->tid_,
+                               StringMembers::DefaultAllocator,
+                               which, cs);
 
 #undef TEST
 #define TEST(charT, Traits)	                                          \

Modified: incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp?rev=395732&r1=395731&r2=395732&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp Thu Apr 20 16:31:50 2006
@@ -798,86 +798,16 @@
 
 /**************************************************************************/
 
-static char*
-get_assign_format (const MemFun         *pfid,
-                   const AssignOverload  which,
-                   const TestCase       &cs)
-{
-    char*       buf     = 0;
-    std::size_t bufsize = 0;
-
-    if (   StringMembers::DefaultTraits == pfid->tid_
-        && (   StringMembers::Char == pfid->cid_
-            || StringMembers::WChar == pfid->cid_))
-        rw_asnprintf (&buf, &bufsize,
-                      "std::%{?}w%{;}string (%{#*s}).assign",
-                      StringMembers::WChar == pfid->cid_,
-                      int (cs.str_len), cs.str);
-    else
-        rw_asnprintf (&buf, &bufsize,
-                      "std::basic_string<%s, %s<%1$s>, %s<%1$s>>(%{#*s})"
-                      ".assign", pfid->cname_, pfid->tname_, pfid->aname_,
-                      int (cs.str_len), cs.str);
-
-    // assignment from self to self?
-    const bool self = 0 == cs.arg;
-
-    switch (which) {
-    case Assign (ptr):
-        rw_asnprintf (&buf, &bufsize,
-                      "%{+} (%{?}%{#*s}%{;}%{?}this->c_str ()%{;})",
-                      !self, int (cs.arg_len), cs.arg, self);
-        break;
-
-    case Assign (str):
-        rw_asnprintf (&buf, &bufsize,
-                      "%{+} (%{?}string (%{#*s})%{;}%{?}*this%{;})",
-                      !self, int (cs.arg_len), cs.arg, self);
-        break;
-
-    case Assign (ptr_size):
-        rw_asnprintf (&buf, &bufsize, "%{+} ("
-                      "%{?}%{#*s}%{;}%{?}this->c_str ()%{;}, %zu)",
-                      !self, int (cs.arg_len), cs.arg, self, cs.size);
-        break;
-
-    case Assign (str_off_size):
-        rw_asnprintf (&buf, &bufsize, "%{+} ("
-                      "%{?}string (%{#*s})%{;}%{?}*this%{;}, %zu, %zu)",
-                      !self, int (cs.arg_len), cs.arg,
-                      self, cs.off, cs.size);
-        break;
-
-    case Assign (size_val):
-        rw_asnprintf (&buf, &bufsize,
-                      "%{+} (%zu, %#c)", cs.size, cs.val);
-        break;
-
-    case Assign (range):
-        rw_asnprintf (&buf, &bufsize, "%{+} ("
-                      "%{?}%{#*s}%{;}%{?}*this%{;}.begin + %zu, "
-                      "%{?}%{#*s}%{;}%{?}*this%{;}.begin + %zu)",
-                      !self, int (cs.arg_len), cs.arg,
-                      self, cs.off, !self, int (cs.arg_len), cs.arg,
-                      self, cs.off + cs.size);
-        break;
-
-    default:
-        RW_ASSERT (!"test logic error: unknown assign overload");
-    }
-
-    return buf;
-}
-
-/**************************************************************************/
-
 static void
 test_assign (const MemFun *pfid, const AssignOverload which,
              const TestCase& cs, bool exc_safety_test)
 {
     // format the description of the function call including
     // the values of arguments for use in diagnostics
-    char* const funcall = get_assign_format (pfid, which, cs);
+    char* const funcall =
+        StringMembers::format (pfid->cid_, pfid->tid_,
+                               StringMembers::DefaultAllocator,
+                               which, cs);
 
 #undef TEST
 #define TEST(charT, Traits)                                                 \



Mime
View raw message