stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r417904 [5/5] - in /incubator/stdcxx/trunk/tests: self/ src/ strings/
Date Wed, 28 Jun 2006 23:47:11 GMT
Modified: incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.substr.cpp Wed Jun 28 16:47:10 2006
@@ -63,13 +63,13 @@
     TEST ("abc",              "abc"),
 
     TEST ("",                 ""),
-    TEST ("\0",               "\0"),
-    TEST ("a\0",              "a\0"),
-    TEST ("\0a",              "\0a"),
-
-    TEST ("a\0\0bcd\0",       "a\0\0bcd\0"),
-    TEST ("\0\0abcd\0",       "\0\0abcd\0"),
-    TEST ("\0\0ab\0\0",       "\0\0ab\0\0"),
+    TEST ("<U0>",             "<U0>"),
+    TEST ("a<U0>",            "a<U0>"),
+    TEST ("<U0>a",            "<U0>a"),
+
+    TEST ("a<U0>@2bcd<U0>",   "a<U0>@2bcd<U0>"),
+    TEST ("<U0>@2abcd<U0>",   "<U0>@2abcd<U0>"),
+    TEST ("<U0>@2ab<U0>@2",   "<U0>@2ab<U0>@2"),
 
     TEST ("x@4096",           "x@4096"),
 
@@ -90,46 +90,46 @@
       res, sizeof res - 1, bthrow }
 
     //    +--------------------------------------- controlled sequence
-    //    |                 +--------------------- substr() off argument
-    //    |                 |   +----------------- expected result sequence
-    //    |                 |   |             +--- exception info:
-    //    |                 |   |             |      0 - no exception
-    //    |                 |   |             |      1 - out_of_range
-    //    V                 V   V             V
-    TEST ("abc",            0,  "abc",        0),
-
-    TEST ("",               0,  "",           0),
-    TEST ("\0",             0,  "\0",         0),
-    TEST ("\0",             1,  "",           0),
-    TEST ("a\0",            0,  "a\0",        0),
-    TEST ("a\0",            1,  "\0",         0),
-    TEST ("\0a",            0,  "\0a",        0),
-    TEST ("\0a",            1,  "a",          0),
-
-    TEST ("a\0\0bcd\0",     0,  "a\0\0bcd\0", 0),
-    TEST ("a\0\0bcd\0",     1,  "\0\0bcd\0",  0),
-    TEST ("a\0\0bcd\0",     6,  "\0",         0),
-    TEST ("a\0\0bcd\0",     7,  "",           0),
-    TEST ("\0\0abcd\0",     0,  "\0\0abcd\0", 0),
-    TEST ("\0\0abcd\0",     1,  "\0abcd\0",   0),
-    TEST ("\0\0abcd\0",     2,  "abcd\0",     0),
-    TEST ("\0\0ab\0\0",     0,  "\0\0ab\0\0", 0),
-    TEST ("\0\0ab\0\0",     1,  "\0ab\0\0",   0),
-    TEST ("\0\0ab\0\0",     4,  "\0\0",       0),
-    TEST ("\0\0ab\0\0",     6,  "",           0),
-
-    TEST ("x@4096",         0,  "x@4096",     0),
-    TEST ("x@4096",      4094,  "xx",         0),
-    TEST ("x@4096",      4088,  "xxxxxxxx",   0),
-    TEST ("x@4096",      4096,  "",           0),
-    TEST ("abx@4096",       2,  "x@4096",     0),
-    TEST ("x@4096ab",    2048,  "x@2048ab",   0),
-
-    TEST ("\0",             2,  "",           1),
-    TEST ("a",             10,  "",           1),
-    TEST ("x@4096",      4106,  "",           1),
+    //    |                     +----------------- substr() off argument
+    //    |                     |   +------------- expected result sequence
+    //    |                     |   |                 +--- exception info:
+    //    |                     |   |                 |      0 - no exception
+    //    |                     |   |                 |      1 - out_of_range
+    //    V                     V   V                 V
+    TEST ("abc",                0,  "abc",            0),
+
+    TEST ("",                   0,  "",               0),
+    TEST ("<U0>",               0,  "<U0>",           0),
+    TEST ("<U0>",               1,  "",               0),
+    TEST ("a<U0>",              0,  "a<U0>",          0),
+    TEST ("a<U0>",              1,  "<U0>",           0),
+    TEST ("<U0>a",              0,  "<U0>a",          0),
+    TEST ("<U0>a",              1,  "a",              0),
+
+    TEST ("a<U0>@2bcd<U0>",     0,  "a<U0>@2bcd<U0>", 0),
+    TEST ("a<U0>@2bcd<U0>",     1,  "<U0>@2bcd<U0>",  0),
+    TEST ("a<U0>@2bcd<U0>",     6,  "<U0>",           0),
+    TEST ("a<U0>@2bcd<U0>",     7,  "",               0),
+    TEST ("<U0>@2abcd<U0>",     0,  "<U0>@2abcd<U0>", 0),
+    TEST ("<U0>@2abcd<U0>",     1,  "<U0>abcd<U0>",   0),
+    TEST ("<U0>@2abcd<U0>",     2,  "abcd<U0>",       0),
+    TEST ("<U0>@2ab<U0>@2",     0,  "<U0>@2ab<U0>@2", 0),
+    TEST ("<U0>@2ab<U0>@2",     1,  "<U0>ab<U0>@2",   0),
+    TEST ("<U0>@2ab<U0>@2",     4,  "<U0>@2",         0),
+    TEST ("<U0>@2ab<U0>@2",     6,  "",               0),
+
+    TEST ("x@4096",             0,  "x@4096",         0),
+    TEST ("x@4096",          4094,  "xx",             0),
+    TEST ("x@4096",          4088,  "xxxxxxxx",       0),
+    TEST ("x@4096",          4096,  "",               0),
+    TEST ("abx@4096",           2,  "x@4096",         0),
+    TEST ("x@4096ab",        2048,  "x@2048ab",       0),
+
+    TEST ("<U0>",               2,  "",               1),
+    TEST ("a",                 10,  "",               1),
+    TEST ("x@4096",          4106,  "",               1),
 
-    TEST ("last",           0,  "last",       0)
+    TEST ("last",               0,  "last",           0)
 };
 
 /**************************************************************************/
@@ -145,62 +145,64 @@
       res, sizeof res - 1, bthrow }
 
     //    +------------------------------------------ controlled sequence
-    //    |                 +------------------------ substr() off argument
-    //    |                 |   +-------------------- substr() n argument
-    //    |                 |   |  +----------------- expected result sequence
-    //    |                 |   |  |             +--- exception info:
-    //    |                 |   |  |             |      0 - no exception
-    //    |                 |   |  |             |      1 - out_of_range
-    //    V                 V   V  V             V
-    TEST ("abc",            0,  3, "abc",        0),
-
-    TEST ("",               0,  0, "",           0),
-    TEST ("\0",             0,  1, "\0",         0),
-    TEST ("\0",             0,  0, "",           0),
-    TEST ("\0",             1,  1, "",           0),
-    TEST ("a\0",            0,  2, "a\0",        0),
-    TEST ("a\0",            1,  2, "\0",         0),
-    TEST ("a\0",            0,  1, "a",          0),
-    TEST ("a\0",            1,  1, "\0",         0),
-    TEST ("a\0",            1,  0, "",           0),
-    TEST ("\0a",            0,  2, "\0a",        0),
-    TEST ("\0a",            0,  1, "\0",         0),
-    TEST ("\0a",            1,  2, "a",          0),
-
-    TEST ("a\0\0bcd\0",     0,  7, "a\0\0bcd\0", 0),
-    TEST ("a\0\0bcd\0",     1,  7, "\0\0bcd\0",  0),
-    TEST ("a\0\0bcd\0",     0,  3, "a\0\0",      0),
-    TEST ("a\0\0bcd\0",     1,  2, "\0\0",       0),
-    TEST ("a\0\0bcd\0",     6,  7, "\0",         0),
-    TEST ("a\0\0bcd\0",     7,  7, "",           0),
-    TEST ("\0\0abcd\0",     0,  7, "\0\0abcd\0", 0),
-    TEST ("\0\0abcd\0",     1,  7, "\0abcd\0",   0),
-    TEST ("\0\0abcd\0",     0,  3, "\0\0a",      0),
-    TEST ("\0\0abcd\0",     1,  1, "\0",         0),
-    TEST ("\0\0abcd\0",     6,  3, "\0",         0),
-    TEST ("\0\0abcd\0",     1,  6, "\0abcd\0",   0),
-    TEST ("\0\0abcd\0",     0,  0, "",           0),
-    TEST ("\0\0abcd\0",     2,  7, "abcd\0",     0),
-    TEST ("\0\0ab\0\0",     0,  6, "\0\0ab\0\0", 0),
-    TEST ("\0\0ab\0\0",     1,  6, "\0ab\0\0",   0),
-    TEST ("\0\0ab\0\0",     0,  2, "\0\0",       0),
-    TEST ("\0\0ab\0\0",     4,  6, "\0\0",       0),
-    TEST ("\0\0ab\0\0",     2,  3, "ab\0",       0),
-    TEST ("\0\0ab\0\0",     6,  6, "",           0),
-
-    TEST ("x@4096",       0, 4096, "x@4096",     0),
-    TEST ("x@4096",      4095, 4096, "x",        0),
-    TEST ("x@4096",      4088,  2, "xx",         0),
-    TEST ("x@4096",      4093,  5, "xxx",        0),
-    TEST ("x@4096",      4088,  8, "xxxxxxxx",   0),
-    TEST ("x@4096",      4096,  1, "",           0),
-    TEST ("ax@4096b",     1, 4094, "x@4094",     0),
-
-    TEST ("\0",             2,  0, "",           1),
-    TEST ("a",             10,  0, "",           1),
-    TEST ("x@4096",      4106,  0, "",           1),
+    //    |                     +-------------------- substr() off argument
+    //    |                     |   +---------------- substr() n argument
+    //    |                     |   |  +------------- expected result sequence
+    //    |                     |   |  |         +--- exception info:
+    //    |                     |   |  |         |      0 - no exception
+    //    |                     |   |  |         |      1 - out_of_range
+    //    |                     |   |  |         |      
+    //    |                     |   |  |         +-------+          
+    //    V                     V   V  V                 V
+    TEST ("abc",                0,  3, "abc",            0),
+
+    TEST ("",                   0,  0, "",               0),
+    TEST ("<U0>",               0,  1, "<U0>",           0),
+    TEST ("<U0>",               0,  0, "",               0),
+    TEST ("<U0>",               1,  1, "",               0),
+    TEST ("a<U0>",              0,  2, "a<U0>",          0),
+    TEST ("a<U0>",              1,  2, "<U0>",           0),
+    TEST ("a<U0>",              0,  1, "a",              0),
+    TEST ("a<U0>",              1,  1, "<U0>",           0),
+    TEST ("a<U0>",              1,  0, "",               0),
+    TEST ("<U0>a",              0,  2, "<U0>a",          0),
+    TEST ("<U0>a",              0,  1, "<U0>",           0),
+    TEST ("<U0>a",              1,  2, "a",              0),
+
+    TEST ("a<U0>@2bcd<U0>",     0,  7, "a<U0>@2bcd<U0>", 0),
+    TEST ("a<U0>@2bcd<U0>",     1,  7, "<U0>@2bcd<U0>",  0),
+    TEST ("a<U0>@2bcd<U0>",     0,  3, "a<U0>@2",        0),
+    TEST ("a<U0>@2bcd<U0>",     1,  2, "<U0>@2",         0),
+    TEST ("a<U0>@2bcd<U0>",     6,  7, "<U0>",           0),
+    TEST ("a<U0>@2bcd<U0>",     7,  7, "",               0),
+    TEST ("<U0>@2abcd<U0>",     0,  7, "<U0>@2abcd<U0>", 0),
+    TEST ("<U0>@2abcd<U0>",     1,  7, "<U0>abcd<U0>",   0),
+    TEST ("<U0>@2abcd<U0>",     0,  3, "<U0>@2a",        0),
+    TEST ("<U0>@2abcd<U0>",     1,  1, "<U0>",           0),
+    TEST ("<U0>@2abcd<U0>",     6,  3, "<U0>",           0),
+    TEST ("<U0>@2abcd<U0>",     1,  6, "<U0>abcd<U0>",   0),
+    TEST ("<U0>@2abcd<U0>",     0,  0, "",               0),
+    TEST ("<U0>@2abcd<U0>",     2,  7, "abcd<U0>",       0),
+    TEST ("<U0>@2ab<U0>@2",     0,  6, "<U0>@2ab<U0>@2", 0),
+    TEST ("<U0>@2ab<U0>@2",     1,  6, "<U0>ab<U0>@2",   0),
+    TEST ("<U0>@2ab<U0>@2",     0,  2, "<U0>@2",         0),
+    TEST ("<U0>@2ab<U0>@2",     4,  6, "<U0>@2",         0),
+    TEST ("<U0>@2ab<U0>@2",     2,  3, "ab<U0>",         0),
+    TEST ("<U0>@2ab<U0>@2",     6,  6, "",               0),
+
+    TEST ("x@4096",           0, 4096, "x@4096",         0),
+    TEST ("x@4096",        4095, 4096, "x",              0),
+    TEST ("x@4096",          4088,  2, "xx",             0),
+    TEST ("x@4096",          4093,  5, "xxx",            0),
+    TEST ("x@4096",          4088,  8, "xxxxxxxx",       0),
+    TEST ("x@4096",          4096,  1, "",               0),
+    TEST ("ax@4096b",         1, 4094, "x@4094",         0),
+
+    TEST ("<U0>",               2,  0, "",               1),
+    TEST ("a",                 10,  0, "",               1),
+    TEST ("x@4096",          4106,  0, "",               1),
 
-    TEST ("last",           0,  4, "last",       0)
+    TEST ("last",               0,  4, "last",           0)
 };
 
 /**************************************************************************/
@@ -287,7 +289,7 @@
             // (and only then), also verify that the resulted
             // string matches the expected result
             const std::size_t match =
-                rw_match (tcase.res, s_res.c_str(), tcase.nres);
+                rw_match (tcase.res, s_res.c_str(), s_res.size ());
 
             rw_assert (match == res_len, 0, tcase.line,
                        "line %d. %{$FUNCALL} expected %{#*s}, "

Modified: incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.swap.cpp Wed Jun 28 16:47:10 2006
@@ -60,53 +60,53 @@
     }
 
     //    +------------------------- controlled "destination" (str) sequence
-    //    |            +------------ controlled "source" (arg) sequence
-    //    |            |
-    //    V            V
-    TEST ("",          ""),
-    TEST ("",          "a"),
-    TEST ("a",         ""),
-    TEST ("",          "\0"),
-    TEST ("\0",        ""),
-
-    TEST ("a",         "b"),
-    TEST ("a",         "bc"),
-    TEST ("ab",        "c"),
-
-    TEST ("a\0b\0\0c", "\0b\0\0c"),
-    TEST ("\0b\0\0c",  "a\0b\0\0c"),
-
-    TEST ("a\0b\0\0c", "\0\0"),
-    TEST ("\0\0",      "a\0b\0\0c"),
-
-    TEST ("x@4096",    ""),
-    TEST ("",          "x@4096"),
-    TEST ("x@4096",    "\0\0\0"),
-    TEST ("\0\0\0",    "x@4096"),
-    TEST ("x@4096",    "x@4096"),
-
-    TEST ("",          "x@128"),
-    TEST ("x@207",     "x@128"),
-    TEST ("x@128",     "x@334"),
-    TEST ("x@873",     "x@334"),
-    TEST ("x@1412",    "x@540"),
-    TEST ("x@540",     "x@2284"),
-    TEST ("x@3695",    "x@2284"),
-    TEST ("x@3695",    "x@128"),
-
-    TEST ("",          0),
-    TEST ("\0",        0),
-    TEST ("abc",       0),
-    TEST ("a\0b\0\0c", 0),
-    TEST ("x@4096",    0),
-
-    TEST (0,           ""),
-    TEST (0,           "\0"),       
-    TEST (0,           "abc@1024"),       
-    TEST (0,           "a\0b\0\0c"), 
-    TEST (0,           "x@4096"),   
+    //    |                +-------- controlled "source" (arg) sequence
+    //    |                |
+    //    V                V
+    TEST ("",              ""),
+    TEST ("",              "a"),
+    TEST ("a",             ""),
+    TEST ("",              "<U0>"),
+    TEST ("<U0>",          ""),
+
+    TEST ("a",             "b"),
+    TEST ("a",             "bc"),
+    TEST ("ab",            "c"),
+
+    TEST ("a<U0>b<U0>@2c", "<U0>b<U0>@2c"),
+    TEST ("<U0>b<U0>@2c",  "a<U0>b<U0>@2c"),
+
+    TEST ("a<U0>b<U0>@2c", "<U0>@2"),
+    TEST ("<U0>@2",        "a<U0>b<U0>@2c"),
+
+    TEST ("x@4096",        ""),
+    TEST ("",              "x@4096"),
+    TEST ("x@4096",        "<U0>@3"),
+    TEST ("<U0>@3",        "x@4096"),
+    TEST ("x@4096",        "x@4096"),
+
+    TEST ("",              "x@128"),
+    TEST ("x@207",         "x@128"),
+    TEST ("x@128",         "x@334"),
+    TEST ("x@873",         "x@334"),
+    TEST ("x@1412",        "x@540"),
+    TEST ("x@540",         "x@2284"),
+    TEST ("x@3695",        "x@2284"),
+    TEST ("x@3695",        "x@128"),
+
+    TEST ("",              0),
+    TEST ("<U0>",          0),
+    TEST ("abc",           0),
+    TEST ("a<U0>b<U0>@2c", 0),
+    TEST ("x@4096",        0),
+
+    TEST (0,               ""),
+    TEST (0,               "<U0>"),       
+    TEST (0,               "abc@1024"),       
+    TEST (0,               "a<U0>b<U0>@2c"), 
+    TEST (0,               "x@4096"),   
  
-    TEST ("last",      "test")
+    TEST ("last",          "test")
 };
 
 
@@ -241,7 +241,7 @@
                            __LINE__, p2 - res_p1, p1 - res_p2);
 
                 std::size_t match = 
-                    rw_match (tcase.str, res_p2, tcase.str_len);
+                    rw_match (tcase.str, res_p2, res2_len);
 
                 rw_assert (match == tdata.strlen_, 0, tcase.line,
                            "line %d. %{$FUNCALL}: this == %{#*s}, got this = "
@@ -249,7 +249,7 @@
                            __LINE__, int (src_len), src, int (sizeof (charT)), 
                            int (res1_len), res_p1, match);
 
-                match = rw_match (src, res_p1, src_len);
+                match = rw_match (src, res_p1, res1_len);
 
                 rw_assert (match == srclen_, 0, tcase.line,
                            "line %d. %{$FUNCALL}: str == %{#*s}, got str = "



Mime
View raw message