stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r417904 [4/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.op.plus.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.op.plus.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.op.plus.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.op.plus.cpp Wed Jun 28 16:47:10 2006
@@ -62,51 +62,51 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- second sequence 
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info
-    //    |             |             |        |         0 - no exception
-    //    |             |             |        |
-    //    |             |             |        +---------+
-    //    V             V             V                  V   
-    TEST ("ab",         "c",          "abc",             0),
-
-    TEST ("",           "",           "",                0),
-    TEST ("",           "a",          "a",               0),
-    TEST ("a",          "",           "a",               0),
-
-    TEST ("\0",         "",           "",                0),
-    TEST ("",           "\0",         "\0",              0),
-    TEST ("\0",         "\0",         "\0",              0),
-
-    TEST ("abcdefg",    "jih",        "abcdefgjih",      0),
-    TEST ("jih",        "abcdefg",    "jihabcdefg",      0),
-
-    TEST ("\0ab\0\0c",  "e\0",        "e\0",             0),
-    TEST ("e\0",        "\0ab\0\0c",  "e\0ab\0\0c",      0),
-    TEST ("ab\0\0c\0",  "e\0",        "abe\0",           0),
-    TEST ("e\0",        "ab\0\0c\0",  "eab\0\0c\0",      0),
-
-    TEST ("x@2048",     "x@2048",     "x@4096",          0),
-    TEST ("a@2048",     "b@2048",     "a@2048b@2048",    0),
-    TEST ("a@2048\0",   "b@2048",     "a@2048b@2048",    0),
-    TEST ("a@2048",     "b@2048\0",   "a@2048b@2048\0",  0),
-
-    TEST ("x@10",       "x@118",      "x@128",           0),
-    TEST ("x@128",      "x@79",       "x@207",           0),
-    TEST ("x@207",      "x@127",      "x@334",           0),
-    TEST ("x@334",      "x@206",      "x@540",           0),
-    TEST ("x@540",      "x@333",      "x@873",           0),
-    TEST ("x@539",      "x@873",      "x@1412",          0),
-    TEST ("x@872",      "x@1412",     "x@2284",          0),
-    TEST ("x@1411",     "x@2284",     "x@3695",          0),
-    TEST ("x@1412",     "x@2284",     "x@3696",          0),
-
-    TEST (0,            "abc",        "abcabc",          0),
-    TEST (0,            "\0ab\0",     "\0ab\0",          0),
-    TEST (0,            "x@2048",     "x@4096",          0),
+    //    |                +------------------------ second sequence 
+    //    |                |                +------- expected result sequence
+    //    |                |                |        +- exception info
+    //    |                |                |        |     0 - no exception
+    //    |                |                |        |
+    //    |                |                |        +---------+
+    //    V                V                V                  V   
+    TEST ("ab",            "c",             "abc",              0),
+
+    TEST ("",              "",              "",                 0),
+    TEST ("",              "a",             "a",                0),
+    TEST ("a",             "",              "a",                0),
+
+    TEST ("<U0>",          "",              "",                 0),
+    TEST ("",              "<U0>",          "<U0>",             0),
+    TEST ("<U0>",          "<U0>",          "<U0>",             0),
+
+    TEST ("abcdefg",       "jih",           "abcdefgjih",       0),
+    TEST ("jih",           "abcdefg",       "jihabcdefg",       0),
+
+    TEST ("<U0>ab<U0>@2c", "e<U0>",         "e<U0>",            0),
+    TEST ("e<U0>",         "<U0>ab<U0>@2c", "e<U0>ab<U0>@2c",   0),
+    TEST ("ab<U0>@2c<U0>", "e<U0>",         "abe<U0>",          0),
+    TEST ("e<U0>",         "ab<U0>@2c<U0>", "eab<U0>@2c<U0>",   0),
+
+    TEST ("x@2048",        "x@2048",        "x@4096",           0),
+    TEST ("a@2048",        "b@2048",        "a@2048b@2048",     0),
+    TEST ("a@2048<U0>",    "b@2048",        "a@2048b@2048",     0),
+    TEST ("a@2048",        "b@2048<U0>",    "a@2048b@2048<U0>", 0),
+
+    TEST ("x@10",          "x@118",         "x@128",            0),
+    TEST ("x@128",         "x@79",          "x@207",            0),
+    TEST ("x@207",         "x@127",         "x@334",            0),
+    TEST ("x@334",         "x@206",         "x@540",            0),
+    TEST ("x@540",         "x@333",         "x@873",            0),
+    TEST ("x@539",         "x@873",         "x@1412",           0),
+    TEST ("x@872",         "x@1412",        "x@2284",           0),
+    TEST ("x@1411",        "x@2284",        "x@3695",           0),
+    TEST ("x@1412",        "x@2284",        "x@3696",           0),
+
+    TEST (0,               "abc",           "abcabc",           0),
+    TEST (0,               "<U0>ab<U0>",    "<U0>ab<U0>",       0),
+    TEST (0,               "x@2048",        "x@4096",           0),
 
-    TEST ("last",       "test",       "lasttest",        0)
+    TEST ("last",          "test",          "lasttest",         0)
 };
 
 
@@ -125,55 +125,55 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- second sequence 
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info
-    //    |             |             |        |         0 - no exception
-    //    |             |             |        |
-    //    |             |             |        +---------+
-    //    V             V             V                  V   
-    TEST ("ab",         "c",          "abc",             0),
-
-    TEST ("",           "",           "",                0),
-    TEST ("",           "a",          "a",               0),
-    TEST ("a",          "",           "a",               0),
-
-    TEST ("\0",         "",           "\0",              0),
-    TEST ("",           "\0",         "\0",              0),
-    TEST ("\0",         "\0",         "\0\0",            0),
-
-    TEST ("abcdefg",    "jih",        "abcdefgjih",      0),
-    TEST ("jih",        "abcdefg",    "jihabcdefg",      0),
-
-    TEST ("\0ab\0\0c",  "e\0",        "\0ab\0\0ce\0",    0),
-    TEST ("e\0",        "\0ab\0\0c",  "e\0\0ab\0\0c",    0),
-    TEST ("ab\0\0c\0",  "e\0",        "ab\0\0c\0e\0",    0),
-    TEST ("e\0",        "ab\0\0c\0",  "e\0ab\0\0c\0",    0),
-
-    TEST ("x@2048",     "x@2048",     "x@4096",          0),
-    TEST ("a@2048",     "b@2048",     "a@2048b@2048",    0),
-    TEST ("a@2048\0",   "b@2048",     "a@2048\0b@2048",  0),
-    TEST ("a@2048",     "b@2048\0",   "a@2048b@2048\0",  0),
-
-    TEST ("x@10",       "x@118",      "x@128",           0),
-    TEST ("x@128",      "x@79",       "x@207",           0),
-    TEST ("x@207",      "x@127",      "x@334",           0),
-    TEST ("x@334",      "x@206",      "x@540",           0),
-    TEST ("x@540",      "x@333",      "x@873",           0),
-    TEST ("x@539",      "x@873",      "x@1412",          0),
-    TEST ("x@872",      "x@1412",     "x@2284",          0),
-    TEST ("x@1411",     "x@2284",     "x@3695",          0),
-    TEST ("x@1412",     "x@2284",     "x@3696",          0),
-
-    TEST (0,            "abc",        "abcabc",          0),
-    TEST (0,            "\0ab\0",     "\0ab\0\0ab\0",    0),
-    TEST (0,            "x@2048",     "x@4096",          0),
-
-    TEST ("abc",        0,            "abcabc",          0),
-    TEST ("\0ab\0",     0,            "\0ab\0\0ab\0",    0),
-    TEST ("x@2048",     0,            "x@4096",          0),
+    //    |                +------------------------ second sequence 
+    //    |                |             +---------- expected result sequence
+    //    |                |             |        +- exception info
+    //    |                |             |        |      0 - no exception
+    //    |                |             |        |
+    //    |                |             |        +-------------+
+    //    V                V             V                      V   
+    TEST ("ab",            "c",          "abc",                 0),
+
+    TEST ("",              "",           "",                    0),
+    TEST ("",              "a",          "a",                   0),
+    TEST ("a",             "",           "a",                   0),
+
+    TEST ("<U0>",          "",           "<U0>",                0),
+    TEST ("",              "<U0>",       "<U0>",                0),
+    TEST ("<U0>",          "<U0>",       "<U0>@2",              0),
+
+    TEST ("abcdefg",       "jih",        "abcdefgjih",          0),
+    TEST ("jih",           "abcdefg",    "jihabcdefg",          0),
+
+    TEST ("<U0>ab<U0>@2c", "e<U0>",         "<U0>ab<U0>@2ce<U0>",  0),
+    TEST ("e<U0>",         "<U0>ab<U0>@2c", "e<U0>@2ab<U0>@2c",    0),
+    TEST ("ab<U0>@2c<U0>", "e<U0>",         "ab<U0>@2c<U0>e<U0>",  0),
+    TEST ("e<U0>",         "ab<U0>@2c<U0>", "e<U0>ab<U0>@2c<U0>",  0),
+
+    TEST ("x@2048",        "x@2048",     "x@4096",              0),
+    TEST ("a@2048",        "b@2048",     "a@2048b@2048",        0),
+    TEST ("a@2048<U0>",    "b@2048",     "a@2048<U0>b@2048",    0),
+    TEST ("a@2048",        "b@2048<U0>", "a@2048b@2048<U0>",    0),
+
+    TEST ("x@10",          "x@118",      "x@128",               0),
+    TEST ("x@128",         "x@79",       "x@207",               0),
+    TEST ("x@207",         "x@127",      "x@334",               0),
+    TEST ("x@334",         "x@206",      "x@540",               0),
+    TEST ("x@540",         "x@333",      "x@873",               0),
+    TEST ("x@539",         "x@873",      "x@1412",              0),
+    TEST ("x@872",         "x@1412",     "x@2284",              0),
+    TEST ("x@1411",        "x@2284",     "x@3695",              0),
+    TEST ("x@1412",        "x@2284",     "x@3696",              0),
+
+    TEST (0,               "abc",        "abcabc",              0),
+    TEST (0,               "<U0>ab<U0>", "<U0>ab<U0>@2ab<U0>",  0),
+    TEST (0,               "x@2048",     "x@4096",              0),
+
+    TEST ("abc",           0,            "abcabc",              0),
+    TEST ("<U0>ab<U0>",    0,            "<U0>ab<U0>@2ab<U0>",  0),
+    TEST ("x@2048",        0,            "x@4096",              0),
 
-    TEST ("last",       "test",       "lasttest",        0)
+    TEST ("last",          "test",       "lasttest",            0)
 };
 
 /**************************************************************************/
@@ -191,51 +191,51 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- second sequence 
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info
-    //    |             |             |        |         0 - no exception
-    //    |             |             |        |
-    //    |             |             |        +---------+
-    //    V             V             V                  V   
-    TEST ("ab",         "c",          "abc",             0),
-
-    TEST ("",           "",           "",                0),
-    TEST ("",           "a",          "a",               0),
-    TEST ("a",          "",           "a",               0),
-
-    TEST ("\0",         "",           "\0",              0),
-    TEST ("",           "\0",         "",                0),
-    TEST ("\0",         "\0",         "\0",              0),
-
-    TEST ("abcdefg",    "jih",        "abcdefgjih",      0),
-    TEST ("jih",        "abcdefg",    "jihabcdefg",      0),
-
-    TEST ("\0ab\0\0c",  "e\0",        "\0ab\0\0ce",      0),
-    TEST ("e\0",        "\0ab\0\0c",  "e\0",             0),
-    TEST ("ab\0\0c\0",  "e\0",        "ab\0\0c\0e",      0),
-    TEST ("e\0",        "ab\0\0c\0",  "e\0ab",           0),
-
-    TEST ("x@2048",     "x@2048",     "x@4096",          0),
-    TEST ("a@2048",     "b@2048",     "a@2048b@2048",    0),
-    TEST ("a@2048\0",   "b@2048",     "a@2048\0b@2048",  0),
-    TEST ("a@2048",     "b@2048\0",   "a@2048b@2048",    0),
-
-    TEST ("x@10",       "x@118",      "x@128",           0),
-    TEST ("x@128",      "x@79",       "x@207",           0),
-    TEST ("x@207",      "x@127",      "x@334",           0),
-    TEST ("x@334",      "x@206",      "x@540",           0),
-    TEST ("x@540",      "x@333",      "x@873",           0),
-    TEST ("x@539",      "x@873",      "x@1412",          0),
-    TEST ("x@872",      "x@1412",     "x@2284",          0),
-    TEST ("x@1411",     "x@2284",     "x@3695",          0),
-    TEST ("x@1412",     "x@2284",     "x@3696",          0),
-
-    TEST ("abc",        0,            "abcabc",          0),
-    TEST ("\0ab\0",     0,            "\0ab\0",          0),
-    TEST ("x@2048",     0,            "x@4096",          0),
+    //    |                +------------------------ second sequence 
+    //    |                |             +---------- expected result sequence
+    //    |                |             |        +- exception info
+    //    |                |             |        |     0 - no exception
+    //    |                |             |        |
+    //    |                |             |        +----------+
+    //    V                V             V                   V   
+    TEST ("ab",            "c",          "abc",              0),
+
+    TEST ("",              "",           "",                 0),
+    TEST ("",              "a",          "a",                0),
+    TEST ("a",             "",           "a",                0),
+
+    TEST ("<U0>",          "",           "<U0>",             0),
+    TEST ("",              "<U0>",       "",                 0),
+    TEST ("<U0>",          "<U0>",       "<U0>",             0),
+
+    TEST ("abcdefg",       "jih",        "abcdefgjih",       0),
+    TEST ("jih",           "abcdefg",    "jihabcdefg",       0),
+
+    TEST ("<U0>ab<U0>@2c", "e<U0>",          "<U0>ab<U0>@2ce",    0),
+    TEST ("e<U0>",         "<U0>ab<U0>@2c",  "e<U0>",             0),
+    TEST ("ab<U0>@2c<U0>", "e<U0>",          "ab<U0>@2c<U0>e",    0),
+    TEST ("e<U0>",         "ab<U0>@2c<U0>",  "e<U0>ab",           0),
+
+    TEST ("x@2048",        "x@2048",     "x@4096",           0),
+    TEST ("a@2048",        "b@2048",     "a@2048b@2048",     0),
+    TEST ("a@2048<U0>",    "b@2048",     "a@2048<U0>b@2048", 0),
+    TEST ("a@2048",        "b@2048<U0>", "a@2048b@2048",     0),
+
+    TEST ("x@10",          "x@118",      "x@128",            0),
+    TEST ("x@128",         "x@79",       "x@207",            0),
+    TEST ("x@207",         "x@127",      "x@334",            0),
+    TEST ("x@334",         "x@206",      "x@540",            0),
+    TEST ("x@540",         "x@333",      "x@873",            0),
+    TEST ("x@539",         "x@873",      "x@1412",           0),
+    TEST ("x@872",         "x@1412",     "x@2284",           0),
+    TEST ("x@1411",        "x@2284",     "x@3695",           0),
+    TEST ("x@1412",        "x@2284",     "x@3696",           0),
+
+    TEST ("abc",           0,            "abcabc",           0),
+    TEST ("<U0>ab<U0>",    0,            "<U0>ab<U0>",       0),
+    TEST ("x@2048",        0,            "x@4096",           0),
 
-    TEST ("last",       "test",       "lasttest",        0)
+    TEST ("last",          "test",       "lasttest",         0)
 };
 
 /**************************************************************************/
@@ -253,39 +253,39 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- character to be added 
-    //    |             |             +------------- expected result sequence
-    //    |             |             |       
-    //    |             |             |       
-    //    V             V             V                     
-    TEST ("ab",         'c',          "abc"),
-
-    TEST ("",           'a',          "a"),
-    TEST ("",           '\0',         "\0"),
-
-    TEST ("\0",         'a',          "\0a"),
-    TEST ("\0",         '\0',         "\0\0"),
-
-    TEST ("\0ab\0\0c",  'e',          "\0ab\0\0ce"),
-    TEST ("\0ab\0\0c",  '\0',         "\0ab\0\0c\0"),
-    TEST ("ab\0\0c\0",  'e',          "ab\0\0c\0e"),
-    TEST ("ab\0\0c\0",  '\0',         "ab\0\0c\0\0"),
-
-    TEST ("abcdefghj",  'i',          "abcdefghji"),
-
-    TEST ("x@4095",     'x',          "x@4096"),
-    TEST ("x@4095",     '\0',         "x@4095\0"),
-
-    TEST ("x@127",      'x',          "x@128"),
-    TEST ("x@206",      'x',          "x@207"),
-    TEST ("x@333",      'x',          "x@334"),
-    TEST ("x@539",      'x',          "x@540"),
-    TEST ("x@1411",     'x',          "x@1412"),
-    TEST ("x@2283",     'x',          "x@2284"),
-    TEST ("x@3694",     'x',          "x@3695"),
-    TEST ("x@540",      'x',          "x@541"),
+    //    |                 +----------------------- character to be added 
+    //    |                 |             +--------- expected result sequence
+    //    |                 |             |       
+    //    |                 |             |       
+    //    V                 V             V                     
+    TEST ("ab",             'c',          "abc"),
+
+    TEST ("",               'a',          "a"),
+    TEST ("",               '\0',         "<U0>"),
+
+    TEST ("<U0>",           'a',          "<U0>a"),
+    TEST ("<U0>",           '\0',         "<U0>@2"),
+
+    TEST ("<U0>ab<U0>@2c",  'e',          "<U0>ab<U0>@2ce"),
+    TEST ("<U0>ab<U0>@2c",  '\0',         "<U0>ab<U0>@2c<U0>"),
+    TEST ("ab<U0>@2c<U0>",  'e',          "ab<U0>@2c<U0>e"),
+    TEST ("ab<U0>@2c<U0>",  '\0',         "ab<U0>@2c<U0>@2"),
+
+    TEST ("abcdefghj",      'i',          "abcdefghji"),
+
+    TEST ("x@4095",         'x',          "x@4096"),
+    TEST ("x@4095",         '\0',         "x@4095<U0>"),
+
+    TEST ("x@127",          'x',          "x@128"),
+    TEST ("x@206",          'x',          "x@207"),
+    TEST ("x@333",          'x',          "x@334"),
+    TEST ("x@539",          'x',          "x@540"),
+    TEST ("x@1411",         'x',          "x@1412"),
+    TEST ("x@2283",         'x',          "x@2284"),
+    TEST ("x@3694",         'x',          "x@3695"),
+    TEST ("x@540",          'x',          "x@541"),
 
-    TEST ("last",       't',          "lastt")
+    TEST ("last",           't',          "lastt")
 };
 
 /**************************************************************************/
@@ -304,38 +304,38 @@
 
     //    +----------------------------------------- first sequence
     //    |             +--------------------------- character to be added 
-    //    |             |             +------------- expected result sequence
-    //    |             |             |       
-    //    |             |             |       
-    //    V             V             V                     
-    TEST ('c',          "ab",         "cab"),
-
-    TEST ('a',          "",           "a"),
-    TEST ('\0',         "",           "\0"),
-
-    TEST ('a',          "\0",         "a\0"),
-    TEST ('\0',         "\0",         "\0\0"),
-
-    TEST ('e',          "\0ab\0\0c",  "e\0ab\0\0c"),
-    TEST ('\0',         "\0ab\0\0c",  "\0\0ab\0\0c"),
-    TEST ('e',          "ab\0\0c\0",  "eab\0\0c\0"),
-    TEST ('\0',         "ab\0\0c\0",  "\0ab\0\0c\0"),
-
-    TEST ('i',          "abcdefghj",  "iabcdefghj"),
-
-    TEST ('x',          "x@4095",     "x@4096"),
-    TEST ('\0',         "x@4095",     "\0x@4095"),
-
-    TEST ('x',          "x@127",      "x@128"),
-    TEST ('x',          "x@206",      "x@207"),
-    TEST ('x',          "x@333",      "x@334"),
-    TEST ('x',          "x@539",      "x@540"),
-    TEST ('x',          "x@1411",     "x@1412"),
-    TEST ('x',          "x@2283",     "x@2284"),
-    TEST ('x',          "x@3694",     "x@3695"),
-    TEST ('x',          "x@540",      "x@541"),
+    //    |             |                 +--------- expected result sequence
+    //    |             |                 |       
+    //    |             |                 |       
+    //    V             V                 V                     
+    TEST ('c',          "ab",             "cab"),
+
+    TEST ('a',          "",               "a"),
+    TEST ('\0',         "",               "<U0>"),
+
+    TEST ('a',          "<U0>",           "a<U0>"),
+    TEST ('\0',         "<U0>",           "<U0>@2"),
+
+    TEST ('e',          "<U0>ab<U0>@2c",  "e<U0>ab<U0>@2c"),
+    TEST ('\0',         "<U0>ab<U0>@2c",  "<U0>@2ab<U0>@2c"),
+    TEST ('e',          "ab<U0>@2c<U0>",  "eab<U0>@2c<U0>"),
+    TEST ('\0',         "ab<U0>@2c<U0>",  "<U0>ab<U0>@2c<U0>"),
+
+    TEST ('i',          "abcdefghj",      "iabcdefghj"),
+
+    TEST ('x',          "x@4095",         "x@4096"),
+    TEST ('\0',         "x@4095",         "<U0>x@4095"),
+
+    TEST ('x',          "x@127",          "x@128"),
+    TEST ('x',          "x@206",          "x@207"),
+    TEST ('x',          "x@333",          "x@334"),
+    TEST ('x',          "x@539",          "x@540"),
+    TEST ('x',          "x@1411",         "x@1412"),
+    TEST ('x',          "x@2283",         "x@2284"),
+    TEST ('x',          "x@3694",         "x@3695"),
+    TEST ('x',          "x@540",          "x@541"),
 
-    TEST ('t',          "last",       "tlast")
+    TEST ('t',          "last",           "tlast")
 };
 
 /**************************************************************************/
@@ -484,7 +484,7 @@
                 // (and only then), also verify that the modified
                 // 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.op.plus.equal.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.op.plus.equal.cpp Wed Jun 28 16:47:10 2006
@@ -60,59 +60,59 @@
       sizeof src - 1, res, sizeof res - 1, bthrow }
 
     //    +----------------------------------------- controlled sequence
-    //    |             +--------------------------- sequence to be appended
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info
-    //    |             |             |        |         0 - no exception
-    //    |             |             |        |         1 - length_error
-    //    |             |             |        |
-    //    |             |             |        +--------------+
-    //    V             V             V                       V
-    TEST ("ab",         "c",          "abc",                  0),
-
-    TEST ("",           "",           "",                     0),
-    TEST ("",           "\0",         "",                     0),
-    TEST ("",           "abc",        "abc",                  0),
-
-    TEST ("\0",         "",           "\0",                   0),
-    TEST ("\0",         "a",          "\0a",                  0),
-    TEST ("\0",         "\0\0",       "\0",                   0),
-
-    TEST ("ab",         "cd",         "abcd",                 0),
-    TEST ("bcd",        "a",          "bcda",                 0),
-    TEST ("cde",        "ab",         "cdeab",                0),
-    TEST ("abc",        "",           "abc",                  0),
-    TEST ("ab",         "c\0e",       "abc",                  0),
-
-    TEST ("\0\0ab",     "cdefghij",   "\0\0abcdefghij",       0),
-    TEST ("a\0\0b",     "cdefghij",   "a\0\0bcdefghij",       0),
-    TEST ("ab\0\0",     "cdefghij",   "ab\0\0cdefghij",       0),
-    TEST ("a\0b\0\0c",  "e\0",        "a\0b\0\0ce",           0),
-    TEST ("\0ab\0\0c",  "e\0",        "\0ab\0\0ce",           0),
-    TEST ("abcdefghij", "abcdefghij", "abcdefghijabcdefghij", 0),
-
-    TEST ("",           "x@4096",     "x@4096",               0),
-    TEST ("x@4096",     "",           "x@4096",               0),
-    TEST ("x@2048",     "y@2048",     "x@2048y@2048",         0),
-
-    TEST ("x@10",       "x@118",      "x@128",                0),
-    TEST ("x@128",      "x@79",       "x@207",                0),
-    TEST ("x@207",      "x@127",      "x@334",                0),
-    TEST ("x@334",      "x@206",      "x@540",                0),
-    TEST ("x@540",      "x@333",      "x@873",                0),
-    TEST ("x@539",      "x@873",      "x@1412",               0),
-    TEST ("x@872",      "x@1412",     "x@2284",               0),
-    TEST ("x@1411",     "x@2284",     "x@3695",               0),
-    TEST ("x@1412",     "x@2284",     "x@3696",               0),
-
-    TEST ("",           0,            "",                     0),
-    TEST ("abc",        0,            "abcabc",               0),
-    TEST ("a\0\0bc",    0,            "a\0\0bca",             0),
-    TEST ("\0\0abc",    0,            "\0\0abc",              0),
-    TEST ("abc\0\0",    0,            "abc\0\0abc",           0),
-    TEST ("x@2048",     0,            "x@4096",               0),
+    //    |                 +----------------------- sequence to be appended
+    //    |                 |             +--------- expected result sequence
+    //    |                 |             |        +---- exception info
+    //    |                 |             |        |         0 - no exception
+    //    |                 |             |        |         1 - length_error
+    //    |                 |             |        |
+    //    |                 |             |        +--------------+
+    //    V                 V             V                       V
+    TEST ("ab",             "c",          "abc",                  0),
+
+    TEST ("",               "",           "",                     0),
+    TEST ("",               "<U0>",       "",                     0),
+    TEST ("",               "abc",        "abc",                  0),
+
+    TEST ("<U0>",           "",           "<U0>",                 0),
+    TEST ("<U0>",           "a",          "<U0>a",                0),
+    TEST ("<U0>",           "<U0>@2",     "<U0>",                 0),
+
+    TEST ("ab",             "cd",         "abcd",                 0),
+    TEST ("bcd",            "a",          "bcda",                 0),
+    TEST ("cde",            "ab",         "cdeab",                0),
+    TEST ("abc",            "",           "abc",                  0),
+    TEST ("ab",             "c<U0>e",     "abc",                  0),
+
+    TEST ("<U0>@2ab",       "cdefghij",   "<U0>@2abcdefghij",     0),
+    TEST ("a<U0>@2b",       "cdefghij",   "a<U0>@2bcdefghij",     0),
+    TEST ("ab<U0>@2",       "cdefghij",   "ab<U0>@2cdefghij",     0),
+    TEST ("a<U0>b<U0>@2c",  "e<U0>",      "a<U0>b<U0>@2ce",       0),
+    TEST ("<U0>ab<U0>@2c",  "e<U0>",      "<U0>ab<U0>@2ce",       0),
+    TEST ("abcdefghij",     "abcdefghij", "abcdefghijabcdefghij", 0),
+
+    TEST ("",               "x@4096",     "x@4096",               0),
+    TEST ("x@4096",         "",           "x@4096",               0),
+    TEST ("x@2048",         "y@2048",     "x@2048y@2048",         0),
+
+    TEST ("x@10",           "x@118",      "x@128",                0),
+    TEST ("x@128",          "x@79",       "x@207",                0),
+    TEST ("x@207",          "x@127",      "x@334",                0),
+    TEST ("x@334",          "x@206",      "x@540",                0),
+    TEST ("x@540",          "x@333",      "x@873",                0),
+    TEST ("x@539",          "x@873",      "x@1412",               0),
+    TEST ("x@872",          "x@1412",     "x@2284",               0),
+    TEST ("x@1411",         "x@2284",     "x@3695",               0),
+    TEST ("x@1412",         "x@2284",     "x@3696",               0),
+
+    TEST ("",               0,            "",                     0),
+    TEST ("abc",            0,            "abcabc",               0),
+    TEST ("a<U0>@2bc",      0,            "a<U0>@2bca",           0),
+    TEST ("<U0>@2abc",      0,            "<U0>@2abc",            0),
+    TEST ("abc<U0>@2",      0,            "abc<U0>@2abc",         0),
+    TEST ("x@2048",         0,            "x@4096",               0),
 
-    TEST ("last",       "test",       "lasttest",             0)
+    TEST ("last",           "test",       "lasttest",             0)
 };
 
 /**************************************************************************/
@@ -128,60 +128,60 @@
       sizeof src - 1, res, sizeof res - 1, bthrow }
 
     //    +----------------------------------------- controlled sequence
-    //    |             +------------------------- sequence to be appended
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info
-    //    |             |             |        |         0 - no exception
-    //    |             |             |        |         1 - length_error
-    //    |             |             |        |
-    //    |             |             |        +--------------+
-    //    V             V             V                       V
-    TEST ("ab",         "c",          "abc",                  0),
-
-    TEST ("",           "",           "",                     0),
-    TEST ("",           "\0",         "\0",                   0),
-    TEST ("",           "abc",        "abc",                  0),
-
-    TEST ("\0",         "",           "\0",                   0),
-    TEST ("\0",         "a",          "\0a",                  0),
-    TEST ("\0",         "\0\0",       "\0\0\0",               0),
-
-    TEST ("ab",         "cd",         "abcd",                 0),
-    TEST ("bcd",        "a",          "bcda",                 0),
-    TEST ("cde",        "ab",         "cdeab",                0),
-    TEST ("abc",        "",           "abc",                  0),
-    TEST ("ab",         "c\0e",       "abc\0e",               0),
-
-    TEST ("\0\0ab",     "cdefghij",   "\0\0abcdefghij",       0),
-    TEST ("a\0\0b",     "cdefghij",   "a\0\0bcdefghij",       0),
-    TEST ("ab\0\0",     "cdefghij",   "ab\0\0cdefghij",       0),
-    TEST ("a\0b\0\0c",  "e\0",        "a\0b\0\0ce\0",         0),
-    TEST ("\0ab\0\0c",  "e\0",        "\0ab\0\0ce\0",         0),
-    TEST ("ab\0\0c\0",  "\0e",        "ab\0\0c\0\0e",         0),
-    TEST ("abcdefghij", "abcdefghij", "abcdefghijabcdefghij", 0),
-
-    TEST ("",           "x@4096",     "x@4096",               0),
-    TEST ("x@4096",     "",           "x@4096",               0),
-    TEST ("x@2048",     "y@2048",     "x@2048y@2048",         0),
-
-    TEST ("x@10",       "x@118",      "x@128",                0),
-    TEST ("x@128",      "x@79",       "x@207",                0),
-    TEST ("x@207",      "x@127",      "x@334",                0),
-    TEST ("x@334",      "x@206",      "x@540",                0),
-    TEST ("x@540",      "x@333",      "x@873",                0),
-    TEST ("x@539",      "x@873",      "x@1412",               0),
-    TEST ("x@872",      "x@1412",     "x@2284",               0),
-    TEST ("x@1411",     "x@2284",     "x@3695",               0),
-    TEST ("x@1412",     "x@2284",     "x@3696",               0),
-
-    TEST ("",           0,            "",                     0),
-    TEST ("abc",        0,            "abcabc",               0),
-    TEST ("a\0\0bc",    0,            "a\0\0bca\0\0bc",       0),
-    TEST ("\0\0abc",    0,            "\0\0abc\0\0abc",       0),
-    TEST ("abc\0\0",    0,            "abc\0\0abc\0\0",       0),
-    TEST ("x@2048",     0,            "x@4096",               0),
+    //    |                 +----------------------- sequence to be appended
+    //    |                 |             +--------- expected result sequence
+    //    |                 |             |        +---- exception info
+    //    |                 |             |        |         0 - no exception
+    //    |                 |             |        |         1 - length_error
+    //    |                 |             |        |
+    //    |                 |             |        +--------------+
+    //    V                 V             V                       V
+    TEST ("ab",             "c",          "abc",                  0),
+
+    TEST ("",               "",           "",                     0),
+    TEST ("",               "<U0>",       "<U0>",                 0),
+    TEST ("",               "abc",        "abc",                  0),
+
+    TEST ("<U0>",           "",           "<U0>",                 0),
+    TEST ("<U0>",           "a",          "<U0>a",                0),
+    TEST ("<U0>",           "<U0>@2",     "<U0>@3",               0),
+
+    TEST ("ab",             "cd",         "abcd",                 0),
+    TEST ("bcd",            "a",          "bcda",                 0),
+    TEST ("cde",            "ab",         "cdeab",                0),
+    TEST ("abc",            "",           "abc",                  0),
+    TEST ("ab",             "c<U0>e",     "abc<U0>e",             0),
+
+    TEST ("<U0>@2ab",       "cdefghij",   "<U0>@2abcdefghij",     0),
+    TEST ("a<U0>@2b",       "cdefghij",   "a<U0>@2bcdefghij",     0),
+    TEST ("ab<U0>@2",       "cdefghij",   "ab<U0>@2cdefghij",     0),
+    TEST ("a<U0>b<U0>@2c",  "e<U0>",      "a<U0>b<U0>@2ce<U0>",   0),
+    TEST ("<U0>ab<U0>@2c",  "e<U0>",      "<U0>ab<U0>@2ce<U0>",   0),
+    TEST ("ab<U0>@2c<U0>",  "<U0>e",      "ab<U0>@2c<U0>@2e",     0),
+    TEST ("abcdefghij",     "abcdefghij", "abcdefghijabcdefghij", 0),
+
+    TEST ("",               "x@4096",     "x@4096",               0),
+    TEST ("x@4096",         "",           "x@4096",               0),
+    TEST ("x@2048",         "y@2048",     "x@2048y@2048",         0),
+
+    TEST ("x@10",           "x@118",      "x@128",                0),
+    TEST ("x@128",          "x@79",       "x@207",                0),
+    TEST ("x@207",          "x@127",      "x@334",                0),
+    TEST ("x@334",          "x@206",      "x@540",                0),
+    TEST ("x@540",          "x@333",      "x@873",                0),
+    TEST ("x@539",          "x@873",      "x@1412",               0),
+    TEST ("x@872",          "x@1412",     "x@2284",               0),
+    TEST ("x@1411",         "x@2284",     "x@3695",               0),
+    TEST ("x@1412",         "x@2284",     "x@3696",               0),
+
+    TEST ("",               0,            "",                     0),
+    TEST ("abc",            0,            "abcabc",               0),
+    TEST ("a<U0>@2bc",      0,            "a<U0>@2bca<U0>@2bc",   0),
+    TEST ("<U0>@2abc",      0,            "<U0>@2abc<U0>@2abc",   0),
+    TEST ("abc<U0>@2",      0,            "abc<U0>@2abc<U0>@2",   0),
+    TEST ("x@2048",         0,            "x@4096",               0),
 
-    TEST ("last",       "test",       "lasttest",             0)
+    TEST ("last",           "test",       "lasttest",             0)
 };
 
 /**************************************************************************/
@@ -197,39 +197,39 @@
       res, sizeof res - 1, bthrow }
 
     //    +---------------------------------- controlled sequence
-    //    |            +--------------------- character to be appended
-    //    |            |   +----------------- expected result sequence
-    //    |            |   |           +----- exception info
-    //    |            |   |           |        0 - no exception
-    //    |            |   |           |        1 - length_error
-    //    |            |   |           |
-    //    |            |   |           +----+
-    //    V            V   V                V
-    TEST ("ab",        'c', "abc",          0),
-
-    TEST ("",          'a',  "a",           0),
-    TEST ("",          '\0', "\0",          0),
-
-    TEST ("\0",        'a',  "\0a",         0),
-    TEST ("\0",        '\0', "\0\0",        0),
-
-    TEST ("cde",       'a',  "cdea",        0),
-    TEST ("abc",       '\0', "abc\0",       0),
-
-    TEST ("a\0b\0\0c", '\0', "a\0b\0\0c\0", 0),
-    TEST ("\0ab\0\0c", '\0', "\0ab\0\0c\0", 0),
-    TEST ("a\0bc\0\0", 'a',  "a\0bc\0\0a",  0),
-
-    TEST ("x@127",     'x',  "x@128",       0),
-    TEST ("x@206",     'x',  "x@207",       0),
-    TEST ("x@333",     'x',  "x@334",       0),
-    TEST ("x@539",     'x',  "x@540",       0),
-    TEST ("x@1411",    'x',  "x@1412",      0),
-    TEST ("x@2283",    'x',  "x@2284",      0),
-    TEST ("x@3694",    'x',  "x@3695",      0),
-    TEST ("x@540",     'x',  "x@541",       0),
+    //    |                +----------------- character to be appended
+    //    |                |   +------------- expected result sequence
+    //    |                |   |           +- exception info
+    //    |                |   |           |      0 - no exception
+    //    |                |   |           |       1 - length_error
+    //    |                |   |           |
+    //    |                |   |           +----+
+    //    V                V   V                V
+    TEST ("ab",            'c', "abc",          0),
+
+    TEST ("",              'a',  "a",           0),
+    TEST ("",              '\0', "<U0>",        0),
+
+    TEST ("<U0>",          'a',  "<U0>a",       0),
+    TEST ("<U0>",          '\0', "<U0>@2",      0),
+
+    TEST ("cde",           'a',  "cdea",        0),
+    TEST ("abc",           '\0', "abc<U0>",     0),
+
+    TEST ("a<U0>b<U0>@2c", '\0', "a<U0>b<U0>@2c<U0>", 0),
+    TEST ("<U0>ab<U0>@2c", '\0', "<U0>ab<U0>@2c<U0>", 0),
+    TEST ("a<U0>bc<U0>@2", 'a',  "a<U0>bc<U0>@2a",    0),
+
+    TEST ("x@127",         'x',  "x@128",       0),
+    TEST ("x@206",         'x',  "x@207",       0),
+    TEST ("x@333",         'x',  "x@334",       0),
+    TEST ("x@539",         'x',  "x@540",       0),
+    TEST ("x@1411",        'x',  "x@1412",      0),
+    TEST ("x@2283",        'x',  "x@2284",      0),
+    TEST ("x@3694",        'x',  "x@3695",      0),
+    TEST ("x@540",         'x',  "x@541",       0),
 
-    TEST ("last",      't',  "lastt",       0)
+    TEST ("last",          't',  "lastt",       0)
 };
 
 /**************************************************************************/
@@ -381,7 +381,7 @@
                 // (and only then), also verify that the modified
                 // string matches the expected result
                 const std::size_t match =
-                    rw_match (tcase.res, str.c_str(), tcase.nres);
+                    rw_match (tcase.res, str.c_str(), str.size ());
 
                 rw_assert (match == res_len, 0, tcase.line,
                            "line %d. %{$FUNCALL} expected %{#*s}, "

Modified: incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.operators.cpp Wed Jun 28 16:47:10 2006
@@ -72,55 +72,55 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- second sequence 
-    //    |             |              +------------ expected result 
-    //    |             |              |               -1 - first is less
-    //    |             |              |                0 - equal
-    //    |             |              |                1 - first is greater
-    //    |             |              |        
-    //    |             |              |        
-    //    V             V              V          
-    TEST ("ab",         "c",          -1),
-
-    TEST ("",           "",            0),
-    TEST ("",           "a",          -1),
-    TEST ("a",          "",            1),
-    TEST ("a",          "a",           0),
-
-    TEST ("\0",         "",            0),
-    TEST ("",           "\0",         -1),
-    TEST ("\0",         "\0",         -1),
-
-    TEST ("abcdefgjih", "abcdefgji",   1),
-    TEST ("abcdefgjih", "abcdefgjih",  0),
-    TEST ("abcdefgji",  "abcdefgjih", -1),
-    TEST ("abcefgjih",  "abcdefgjih",  1),
-    TEST ("abcdefgjih", "abcefgjih",  -1),
-
-    TEST ("\0ab\0\0c",  "\0ab\0\0c",  -1),
-    TEST ("ab\0\0c\0",  "ab",          0),
-    TEST ("e\0",        "ab\0\0c\0",   1),
-
-    TEST ("x@2048",     "x@2048",      0),
-    TEST ("x@2048",     "x@2049",     -1),
-    TEST ("x@2048",     "x@2047",      1),
-    TEST ("a@2048",     "b@2048",     -1),
-    TEST ("b@2048",     "a@2048",      1),
-    TEST ("a@2048\0",   "a@2048",      0),
-    TEST ("a@2048",     "a@2048\0",   -1),
-
-    TEST ("x@128",      "x@207",      -1),
-    TEST ("x@334",      "x@334",       0),
-    TEST ("x@873",      "x@540",       1),
-    TEST ("x@1412",     "x@2284",     -1),
-    TEST ("x@3695",     "x@3695",      0),
-    TEST ("x@4096",     "x@3695",      1),
-
-    TEST (0,            "abc",         0),
-    TEST (0,            "\0ab\0",     -1),
-    TEST (0,            "x@2048",      0),
+    //    |                 +----------------------- second sequence 
+    //    |                 |                  +---- expected result 
+    //    |                 |                  |         -1 - first is less
+    //    |                 |                  |          0 - equal
+    //    |                 |                  |          1 - first is greater
+    //    |                 |                  |        
+    //    |                 |                  |        
+    //    V                 V                  V          
+    TEST ("ab",             "c",              -1),
+
+    TEST ("",               "",                0),
+    TEST ("",               "a",              -1),
+    TEST ("a",              "",                1),
+    TEST ("a",              "a",               0),
+
+    TEST ("<U0>",           "",                0),
+    TEST ("",               "<U0>",           -1),
+    TEST ("<U0>",           "<U0>",           -1),
+
+    TEST ("abcdefgjih",     "abcdefgji",       1),
+    TEST ("abcdefgjih",     "abcdefgjih",      0),
+    TEST ("abcdefgji",      "abcdefgjih",     -1),
+    TEST ("abcefgjih",      "abcdefgjih",      1),
+    TEST ("abcdefgjih",     "abcefgjih",      -1),
+
+    TEST ("<U0>ab<U0>@2c",  "<U0>ab<U0>@2c",  -1),
+    TEST ("ab<U0>@2c<U0>",  "ab",              0),
+    TEST ("e<U0>",          "ab<U0>@2c<U0>",   1),
+
+    TEST ("x@2048",         "x@2048",          0),
+    TEST ("x@2048",         "x@2049",         -1),
+    TEST ("x@2048",         "x@2047",          1),
+    TEST ("a@2048",         "b@2048",         -1),
+    TEST ("b@2048",         "a@2048",          1),
+    TEST ("a@2048<U0>",     "a@2048",          0),
+    TEST ("a@2048",         "a@2048<U0>",     -1),
+
+    TEST ("x@128",          "x@207",          -1),
+    TEST ("x@334",          "x@334",           0),
+    TEST ("x@873",          "x@540",           1),
+    TEST ("x@1412",         "x@2284",         -1),
+    TEST ("x@3695",         "x@3695",          0),
+    TEST ("x@4096",         "x@3695",          1),
+
+    TEST (0,                "abc",             0),
+    TEST (0,                "<U0>ab<U0>",     -1),
+    TEST (0,                "x@2048",          0),
 
-    TEST ("last",       "last",        0)
+    TEST ("last",           "last",            0)
 };
 
 /**************************************************************************/
@@ -143,67 +143,67 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- second sequence 
-    //    |             |              +------------ expected result 
-    //    |             |              |               -1 - first is less
-    //    |             |              |                0 - equal
-    //    |             |              |                1 - first is greater
-    //    |             |              |        
-    //    |             |              |        
-    //    V             V              V          
-    TEST ("ab",         "c",          -1),
-
-    TEST ("",           "",            0),
-    TEST ("",           "a",          -1),
-    TEST ("a",          "",            1),
-    TEST ("a",          "a",           0),
-
-    TEST ("\0",         "",            1),
-    TEST ("",           "\0",         -1),
-    TEST ("\0",         "\0",          0),
-
-    TEST ("abcdefgjih", "abcdefgji",   1),
-    TEST ("abcdefgjih", "abcdefgjih",  0),
-    TEST ("abcdefgji",  "abcdefgjih", -1),
-    TEST ("abcefgjih",  "abcdefgjih",  1),
-    TEST ("abcdefgjih", "abcefgjih",  -1),
-
-    TEST ("\0ab\0\0c",  "\0ab\0\0c",   0),
-    TEST ("ab\0\0c\0",  "\0ab\0\0c",   1),
-    TEST ("ab\0\0c\0",  "ab\0\0c\0",   0),
-    TEST ("ab\0\0c\0",  "ab",          1),
-    TEST ("ab",         "ab\0\0c\0",  -1),
-    TEST ("ab\0\0\0",   "ab\0\0c\0",  -1),
-    TEST ("ab\0\0\0",   "ab\0\0\0",    0),
-    TEST ("e\0",        "ab\0\0c\0",   1),
-    TEST ("ab\0\0c\0",  "e\0",        -1),
-
-    TEST ("x@2048",     "x@2048",      0),
-    TEST ("x@2048",     "x@2049",     -1),
-    TEST ("x@2048",     "x@2047",      1),
-    TEST ("a@2048",     "b@2048",     -1),
-    TEST ("b@2048",     "a@2048",      1),
-    TEST ("\0a@2048",   "a@2048\0",   -1),
-    TEST ("a@2048\0",   "\0a@2048",    1),
-    TEST ("a@2048\0",   "a@2048",      1),
-    TEST ("a@2048",     "a@2048\0",   -1),
-    TEST ("a@2048\0",   "a@2048\0",    0),
-
-    TEST ("x@128",      "x@207",      -1),
-    TEST ("x@334",      "x@334",       0),
-    TEST ("x@873",      "x@540",       1),
-    TEST ("x@1412",     "x@2284",     -1),
-    TEST ("x@3695",     "x@3695",      0),
-    TEST ("x@4096",     "x@3695",      1),
-
-    TEST (0,            "abc",         0),
-    TEST (0,            "\0ab\0",      0),
-    TEST (0,            "x@2048",      0),
-    TEST ("abc",        0,             0),
-    TEST ("\0ab\0",     0,             0),
-    TEST ("x@2048",     0,             0),
+    //    |                 +----------------------- second sequence 
+    //    |                 |                  +---- expected result 
+    //    |                 |                  |        -1 - first is less
+    //    |                 |                  |         0 - equal
+    //    |                 |                  |         1 - first is greater
+    //    |                 |                  |            
+    //    |                 |                  |        
+    //    V                 V                  V          
+    TEST ("ab",             "c",              -1),
+
+    TEST ("",               "",                0),
+    TEST ("",               "a",              -1),
+    TEST ("a",              "",                1),
+    TEST ("a",              "a",               0),
+
+    TEST ("<U0>",           "",                1),
+    TEST ("",               "<U0>",           -1),
+    TEST ("<U0>",           "<U0>",            0),
+
+    TEST ("abcdefgjih",     "abcdefgji",       1),
+    TEST ("abcdefgjih",     "abcdefgjih",      0),
+    TEST ("abcdefgji",      "abcdefgjih",     -1),
+    TEST ("abcefgjih",      "abcdefgjih",      1),
+    TEST ("abcdefgjih",     "abcefgjih",      -1),
+
+    TEST ("<U0>ab<U0>@2c",  "<U0>ab<U0>@2c",   0),
+    TEST ("ab<U0>@2c<U0>",  "<U0>ab<U0>@2c",   1),
+    TEST ("ab<U0>@2c<U0>",  "ab<U0>@2c<U0>",   0),
+    TEST ("ab<U0>@2c<U0>",  "ab",              1),
+    TEST ("ab",             "ab<U0>@2c<U0>",  -1),
+    TEST ("ab<U0>@3",       "ab<U0>@2c<U0>",  -1),
+    TEST ("ab<U0>@3",       "ab<U0>@3",        0),
+    TEST ("e<U0>",          "ab<U0>@2c<U0>",   1),
+    TEST ("ab<U0>@2c<U0>",  "e<U0>",          -1),
+
+    TEST ("x@2048",         "x@2048",          0),
+    TEST ("x@2048",         "x@2049",         -1),
+    TEST ("x@2048",         "x@2047",          1),
+    TEST ("a@2048",         "b@2048",         -1),
+    TEST ("b@2048",         "a@2048",          1),
+    TEST ("<U0>a@2048",     "a@2048<U0>",     -1),
+    TEST ("a@2048<U0>",     "<U0>a@2048",      1),
+    TEST ("a@2048<U0>",     "a@2048",          1),
+    TEST ("a@2048",         "a@2048<U0>",     -1),
+    TEST ("a@2048<U0>",     "a@2048<U0>",      0),
+
+    TEST ("x@128",          "x@207",          -1),
+    TEST ("x@334",          "x@334",           0),
+    TEST ("x@873",          "x@540",           1),
+    TEST ("x@1412",         "x@2284",         -1),
+    TEST ("x@3695",         "x@3695",          0),
+    TEST ("x@4096",         "x@3695",          1),
+
+    TEST (0,                "abc",             0),
+    TEST (0,                "<U0>ab<U0>",      0),
+    TEST (0,                "x@2048",          0),
+    TEST ("abc",            0,                 0),
+    TEST ("<U0>ab<U0>",     0,                 0),
+    TEST ("x@2048",         0,                 0),
 
-    TEST ("last",       "last",        0)
+    TEST ("last",           "last",            0)
 };
 
 /**************************************************************************/
@@ -226,56 +226,56 @@
     }
 
     //    +----------------------------------------- first sequence
-    //    |             +--------------------------- second sequence 
-    //    |             |              +------------- expected result 
-    //    |             |              |               -1 - first is less
-    //    |             |              |                0 - equal
-    //    |             |              |                1 - first is greater
-    //    |             |              |        
-    //    |             |              |        
-    //    V             V              V          
-    TEST ("ab",         "c",          -1),
-
-    TEST ("",           "",            0),
-    TEST ("",           "a",          -1),
-    TEST ("a",          "",            1),
-    TEST ("a",          "a",           0),
-
-    TEST ("\0",         "",            1),
-    TEST ("",           "\0",          0),
-    TEST ("\0",         "\0",          1),
-
-    TEST ("abcdefgjih", "abcdefgji",   1),
-    TEST ("abcdefgjih", "abcdefgjih",  0),
-    TEST ("abcdefgji",  "abcdefgjih", -1),
-    TEST ("abcefgjih",  "abcdefgjih",  1),
-    TEST ("abcdefgjih", "abcefgjih",  -1),
-
-    TEST ("\0ab\0\0c",  "\0ab\0\0c",   1),
-    TEST ("ab",         "ab\0\0c\0",   0),
-    TEST ("e\0",        "ab\0\0c\0",   1),
-    TEST ("ab\0\0c\0",  "e\0",        -1),
-
-    TEST ("x@2048",     "x@2048",      0),
-    TEST ("x@2048",     "x@2049",     -1),
-    TEST ("x@2048",     "x@2047",      1),
-    TEST ("a@2048",     "b@2048",     -1),
-    TEST ("b@2048",     "a@2048",      1),
-    TEST ("a@2048",     "a@2048\0",    0),
-    TEST ("a@2048\0",   "a@2048\0",    1),
-
-    TEST ("x@128",      "x@207",      -1),
-    TEST ("x@334",      "x@334",       0),
-    TEST ("x@873",      "x@540",       1),
-    TEST ("x@1412",     "x@2284",     -1),
-    TEST ("x@3695",     "x@3695",      0),
-    TEST ("x@4096",     "x@3695",      1),
-
-    TEST ("abc",        0,             0),
-    TEST ("\0ab\0",     0,             1),
-    TEST ("x@2048",     0,             0),
+    //    |                 +----------------------- second sequence 
+    //    |                 |                  +---- expected result 
+    //    |                 |                  |        -1 - first is less
+    //    |                 |                  |         0 - equal
+    //    |                 |                  |         1 - first is greater
+    //    |                 |                  |        
+    //    |                 |                  |        
+    //    V                 V                  V          
+    TEST ("ab",             "c",              -1),
+
+    TEST ("",               "",                0),
+    TEST ("",               "a",              -1),
+    TEST ("a",              "",                1),
+    TEST ("a",              "a",               0),
+
+    TEST ("<U0>",           "",                1),
+    TEST ("",               "<U0>",            0),
+    TEST ("<U0>",           "<U0>",            1),
+
+    TEST ("abcdefgjih",     "abcdefgji",       1),
+    TEST ("abcdefgjih",     "abcdefgjih",      0),
+    TEST ("abcdefgji",      "abcdefgjih",     -1),
+    TEST ("abcefgjih",      "abcdefgjih",      1),
+    TEST ("abcdefgjih",     "abcefgjih",      -1),
+
+    TEST ("<U0>ab<U0>@2c",  "<U0>ab<U0>@2c",   1),
+    TEST ("ab",             "ab<U0>@2c<U0>",   0),
+    TEST ("e<U0>",          "ab<U0>@2c<U0>",   1),
+    TEST ("ab<U0>@2c<U0>",  "e<U0>",          -1),
+
+    TEST ("x@2048",         "x@2048",          0),
+    TEST ("x@2048",         "x@2049",         -1),
+    TEST ("x@2048",         "x@2047",          1),
+    TEST ("a@2048",         "b@2048",         -1),
+    TEST ("b@2048",         "a@2048",          1),
+    TEST ("a@2048",         "a@2048<U0>",      0),
+    TEST ("a@2048<U0>",     "a@2048<U0>",      1),
+
+    TEST ("x@128",          "x@207",          -1),
+    TEST ("x@334",          "x@334",           0),
+    TEST ("x@873",          "x@540",           1),
+    TEST ("x@1412",         "x@2284",         -1),
+    TEST ("x@3695",         "x@3695",          0),
+    TEST ("x@4096",         "x@3695",          1),
+
+    TEST ("abc",            0,                 0),
+    TEST ("<U0>ab<U0>",     0,                 1),
+    TEST ("x@2048",         0,                 0),
 
-    TEST ("last",       "last",        0)
+    TEST ("last",           "last",            0)
 };
 
 /**************************************************************************/

Modified: incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp Wed Jun 28 16:47:10 2006
@@ -85,9 +85,9 @@
     TEST ("ab",        0, 2, "",         "",              0),
     TEST ("ab",        0, 1, "",         "b",             0),
 
-    TEST ("\0",        0, 1, "",         "",              0),
-    TEST ("\0",        0, 1, "a",        "a",             0),
-    TEST ("\0",        0, 1, "\0\0",     "",              0),
+    TEST ("<U0>",      0, 1, "",         "",              0),
+    TEST ("<U0>",      0, 1, "a",        "a",             0),
+    TEST ("<U0>",      0, 1, "<U0>@2",   "",              0),
 
     TEST ("ah",        0, 1, "bcdefg",   "bcdefgh",       0),
     TEST ("ah",        1, 1, "bcdefg",   "abcdefg",       0),
@@ -98,25 +98,25 @@
 
     TEST ("abc",       0, 3, "defgh",    "defgh",         0),
     TEST ("abc",       2, 1, "defgh",    "abdefgh",       0),
-    TEST ("abc",       2, 1, "de\0gh",   "abde",          0),
+    TEST ("abc",       2, 1, "de<U0>gh", "abde",          0),
     TEST ("abc",       2, 1, "",         "ab",            0),
     TEST ("abc",       1, 1, "defgh",    "adefghc",       0),
 
     TEST ("abc",       0, 0, "ee",       "eeabc",         0),
-    TEST ("abc",       0, 0, "\0\0e\0",  "abc",           0),
+    TEST ("abc",       0, 0, "<U0>@2e<U0>", "abc",        0),
     TEST ("abc",       2, 0, "ee",       "abeec",         0),
     TEST ("abc",       1, 0, "ee",       "aeebc",         0),
-    TEST ("abc",       1, 0, "e\0\0",    "aebc",          0),
+    TEST ("abc",       1, 0, "e<U0>@2",  "aebc",          0),
 
-    TEST ("a\0b\0\0c", 0, 3, "",         "\0\0c",         0),
-    TEST ("a\0b\0\0c", 0, 3, "\0e",      "\0\0c",         0),
+    TEST ("a<U0>b<U0>@2c", 0, 3, "",      "<U0>@2c",      0),
+    TEST ("a<U0>b<U0>@2c", 0, 3, "<U0>e", "<U0>@2c",      0),
 
-    TEST ("\0ab\0\0c", 0, 0, "e\0",      "e\0ab\0\0c",    0),
-    TEST ("a\0b\0c\0", 6, 0, "e\0",      "a\0b\0c\0e",    0),
-    TEST ("\0ab\0\0c", 5, 0, "e\0",      "\0ab\0\0ec",    0),
+    TEST ("<U0>ab<U0>@2c", 0, 0, "e<U0>",   "e<U0>ab<U0>@2c",   0),
+    TEST ("a<U0>b<U0>c<U0>", 6, 0, "e<U0>", "a<U0>b<U0>c<U0>e", 0),
+    TEST ("<U0>ab<U0>@2c", 5, 0, "e<U0>",   "<U0>ab<U0>@2ec",   0),
 
     TEST ("x@4096",    0, 4095, "ab",    "abx",           0),
-    TEST ("\0@4096",   1, 4094, "abc",   "\0abc\0",       0),
+    TEST ("<U0>@4096", 1, 4094, "abc",   "<U0>abc<U0>",   0),
     TEST ("x@4096",    1, 4094, "ab",    "xabx",          0),
     TEST ("x@4096",    0, 4094, "ab",    "abxx",          0),
     TEST ("x@4096",    1, 4093, "",      "xxx",           0),
@@ -134,9 +134,9 @@
     TEST ("",          0,    0, "x@4096", "x@4096",       0),
     TEST ("a",         0,    1, "x@4096", "x@4096",       0),
     TEST ("x@4096",    0, 4095, "x@4096", "x@4097",       0),
-    TEST ("\0ab\0\0c", 0,    6, "x@4096", "x@4096",       0),
+    TEST ("<U0>ab<U0>@2c", 0, 6, "x@4096", "x@4096",      0),
 
-    TEST ("\0",         2,   0, "",       "\0",           1),
+    TEST ("<U0>",       2,   0, "",       "<U0>",         1),
     TEST ("a",         10,   0, "",       "a",            1),
     TEST ("x@4096",  4106,   0, "",       "x@4096",       1),
 
@@ -146,10 +146,10 @@
     TEST ("",          0,    0, 0,        "",             0),
     TEST ("abc",       0,    3, 0,        "abc",          0),
     TEST ("abc",       1,    1, 0,        "aabcc",        0),
-    TEST ("a\0b\0c\0", 2,    3, 0,        "a\0a\0",       0),
-    TEST ("a\0b\0c\0", 0,    0, 0,        "aa\0b\0c\0",   0),
-    TEST ("a\0b\0c\0", 6,    0, 0,        "a\0b\0c\0a",   0),
-    TEST ("\0ab\0c\0", 3,    3, 0,        "\0ab",         0),
+    TEST ("a<U0>b<U0>c<U0>", 2,    3, 0,  "a<U0>a<U0>",       0),
+    TEST ("a<U0>b<U0>c<U0>", 0,    0, 0,  "aa<U0>b<U0>c<U0>", 0),
+    TEST ("a<U0>b<U0>c<U0>", 6,    0, 0,  "a<U0>b<U0>c<U0>a", 0),
+    TEST ("<U0>ab<U0>c<U0>", 3,    3, 0,  "<U0>ab",           0),
     TEST ("x@4096",    0, 4095, 0,        "x@4097",       0),
 
     TEST ("last",      4, 0, "test",     "lasttest",      0)
@@ -190,16 +190,16 @@
     TEST ("ab",         0, 0, "c",        "cab",               0),
 
     TEST ("",           0, 0, "",         "",                  0),
-    TEST ("",           0, 0, "\0",       "\0",                0),
+    TEST ("",           0, 0, "<U0>",       "<U0>",            0),
     TEST ("",           0, 0, "abc",      "abc",               0),
 
     TEST ("ab",         0, 2, "",         "",                  0),
     TEST ("ab",         0, 1, "",         "b",                 0),
-    TEST ("ab",         1, 1, "\0",       "a\0",               0),
+    TEST ("ab",         1, 1, "<U0>",       "a<U0>",           0),
 
-    TEST ("\0",         0, 1, "",         "",                  0),
-    TEST ("\0",         0, 1, "a",        "a",                 0),
-    TEST ("\0",         0, 1, "\0\0",     "\0\0",              0),
+    TEST ("<U0>",       0, 1, "",         "",                  0),
+    TEST ("<U0>",       0, 1, "a",        "a",                 0),
+    TEST ("<U0>",       0, 1, "<U0>@2",     "<U0>@2",          0),
 
     TEST ("ah",         0, 1, "bcdefg",   "bcdefgh",           0),
     TEST ("ah",         1, 1, "bcdefg",   "abcdefg",           0),
@@ -210,32 +210,32 @@
 
     TEST ("abc",        0, 3, "defgh",    "defgh",             0),
     TEST ("abc",        2, 1, "defgh",    "abdefgh",           0),
-    TEST ("abc",        2, 1, "de\0gh",   "abde\0gh",          0),
+    TEST ("abc",        2, 1, "de<U0>gh", "abde<U0>gh",        0),
     TEST ("abc",        2, 1, "",         "ab",                0),
     TEST ("abc",        1, 1, "defgh",    "adefghc",           0),
 
     TEST ("abc",        0, 0, "ee",       "eeabc",             0),
-    TEST ("abc",        0, 0, "\0\0e\0",  "\0\0e\0abc",        0),
+    TEST ("abc",        0, 0, "<U0>@2e<U0>", "<U0>@2e<U0>abc", 0),
     TEST ("abc",        2, 0, "ee",       "abeec",             0),
     TEST ("abc",        1, 0, "ee",       "aeebc",             0),
-    TEST ("abc",        1, 0, "e\0\0",    "ae\0\0bc",          0),
+    TEST ("abc",        1, 0, "e<U0>@2",  "ae<U0>@2bc",        0),
 
-    TEST ("a\0b\0\0c",  0, 3, "",         "\0\0c",             0),
-    TEST ("a\0b\0\0c",  0, 3, "\0e",      "\0e\0\0c",          0),
+    TEST ("a<U0>b<U0>@2c",  0, 3, "",      "<U0>@2c",          0),
+    TEST ("a<U0>b<U0>@2c",  0, 3, "<U0>e", "<U0>e<U0>@2c",     0),
 
-    TEST ("a\0b\0\0c",  2, 3, "\0e",      "a\0\0ec",           0),
-    TEST ("a\0b\0\0c",  0, 3, "\0\0e\0",  "\0\0e\0\0\0c",      0),
-    TEST ("\0ab\0\0c",  1, 2, "\0e\0\0",  "\0\0e\0\0\0\0c",    0),
-
-    TEST ("\0ab\0\0c",  0, 0, "\0e",      "\0e\0ab\0\0c",      0),
-    TEST ("a\0b\0c\0",  6, 0, "e\0",      "a\0b\0c\0e\0",      0),
-    TEST ("\0ab\0\0c",  5, 0, "\0e",      "\0ab\0\0\0ec",      0),
+    TEST ("a<U0>b<U0>@2c",  2, 3, "<U0>e",       "a<U0>@2ec",      0),
+    TEST ("a<U0>b<U0>@2c",  0, 3, "<U0>@2e<U0>", "<U0>@2e<U0>@3c", 0),
+    TEST ("<U0>ab<U0>@2c",  1, 2, "<U0>e<U0>@2", "<U0>@2e<U0>@4c", 0),
+
+    TEST ("<U0>ab<U0>@2c",   0, 0, "<U0>e", "<U0>e<U0>ab<U0>@2c",   0),
+    TEST ("a<U0>b<U0>c<U0>", 6, 0, "e<U0>", "a<U0>b<U0>c<U0>e<U0>", 0),
+    TEST ("<U0>ab<U0>@2c",  5, 0, "<U0>e",      "<U0>ab<U0>@3ec",   0),
 
     TEST ("x@4096",     0, 4095, "ab",    "abx",               0),
     TEST ("x@4096",     1, 4094, "ab",    "xabx",              0),
     TEST ("x@4096",     0, 4094, "ab",    "abxx",              0),
     TEST ("x@4096",     1, 4093, "",      "xxx",               0),
-    TEST ("x@4096",     1, 4092, "\0\0",  "x\0\0xxx",          0),
+    TEST ("x@4096",     1, 4092, "<U0>@2", "x<U0>@2xxx",       0),
 
     TEST ("x@20",       1,   10, "x@118", "x@128",             0),
     TEST ("x@128",    128,    0, "x@79",  "x@207",             0),
@@ -250,9 +250,9 @@
     TEST ("",           0,    0, "x@4096", "x@4096",           0),
     TEST ("a",          0,    1, "x@4096", "x@4096",           0),
     TEST ("x@4096",     0, 4095, "x@4096", "x@4097",           0),
-    TEST ("\0ab\0\0c",  0,    6, "x@4096", "x@4096",           0),
+    TEST ("<U0>ab<U0>@2c",  0,    6, "x@4096", "x@4096",       0),
 
-    TEST ("\0",         2,    0, "",        "\0",              1),
+    TEST ("<U0>",         2,    0, "",        "<U0>",          1),
     TEST ("a",         10,    0, "",        "a",               1),
     TEST ("x@4096",  4106,    0, "",        "x@4096",          1),
     TEST ("",           0,    0, "x@4096",  "x@4096",          0),
@@ -260,10 +260,10 @@
     // self-referential replacement
     TEST ("abc",        0,    3, 0, "abc",                     0),
     TEST ("abc",        1,    1, 0, "aabcc",                   0),
-    TEST ("a\0b\0c\0",  2,    3, 0, "a\0a\0b\0c\0\0",          0),
-    TEST ("a\0b\0c\0",  0,    0, 0, "a\0b\0c\0a\0b\0c\0",      0),
-    TEST ("a\0b\0c\0",  6,    0, 0, "a\0b\0c\0a\0b\0c\0",      0),
-    TEST ("\0ab\0c\0",  3,    3, 0, "\0ab\0ab\0c\0",           0),
+    TEST ("a<U0>b<U0>c<U0>",  2, 3, 0, "a<U0>a<U0>b<U0>c<U0>@2",         0),
+    TEST ("a<U0>b<U0>c<U0>",  0, 0, 0, "a<U0>b<U0>c<U0>a<U0>b<U0>c<U0>", 0),
+    TEST ("a<U0>b<U0>c<U0>",  6, 0, 0, "a<U0>b<U0>c<U0>a<U0>b<U0>c<U0>", 0),
+    TEST ("<U0>ab<U0>c<U0>",  3, 3, 0, "<U0>ab<U0>ab<U0>c<U0>",          0),
     TEST ("x@4096",     0, 4095, 0, "x@4097",                  0),
 
     TEST ("last",       4,    0, "test",     "lasttest",       0)
@@ -310,9 +310,9 @@
     TEST ("ab",        0, 2, "",          0, "",                0),
     TEST ("ab",        0, 1, "",          0, "b",               0),
 
-    TEST ("\0",        0, 1, "",          0, "",                0),
-    TEST ("\0",        0, 1, "a",         1, "a",               0),
-    TEST ("\0",        0, 1, "\0\0",      2, "\0\0",            0),
+    TEST ("<U0>",      0, 1, "",          0, "",                0),
+    TEST ("<U0>",      0, 1, "a",         1, "a",               0),
+    TEST ("<U0>",      0, 1, "<U0>@2",    2, "<U0>@2",          0),
 
     TEST ("ah",        0, 1, "bcdefg",    3, "bcdh",            0),
     TEST ("ah",        1, 1, "bcdefg",    3, "abcd",            0),
@@ -321,27 +321,27 @@
     TEST ("abc",       0, 2, "cc",        2, "ccc",             0),
     TEST ("abc",       1, 2, "cc",        2, "acc",             0),
     TEST ("abc",       2, 1, "defgh",     1, "abd",             0),
-    TEST ("abc",       2, 1, "de\0gh",    3, "abde\0",          0),
+    TEST ("abc",       2, 1, "de<U0>gh",  3, "abde<U0>",        0),
     TEST ("abc",       2, 1, "",          0, "ab",              0),
 
     TEST ("abc",       0, 0, "ee",        2, "eeabc",           0),
-    TEST ("abc",       0, 0, "\0\0e\0",   4, "\0\0e\0abc",      0),
+    TEST ("abc",       0, 0, "<U0>@2e<U0>", 4, "<U0>@2e<U0>abc",0),
     TEST ("abc",       2, 0, "ee",        2, "abeec",           0),
     TEST ("abc",       1, 0, "ee",        1, "aebc",            0),
 
-    TEST ("a\0b\0\0c", 0, 3, "",          0, "\0\0c",           0),
-    TEST ("a\0b\0\0c", 0, 3, "e\0",       2, "e\0\0\0c",        0),
-    TEST ("a\0b\0\0c", 2, 3, "e\0",       1, "a\0ec",           0),
-    TEST ("a\0b\0\0c", 2, 3, "\0e",       2, "a\0\0ec",         0),
-    TEST ("\0ab\0\0c", 2, 3, "\0e",       2, "\0a\0ec",         0),
-    TEST ("a\0b\0\0c", 0, 6, "e\0",       2, "e\0",             0),
+    TEST ("a<U0>b<U0>@2c", 0, 3, "",      0, "<U0>@2c",         0),
+    TEST ("a<U0>b<U0>@2c", 0, 3, "e<U0>", 2, "e<U0>@3c",        0),
+    TEST ("a<U0>b<U0>@2c", 2, 3, "e<U0>", 1, "a<U0>ec",         0),
+    TEST ("a<U0>b<U0>@2c", 2, 3, "<U0>e", 2, "a<U0>@2ec",       0),
+    TEST ("<U0>ab<U0>@2c", 2, 3, "<U0>e", 2, "<U0>a<U0>ec",     0),
+    TEST ("a<U0>b<U0>@2c", 0, 6, "e<U0>", 2, "e<U0>",           0),
 
-    TEST ("x@4096",    1, 4095, "\0",        1, "x\0",          0),
+    TEST ("x@4096",    1, 4095, "<U0>",      1, "x<U0>",        0),
     TEST ("x@4096",    0, 4095, "ab",        2, "abx",          0),
     TEST ("x@4096",    1, 4094, "ab",        1, "xax",          0),
     TEST ("x@4096",    0, 4094, "ab",        2, "abxx",         0),
     TEST ("x@4096",    1, 4093, "",          0, "xxx",          0),
-    TEST ("x@4096",    1, 4092, "\0\0",      2, "x\0\0xxx",     0),
+    TEST ("x@4096",    1, 4092, "<U0>@2",    2, "x<U0>@2xxx",   0),
 
     TEST ("",          0,    0, "x@873",   540, "x@540",        0),
     TEST ("x@20",      1,   10, "x@118",   118, "x@128",        0),
@@ -363,7 +363,7 @@
 
     TEST ("x@4096", 2047, 2048, "x@4096", 2048,  "x@4096",      0),
 
-    TEST ("\0",         2,   0, "",         0, "\0",            1),
+    TEST ("<U0>",       2,   0, "",         0, "<U0>",          1),
     TEST ("a",         10,   0, "",         0, "a",             1),
     TEST ("x@4096",  4106,   0, "",         0, "x@4096",        1),
 
@@ -375,10 +375,10 @@
     TEST ("a",         1,    0, 0 /* self */,    1, "aa",              0),
     TEST ("abc",       0,    3, 0 /* self */,    2, "ab",              0),
     TEST ("abc",       1,    1, 0 /* self */,    3, "aabcc",           0),
-    TEST ("a\0b\0c\0", 2,    3, 0 /* self */,    6, "a\0a\0b\0c\0\0",  0),
-    TEST ("a\0b\0c\0", 0,    0, 0 /* self */,    4, "a\0b\0a\0b\0c\0", 0),
-    TEST ("\0ab\0c\0", 6,    0, 0 /* self */,    1, "\0ab\0c\0\0",     0),
-    TEST ("\0ab\0c\0", 3,    3, 0 /* self */,    2, "\0ab\0a",         0),
+    TEST ("a<U0>b<U0>c<U0>", 2, 3, 0, 6, "a<U0>a<U0>b<U0>c<U0>@2",     0),
+    TEST ("a<U0>b<U0>c<U0>", 0, 0, 0, 4, "a<U0>b<U0>a<U0>b<U0>c<U0>",  0),
+    TEST ("<U0>ab<U0>c<U0>", 6, 0, 0 /* self */, 1, "<U0>ab<U0>c<U0>@2", 0),
+    TEST ("<U0>ab<U0>c<U0>", 3, 3, 0 /* self */, 2, "<U0>ab<U0>a",       0),
     TEST ("a@4096",    0,    1, 0 /* self */, 1111, "a@5206",          0),
     TEST ("b@4096",    1,    2, 0 /* self */, 2222, "b@6316",          0),
     TEST ("x@4096",    0, 4095, 0 /* self */, 4095, "x@4096",          0),
@@ -463,10 +463,10 @@
     TEST ("ab",        0,  2, "",         0, 0, "",                  0),
     TEST ("ab",        0,  1, "",         0, 0, "b",                 0),
 
-    TEST ("\0",        0,  1, "",         0, 0, "",                  0),
-    TEST ("\0",        0,  1, "a",        0, 1, "a",                 0),
-    TEST ("\0",        0,  1, "\0\0",     1, 1, "\0",                0),
-    TEST ("\0",        0,  1, "\0\0",     0, 2, "\0\0",              0),
+    TEST ("<U0>",      0,  1, "",         0, 0, "",                  0),
+    TEST ("<U0>",      0,  1, "a",        0, 1, "a",                 0),
+    TEST ("<U0>",      0,  1, "<U0>@2",   1, 1, "<U0>",              0),
+    TEST ("<U0>",      0,  1, "<U0>@2",   0, 2, "<U0>@2",            0),
 
     TEST ("ah",        0,  1, "bcdefg",   0, 3, "bcdh",              0),
     TEST ("ah",        1,  1, "bcdefg",   0, 3, "abcd",              0),
@@ -482,32 +482,32 @@
     TEST ("abc",       0,  3, "def",      0, 3, "def",               0),
     TEST ("abc",       0,  3, "defgh",    0, 5, "defgh",             0),
     TEST ("abc",       2,  1, "defgh",    4, 1, "abh",               0),
-    TEST ("abc",       2,  1, "de\0gh",   2, 1, "ab\0",              0),
+    TEST ("abc",       2,  1, "de<U0>gh",   2, 1, "ab<U0>",          0),
     TEST ("abc",       2,  1, "",         0, 0, "ab",                0),
 
     TEST ("abc",       1,  1, "defgh",    1, 2, "aefc",              0),
     TEST ("abc",       0,  0, "ee",       0, 2, "eeabc",             0),
-    TEST ("abc",       0,  0, "\0\0e\0",  0, 4, "\0\0e\0abc",        0),
+    TEST ("abc",       0,  0, "<U0>@2e<U0>",  0, 4, "<U0>@2e<U0>abc",0),
     TEST ("abc",       2,  0, "ee",       0, 2, "abeec",             0),
-    TEST ("abc",       2,  1, "\0e\0\0",  0, 4, "ab\0e\0\0",         0),
+    TEST ("abc",       2,  1, "<U0>e<U0>@2",  0, 4, "ab<U0>e<U0>@2", 0),
     TEST ("abc",       1,  0, "ee",       0, 2, "aeebc",             0),
-    TEST ("abc",       1,  0, "\0e\0\0",  0, 4, "a\0e\0\0bc",        0),
+    TEST ("abc",       1,  0, "<U0>e<U0>@2",  0, 4, "a<U0>e<U0>@2bc", 0),
 
-    TEST ("a\0b\0\0c", 0,  3, "",         0, 0, "\0\0c",             0),
-    TEST ("\0ab\0\0c", 0,  3, "",         0, 0, "\0\0c",             0),
-    TEST ("a\0b\0\0c", 0,  3, "\0e",      0, 2, "\0e\0\0c",          0),
-
-    TEST ("a\0b\0\0c", 2,  3, "\0e",      0, 2, "a\0\0ec",           0),
-    TEST ("a\0b\0\0c", 2,  3, "\0e",      1, 1, "a\0ec",             0),
-    TEST ("\0ab\0\0c", 2,  3, "\0e",      0, 2, "\0a\0ec",           0),
-    TEST ("\0ab\0\0c", 2,  3, "\0e\0\0",  1, 3, "\0ae\0\0c",         0),
-
-    TEST ("a\0b\0\0c", 0,  6, "\0e",      0, 2, "\0e",               0),
-    TEST ("a\0b\0\0c", 0,  6, "\0e",      0, 1, "\0",                0),
-
-    TEST ("\0ab\0\0c", 0,  0, "\0e",      0, 2, "\0e\0ab\0\0c",      0),
-    TEST ("a\0b\0c\0", 6,  0, "e\0",      0, 2, "a\0b\0c\0e\0",      0),
-    TEST ("\0ab\0\0c", 5,  0, "\0e",      0, 2, "\0ab\0\0\0ec",      0),
+    TEST ("a<U0>b<U0>@2c", 0,  3, "",      0, 0, "<U0>@2c",           0),
+    TEST ("<U0>ab<U0>@2c", 0,  3, "",      0, 0, "<U0>@2c",           0),
+    TEST ("a<U0>b<U0>@2c", 0,  3, "<U0>e", 0, 2, "<U0>e<U0>@2c",      0),
+
+    TEST ("a<U0>b<U0>@2c", 2,  3, "<U0>e",      0, 2, "a<U0>@2ec",    0),
+    TEST ("a<U0>b<U0>@2c", 2,  3, "<U0>e",      1, 1, "a<U0>ec",      0),
+    TEST ("<U0>ab<U0>@2c", 2,  3, "<U0>e",      0, 2, "<U0>a<U0>ec",  0),
+    TEST ("<U0>ab<U0>@2c", 2,  3, "<U0>e<U0>@2", 1, 3, "<U0>ae<U0>@2c", 0),
+
+    TEST ("a<U0>b<U0>@2c", 0,  6, "<U0>e",      0, 2, "<U0>e",          0),
+    TEST ("a<U0>b<U0>@2c", 0,  6, "<U0>e",      0, 1, "<U0>",           0),
+
+    TEST ("<U0>ab<U0>@2c",   0,  0, "<U0>e",  0, 2, "<U0>e<U0>ab<U0>@2c",   0),
+    TEST ("a<U0>b<U0>c<U0>", 6,  0, "e<U0>",  0, 2, "a<U0>b<U0>c<U0>e<U0>", 0),
+    TEST ("<U0>ab<U0>@2c",   5,  0, "<U0>e",  0, 2, "<U0>ab<U0>@3ec",       0),
 
     ///////////////////////////////////////////////////////////////////////
     // very long strings
@@ -532,7 +532,7 @@
     TEST ("x@4096",    1,  4094, "ab",       0, 2, "xabx",            0),
     TEST ("x@4096",    0,  4094, "ab",       0, 2, "abxx",            0),
     TEST ("x@4096",    1,  4093, "",         0, 0, "xxx",             0),
-    TEST ("x@4096",    1,  4092, "\0\0",     0, 2, "x\0\0xxx",        0),
+    TEST ("x@4096",    1,  4092, "<U0>@2",   0, 2, "x<U0>@2xxx",      0),
 
     TEST ("a",      0,     1, "x@4096",   0, 4095, "x@4095",         0),
     TEST ("x@4096", 0,  4095, "x@4096",   0, 4095, "x@4096",         0),
@@ -554,8 +554,8 @@
 
     TEST ("x@4096", 2047, 2048, "x@4096", 0, 2048,  "x@4096",        0),
 
-    TEST ("\0",         2, 0, "",           0, 0, "\0",              1),
-    TEST ("\0",         0, 0, "\0",         2, 0, "\0",              2),
+    TEST ("<U0>",         2, 0, "",           0, 0, "<U0>",          1),
+    TEST ("<U0>",         0, 0, "<U0>",       2, 0, "<U0>",          2),
 
     TEST ("a",         10, 0, "",           0, 0, "a",               1),
     TEST ("a",          0, 0, "a",         10, 0, "a",               2),
@@ -598,9 +598,9 @@
 
     TEST ("abc",       0, 0, 0,           1, 1,  "babc",             0),
     TEST ("abc",       2, 0, 0,           0, 2,  "ababc",            0),
-    TEST ("a\0bc\0\0", 0, 0, 0,           4, 2,  "\0\0a\0bc\0\0",    0),
-    TEST ("a\0bc\0\0", 6, 0, 0,           1, 3,  "a\0bc\0\0\0bc",    0),
-    TEST ("abcdef",    0, 0, 0,           1, 2,  "bcabcdef",         0),
+    TEST ("a<U0>bc<U0>@2", 0, 0, 0,       4, 2,  "<U0>@2a<U0>bc<U0>@2", 0),
+    TEST ("a<U0>bc<U0>@2", 6, 0, 0,       1, 3,  "a<U0>bc<U0>@3bc",     0),
+    TEST ("abcdef",    0, 0, 0,           1, 2,  "bcabcdef",            0),
 
     TEST ("last",      4, 0, "test",      0, 4, "lasttest",          0)
 };
@@ -646,10 +646,10 @@
     TEST ("ab",        0, 2, 0, 'c',  "",              0),
     TEST ("ab",        0, 1, 0, 'c',  "b",             0),
 
-    TEST ("\0",        0, 1, 0, ' ',  "",              0),
-    TEST ("\0",        0, 1, 1, 'a',  "a",             0),
-    TEST ("\0",        0, 1, 1, '\0', "\0",            0),
-    TEST ("\0",        0, 1, 2, '\0', "\0\0",          0),
+    TEST ("<U0>",      0, 1, 0, ' ',  "",              0),
+    TEST ("<U0>",      0, 1, 1, 'a',  "a",             0),
+    TEST ("<U0>",      0, 1, 1, '\0', "<U0>",          0),
+    TEST ("<U0>",      0, 1, 2, '\0', "<U0>@2",        0),
 
     TEST ("ah",        0, 1, 1, 'c',  "ch",            0),
     TEST ("ah",        1, 1, 1, 'c',  "ac",            0),
@@ -666,28 +666,28 @@
 
     TEST ("abc",       1, 1, 5, 'c',  "acccccc",       0),
     TEST ("abc",       0, 0, 2, 'c',  "ccabc",         0),
-    TEST ("abc",       0, 0, 3, '\0', "\0\0\0abc",     0),
+    TEST ("abc",       0, 0, 3, '\0', "<U0>@3abc",     0),
     TEST ("abc",       2, 0, 2, 'e',  "abeec",         0),
-    TEST ("abc",       2, 0, 3, '\0', "ab\0\0\0c",     0),
-    TEST ("abc",       1, 0, 1, '\0', "a\0bc",         0),
+    TEST ("abc",       2, 0, 3, '\0', "ab<U0>@3c",     0),
+    TEST ("abc",       1, 0, 1, '\0', "a<U0>bc",       0),
 
-    TEST ("a\0b\0\0c", 0, 3, 1, '\0', "\0\0\0c",       0),
-    TEST ("a\0b\0\0c", 2, 3, 2, '\0', "a\0\0\0c",      0),
-    TEST ("a\0b\0\0c", 2, 2, 1, '\0', "a\0\0\0c",      0),
-    TEST ("\0ab\0\0c", 2, 3, 0, '\0', "\0ac",          0),
-    TEST ("\0ab\0\0c", 2, 1, 2, '\0', "\0a\0\0\0\0c",  0),
-
-    TEST ("a\0b\0\0c", 0, 6, 2, '\0', "\0\0",          0),
-
-    TEST ("\0ab\0\0c", 0, 0, 2, '\0', "\0\0\0ab\0\0c", 0),
-    TEST ("a\0b\0c\0", 6, 0, 2, '\0', "a\0b\0c\0\0\0", 0),
-    TEST ("\0ab\0\0c", 5, 0, 1, '\0', "\0ab\0\0\0c",   0),
+    TEST ("a<U0>b<U0>@2c", 0, 3, 1, '\0', "<U0>@3c",      0),
+    TEST ("a<U0>b<U0>@2c", 2, 3, 2, '\0', "a<U0>@3c",     0),
+    TEST ("a<U0>b<U0>@2c", 2, 2, 1, '\0', "a<U0>@3c",     0),
+    TEST ("<U0>ab<U0>@2c", 2, 3, 0, '\0', "<U0>ac",       0),
+    TEST ("<U0>ab<U0>@2c", 2, 1, 2, '\0', "<U0>a<U0>@4c", 0),
+
+    TEST ("a<U0>b<U0>@2c", 0, 6, 2, '\0', "<U0>@2",       0),
+
+    TEST ("<U0>ab<U0>@2c", 0, 0, 2, '\0', "<U0>@3ab<U0>@2c",     0),
+    TEST ("a<U0>b<U0>c<U0>", 6, 0, 2, '\0', "a<U0>b<U0>c<U0>@3", 0),
+    TEST ("<U0>ab<U0>@2c", 5, 0, 1, '\0', "<U0>ab<U0>@3c",       0),
 
     TEST ("x@4096",    0, 4095,  2, 'a',  "aax",       0),
     TEST ("x@4096",    1, 4094,  2, 'a',  "xaax",      0),
     TEST ("x@4096",    0, 4094,  2, 'a',  "aaxx",      0),
     TEST ("x@4096",    1, 4093,  0, 'a',  "xxx",       0),
-    TEST ("x@4096",    1, 4092,  1, '\0', "x\0xxx",    0),
+    TEST ("x@4096",    1, 4092,  1, '\0', "x<U0>xxx",  0),
 
     TEST ("x@127",     0,    0,  1, 'x', "x@128",      0),
     TEST ("x@200",   128,    7, 14, 'x', "x@207",      0),
@@ -705,7 +705,7 @@
 
     TEST ("x@4096", 2047, 2048, 2048,   'x', "x@4096",     0),
 
-    TEST ("\0",         2,   0,    0, ' ',  "\0",          1),
+    TEST ("<U0>",       2,   0,    0, ' ',  "<U0>",        1),
     TEST ("a",         10,   0,    0, ' ',  "a",           1),
     TEST ("x@4096",  4106,   0,    0, ' ',  "x@4096",      1),
 
@@ -983,7 +983,7 @@
                 // (and only then), also verify that the modified
                 // string matches the expected result
                 const std::size_t match =
-                    rw_match (tcase.res, str.data (), tcase.nres);
+                    rw_match (tcase.res, str.data (), str.size ());
 
                 rw_assert (match == tdata.reslen_, 0, tcase.line,
                            "line %d. %{$FUNCALL} expected %{/*.*Gs}, "



Mime
View raw message