stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r396954 - in /incubator/stdcxx/trunk/tests: include/21.strings.h src/21.strings.cpp
Date Tue, 25 Apr 2006 19:11:20 GMT
Author: sebor
Date: Tue Apr 25 12:11:00 2006
New Revision: 396954

URL: http://svn.apache.org/viewcvs?rev=396954&view=rev
Log:
2006-04-25 Anton Pevtsov <antonp@moscow.vdiweb.com>

	* 21.strings.h (SignatureId): Added missed signature sig_val.
	(MemberId): Added new element mem_op_plus_eq.
	(OverloadId): Added new elements for += overloads.
	* 21.strings.cpp (setvars): Updated to support operator+=
	overloads, minor formatting bugs fixed.

Modified:
    incubator/stdcxx/trunk/tests/include/21.strings.h
    incubator/stdcxx/trunk/tests/src/21.strings.cpp

Modified: incubator/stdcxx/trunk/tests/include/21.strings.h
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/include/21.strings.h?rev=396954&r1=396953&r2=396954&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/include/21.strings.h (original)
+++ incubator/stdcxx/trunk/tests/include/21.strings.h Tue Apr 25 12:11:00 2006
@@ -78,6 +78,8 @@
         sig_size_size_str_size_size,
         // (size_type, size_type, size_type, value_type)
         sig_size_size_size_val,
+        // (value_type)
+        sig_val,
         // (InputIterator, InputIterator)
         sig_range,
         // (iterator, value_type)
@@ -102,13 +104,15 @@
     };
 
     enum MemberId {
-        mem_append  = 1 << 5,
-        mem_assign  = 1 << 6,
-        mem_erase   = 1 << 7,
-        mem_insert  = 1 << 8,
-        mem_replace = 1 << 9,
-        mem_mask    =
-            mem_append | mem_assign | mem_erase | mem_insert | mem_replace
+        mem_append     = 1 << 5,
+        mem_assign     = 1 << 6,
+        mem_erase      = 1 << 7,
+        mem_insert     = 1 << 8,
+        mem_replace    = 1 << 9,
+        mem_op_plus_eq = 1 << 10,
+        mem_mask       =
+            mem_append | mem_assign | mem_erase | mem_insert | 
+            mem_replace | mem_op_plus_eq
     };
 
     // unique identifiers for all overloads of each member function
@@ -189,7 +193,14 @@
         // (iterator, iterator, size_type, value_type)
         replace_iter_iter_size_val = mem_replace + sig_iter_iter_size_val,
         // (iterator, iterator, InputIterator, InputIterator)
-        replace_iter_iter_range = mem_replace + sig_iter_iter_range
+        replace_iter_iter_range = mem_replace + sig_iter_iter_range,
+
+        // operator += (const charT* s)
+        op_plus_eq_ptr = mem_op_plus_eq + sig_ptr,   
+        // operator += (const basic_string& str)
+        op_plus_eq_str = mem_op_plus_eq + sig_str,
+        // operator += (charT c)
+        op_plus_eq_val = mem_op_plus_eq + sig_val
     };
 
     struct Function {

Modified: incubator/stdcxx/trunk/tests/src/21.strings.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/src/21.strings.cpp?rev=396954&r1=396953&r2=396954&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/src/21.strings.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/21.strings.cpp Tue Apr 25 12:11:00 2006
@@ -122,6 +122,8 @@
             fname ="insert";
         else if (fun.which_ & mem_replace)
             fname ="replace";
+        else if (fun.which_ & mem_op_plus_eq)
+            fname ="operator+=";
 
         free (buf);
         buf     = 0;
@@ -152,6 +154,7 @@
             "size_type, size_type, const value_type*, size_type",
             "size_type, size_type, const value_type*, size_type, size_type",
             "size_type, size_type, size_type, value_type",
+            "value_type",
             "InputIterator, InputIterator",
             "iterator, value_type",
             "iterator, size_type, value_type",
@@ -189,6 +192,7 @@
     switch (fun.which_) {
     case append_ptr:
     case assign_ptr:
+    case op_plus_eq_ptr:
         rw_asnprintf (&buf, &bufsize,
                       "%{+}(%{?}%{#*s}%{;}%{?}this->c_str ()%{;})",
                       !self, int (pcase->arg_len), pcase->arg, self);
@@ -196,6 +200,7 @@
 
     case append_str:
     case assign_str:
+    case op_plus_eq_str:
         rw_asnprintf (&buf, &bufsize,
                       "%{+}(%{?}string (%{#*s})%{;}%{?}*this%{;})",
                       !self, int (pcase->arg_len), pcase->arg, self);
@@ -220,16 +225,17 @@
     case append_size_val:
     case assign_size_val:
         rw_asnprintf (&buf, &bufsize,
-                      "%{+} %s (%zu, %#c)", pcase->size, pcase->val);
+                      "%{+} (%zu, %#c)", pcase->size, pcase->val);
         break;
 
     case append_range:
     case assign_range:
         rw_asnprintf (&buf, &bufsize, "%{+}("
-                      "%{?}%{#*s}%{;}%{?}this->%{;}begin() + %zu, "
+                      "%{?}%{#*s}%{;}%{?}this->%{;}.begin() + %zu, "
                       "%{?}%{#*s}%{;}%{?}this->%{;}.begin() + %zu)",
                       !self, int (pcase->arg_len), pcase->arg,
-                      self, pcase->off, !self, int (pcase->arg_len), pcase->arg,
+                      self, pcase->off, !self, int (pcase->arg_len),
+                      pcase->arg,
                       self, pcase->off + pcase->size);
         break;
 
@@ -361,6 +367,11 @@
                       pcase->off2 + pcase->size2);
         break;
 
+    case op_plus_eq_val:
+        rw_asnprintf (&buf, &bufsize,
+                      "%{+} (%#c)", pcase->val);
+        break;
+
     default:
         RW_ASSERT (!"test logic error: unknown overload");
     }
@@ -370,6 +381,7 @@
     free (buf);
 }
 
+/**************************************************************************/
 
 void StringMembers::
 run_test (TestFun *test_callback, const Test *tests, size_t test_count)
@@ -377,7 +389,6 @@
     const charT char_types[] = {
         Char, WChar, UChar,
         UnknownChar
-        
     };
 
     const Traits traits_types[] = {



Mime
View raw message