stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r417904 [2/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.assign.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.assign.cpp Wed Jun 28 16:47:10 2006
@@ -60,55 +60,55 @@
         arg, sizeof arg - 1, res, sizeof res - 1, bthrow        \
     }
 
-    //    +----------------------------------------- controlled sequence
-    //    |             +--------------------------- sequence to be assigned
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info
-    //    |             |             |        |      0 - no exception
-    //    |             |             |        |      1 - out_of_range
-    //    |             |             |        |      2 - length_error
-    //    |             |             |        |     -1 - exc. safety
-    //    |             |             |        |
-    //    |             |             |        +-------+
-    //    V             V             V                V
-    TEST ("ab",         "c",          "c",             0),
-
-    TEST ("",           "",           "",              0),
-    TEST ("",           "\0",         "",              0),
-    TEST ("",           "abc",        "abc",           0),
-    TEST ("abc",        "",           "",              0),
-
-    TEST ("\0",         "",           "",              0),
-    TEST ("\0",         "a",          "a",             0),
-    TEST ("\0",         "\0\0",       "",              0),
-
-    TEST ("\0\0ab",     "cdefghij",   "cdefghij",      0),
-    TEST ("a\0\0b",     "cdefghij",   "cdefghij",      0),
-    TEST ("ab\0\0",     "cdefghij",   "cdefghij",      0),
-    TEST ("a\0b\0\0c",  "e\0",        "e",             0),
-    TEST ("\0ab\0\0c",  "e\0",        "e",             0),
-
-    TEST ("",           "x@4096",     "x@4096",        0),
-    TEST ("x@4096",     "",           "",              0),
-    TEST ("a@4096",     "b@4096",     "b@4096",        0),
-
-    TEST ("",           "x@207",      "x@207",         0),
-    TEST ("x@128",      "x@207",      "x@207",         0),
-    TEST ("x@540",      "x@207",      "x@207",         0),
-    TEST ("",           "x@1412",     "x@1412",        0),
-    TEST ("x@128",      "x@1412",     "x@1412",        0),
-    TEST ("x@3695",     "x@1412",     "x@1412",        0),
-    TEST ("x@872",      "x@873",      "x@873",         0),
-    TEST ("x@873",      "x@3695",     "x@3695",        0),
-
-    TEST ("",           0,            "",              0),
-    TEST ("abc",        0,            "abc",           0),
-    TEST ("a\0\0bc",    0,            "a",             0),
-    TEST ("\0\0abc",    0,            "",              0),
-    TEST ("abc\0\0",    0,            "abc",           0),
-    TEST ("x@4096",     0,            "x@4096",        0),
+    //    +------------------------------------------ controlled sequence
+    //    |                 +------------------------ sequence to be assigned
+    //    |                 |             +---------- expected result sequence
+    //    |                 |             |        +- exception info
+    //    |                 |             |        |      0 - no exception
+    //    |                 |             |        |      1 - out_of_range
+    //    |                 |             |        |      2 - length_error
+    //    |                 |             |        |     -1 - exc. safety
+    //    |                 |             |        |
+    //    |                 |             |        +-------+
+    //    V                 V             V                V
+    TEST ("ab",             "c",          "c",             0),
+
+    TEST ("",               "",           "",              0),
+    TEST ("",               "<U0>",       "",              0),
+    TEST ("",               "abc",        "abc",           0),
+    TEST ("abc",            "",           "",              0),
+
+    TEST ("<U0>",           "",           "",              0),
+    TEST ("<U0>",           "a",          "a",             0),
+    TEST ("<U0>",           "<U0>@2",     "",              0),
+
+    TEST ("<U0>@2ab",       "cdefghij",   "cdefghij",      0),
+    TEST ("a<U0>@2b",       "cdefghij",   "cdefghij",      0),
+    TEST ("ab<U0>@2",       "cdefghij",   "cdefghij",      0),
+    TEST ("a<U0>b<U0>@2c",  "e<U0>",      "e",             0),
+    TEST ("<U0>ab<U0>@2c",  "e<U0>",      "e",             0),
+
+    TEST ("",               "x@4096",     "x@4096",        0),
+    TEST ("x@4096",         "",           "",              0),
+    TEST ("a@4096",         "b@4096",     "b@4096",        0),
+
+    TEST ("",               "x@207",      "x@207",         0),
+    TEST ("x@128",          "x@207",      "x@207",         0),
+    TEST ("x@540",          "x@207",      "x@207",         0),
+    TEST ("",               "x@1412",     "x@1412",        0),
+    TEST ("x@128",          "x@1412",     "x@1412",        0),
+    TEST ("x@3695",         "x@1412",     "x@1412",        0),
+    TEST ("x@872",          "x@873",      "x@873",         0),
+    TEST ("x@873",          "x@3695",     "x@3695",        0),
+
+    TEST ("",               0,            "",              0),
+    TEST ("abc",            0,            "abc",           0),
+    TEST ("a<U0>@2bc",      0,            "a",             0),
+    TEST ("<U0>@2abc",      0,            "",              0),
+    TEST ("abc<U0>@2",      0,            "abc",           0),
+    TEST ("x@4096",         0,            "x@4096",        0),
 
-    TEST ("last",       "test",       "test",          0)
+    TEST ("last",           "test",       "test",          0)
 };
 
 /**************************************************************************/
@@ -125,63 +125,63 @@
         arg, sizeof arg - 1, res, sizeof res - 1, bthrow        \
     }
 
-    //    +----------------------------------------- controlled sequence
-    //    |             +--------------------------- sequence to be assigned
-    //    |             |             +------------- expected result sequence
-    //    |             |             |        +---- exception info:
-    //    |             |             |        |      0 - no exception
-    //    |             |             |        |      1 - out_of_range
-    //    |             |             |        |      2 - length_error
-    //    |             |             |        |     -1 - exc. safety
-    //    |             |             |        |
-    //    |             |             |        +-----+
-    //    |             |             |              |
-    //    V             V             V              V
-    TEST ("ab",         "c",          "c",           0),
-
-    TEST ("",           "",           "",            0),
-    TEST ("",           "\0",         "\0",          0),
-    TEST ("",           "abc",        "abc",         0),
-    TEST ("abc",        "",           "",            0),
-
-    TEST ("\0",         "",           "",            0),
-    TEST ("\0",         "a",          "a",           0),
-    TEST ("\0",         "\0\0",       "\0\0",        0),
-
-    TEST ("ab",         "c\0e",       "c\0e",        0),
-
-    TEST ("\0\0ab",     "cdefghij",   "cdefghij",    0),
-    TEST ("a\0\0b",     "cdefghij",   "cdefghij",    0),
-    TEST ("ab\0\0",     "cdefghij",   "cdefghij",    0),
-    TEST ("a\0b\0\0c",  "e\0",        "e\0",         0),
-    TEST ("\0ab\0\0c",  "e\0",        "e\0",         0),
-    TEST ("ab\0\0c\0",  "\0e",        "\0e",         0),
-
-    TEST ("e\0",        "a\0b\0\0c",  "a\0b\0\0c",   0),
-    TEST ("e\0\0",      "\0ab\0\0c",  "\0ab\0\0c",   0),
-    TEST ("\0e",        "ab\0\0c\0",  "ab\0\0c\0",   0),
-
-    TEST ("",           "x@4096",     "x@4096",      0),
-    TEST ("x@4096",     "",           "",            0),
-    TEST ("a@4096",     "b@4096",     "b@4096",      0),
-
-    TEST ("",           "x@207",      "x@207",       0),
-    TEST ("x@128",      "x@207",      "x@207",       0),
-    TEST ("x@540",      "x@207",      "x@207",       0),
-    TEST ("",           "x@1412",     "x@1412",      0),
-    TEST ("x@128",      "x@1412",     "x@1412",      0),
-    TEST ("x@3695",     "x@1412",     "x@1412",      0),
-    TEST ("x@872",      "x@873",      "x@873",       0),
-    TEST ("x@873",      "x@3695",     "x@3695",      0),
-
-    TEST ("",           0,            "",            0),
-    TEST ("abc",        0,            "abc",         0),
-    TEST ("a\0\0bc",    0,            "a\0\0bc",     0),
-    TEST ("\0\0abc",    0,            "\0\0abc",     0),
-    TEST ("abc\0\0",    0,            "abc\0\0",     0),
-    TEST ("x@4096",     0,            "x@4096",      0),
+    //    +------------------------------------------ controlled sequence
+    //    |                 +------------------------ sequence to be assigned
+    //    |                 |             +---------- expected result sequence
+    //    |                 |             |        +- exception info:
+    //    |                 |             |        |      0 - no exception
+    //    |                 |             |        |      1 - out_of_range
+    //    |                 |             |        |      2 - length_error
+    //    |                 |             |        |     -1 - exc. safety
+    //    |                 |             |        |
+    //    |                 |             |        +-----+
+    //    |                 |             |              |
+    //    V                 V             V              V
+    TEST ("ab",             "c",          "c",           0),
+
+    TEST ("",               "",           "",            0),
+    TEST ("",               "<U0>",       "<U0>",        0),
+    TEST ("",               "abc",        "abc",         0),
+    TEST ("abc",            "",           "",            0),
+
+    TEST ("<U0>",           "",           "",            0),
+    TEST ("<U0>",           "a",          "a",           0),
+    TEST ("<U0>",           "<U0>@2",     "<U0>@2",      0),
+
+    TEST ("ab",             "c<U0>e",     "c<U0>e",      0),
+
+    TEST ("<U0>@2ab",       "cdefghij",   "cdefghij",    0),
+    TEST ("a<U0>@2b",       "cdefghij",   "cdefghij",    0),
+    TEST ("ab<U0>@2",       "cdefghij",   "cdefghij",    0),
+    TEST ("a<U0>b<U0>@2c",  "e<U0>",      "e<U0>",       0),
+    TEST ("<U0>ab<U0>@2c",  "e<U0>",      "e<U0>",       0),
+    TEST ("ab<U0>@2c<U0>",  "<U0>e",      "<U0>e",       0),
+
+    TEST ("e<U0>",          "a<U0>b<U0>@2c",  "a<U0>b<U0>@2c",   0),
+    TEST ("e<U0>@2",        "<U0>ab<U0>@2c",  "<U0>ab<U0>@2c",   0),
+    TEST ("<U0>e",          "ab<U0>@2c<U0>",  "ab<U0>@2c<U0>",   0),
+
+    TEST ("",               "x@4096",     "x@4096",      0),
+    TEST ("x@4096",         "",           "",            0),
+    TEST ("a@4096",         "b@4096",     "b@4096",      0),
+
+    TEST ("",               "x@207",      "x@207",       0),
+    TEST ("x@128",          "x@207",      "x@207",       0),
+    TEST ("x@540",          "x@207",      "x@207",       0),
+    TEST ("",               "x@1412",     "x@1412",      0),
+    TEST ("x@128",          "x@1412",     "x@1412",      0),
+    TEST ("x@3695",         "x@1412",     "x@1412",      0),
+    TEST ("x@872",          "x@873",      "x@873",       0),
+    TEST ("x@873",          "x@3695",     "x@3695",      0),
+
+    TEST ("",               0,            "",            0),
+    TEST ("abc",            0,            "abc",         0),
+    TEST ("a<U0>@2bc",      0,            "a<U0>@2bc",   0),
+    TEST ("<U0>@2abc",      0,            "<U0>@2abc",   0),
+    TEST ("abc<U0>@2",      0,            "abc<U0>@2",   0),
+    TEST ("x@4096",         0,            "x@4096",      0),
 
-    TEST ("last",       "test",       "test",        0)
+    TEST ("last",           "test",       "test",        0)
 };
 
 /**************************************************************************/
@@ -198,71 +198,71 @@
         arg, sizeof arg - 1, res, sizeof res - 1, bthrow        \
     }
 
-    //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- sequence to be assigned
-    //    |            |            +--------------- assign() n argument
-    //    |            |            |  +------------ expected result sequence
-    //    |            |            |  |     +------ exception info
-    //    |            |            |  |     |        0 - no exception
-    //    |            |            |  |     |        1 - out_of_range
-    //    |            |            |  |     |        2 - length_error
-    //    |            |            |  |     |       -1 - exc. safety
-    //    |            |            |  |     |
-    //    |            |            |  |     +--------+
-    //    V            V            V  V              V
-    TEST ("ab",        "c",         1, "c",           0),
-
-    TEST ("",          "",          0,  "",           0),
-    TEST ("",          "abc",       1,  "a",          0),
-    TEST ("",          "\0",        1,  "\0",         0),
-
-    TEST ("\0",        "",          0,  "",           0),
-    TEST ("\0",        "a",         0,  "",           0),
-    TEST ("\0",        "a",         1,  "a",          0),
-    TEST ("\0",        "\0\0",      1,  "\0",         0),
-    TEST ("\0",        "\0\0",      2,  "\0\0",       0),
-
-    TEST ("cde",       "ab",        2,  "ab",         0),
-    TEST ("cde",       "ab",        1,  "a",          0),
-
-    TEST ("\0e\0",     "a\0b\0\0c", 0,  "",           0),
-    TEST ("\0e\0",     "\0ab\0\0c", 3,  "\0ab",       0),
-    TEST ("\0e\0",     "a\0b\0\0c", 6,  "a\0b\0\0c",  0),
-
-    TEST ("a\0b\0\0c", "\0e\0",     3,  "\0e\0",      0),
-    TEST ("a\0b\0\0c", "\0\0e\0",   2,  "\0\0",       0),
-    TEST ("\0ab\0\0c", "\0e\0",     1,  "\0",         0),
-    TEST ("a\0bc\0\0", "\0e",       2,  "\0e",        0),
-
-    TEST ("",          0,           0,  "",           0),
-    TEST ("abc",       0,           0,  "",           0),
-    TEST ("abc",       0,           1,  "a",          0),
-    TEST ("abc",       0,           2,  "ab",         0),
-    TEST ("a\0bc",     0,           2,  "a\0",        0),
-    TEST ("\0abc\0\0", 0,           1,  "\0",         0),
-    TEST ("a\0bc\0\0", 0,           3,  "a\0b",       0),
-    TEST ("a\0bc\0\0", 0,           6,  "a\0bc\0\0",  0),
-    TEST ("x@4096",    0,        2048,  "x@2048",     0),
-
-    TEST ("",          "x@4096", 4096,  "x@4096",     0),
-    TEST ("abcd",      "x@4096",    0,  "",           0),
-    TEST ("x@4096",    "x@4096",    0,  "",           0),
-    TEST ("x@4096",    "x@4096",    1,  "x",          0),
-    TEST ("x@4096",    "",          0,  "",           0),
-    TEST ("a@4096",    "b@4096", 2048,  "b@2048",     0),
-
-    TEST ("",          "x@207",   207,  "x@207",      0),
-    TEST ("x@128",     "x@334",   207,  "x@207",      0),
-    TEST ("x@540",     "x@207",   128,  "x@128",      0),
-    TEST ("",          "x@1412",  873,  "x@873",      0),
-    TEST ("x@128",     "x@1412", 1412,  "x@1412",     0),
-    TEST ("x@3695",    "x@1412",  540,  "x@540",      0),
-    TEST ("x@872",     "x@873",   873,  "x@873",      0),
-    TEST ("x@873",     "x@3695", 2284,  "x@2284",     0),
+    //    +------------------------------------------ controlled sequence
+    //    |                +------------------------- sequence to be assigned
+    //    |                |            +------------ assign() n argument
+    //    |                |            |   +-------- expected result sequence
+    //    |                |            |   |     +-- exception info
+    //    |                |            |   |     |        0 - no exception
+    //    |                |            |   |     |        1 - out_of_range
+    //    |                |            |   |     |        2 - length_error
+    //    |                |            |   |     |       -1 - exc. safety
+    //    |                |            |   |     |
+    //    |                |            |   |     +----------+
+    //    V                V            V   V                V
+    TEST ("ab",            "c",         1,  "c",             0),
+
+    TEST ("",              "",          0,  "",              0),
+    TEST ("",              "abc",       1,  "a",             0),
+    TEST ("",              "<U0>",      1,  "<U0>",          0),
+
+    TEST ("<U0>",          "",          0,  "",              0),
+    TEST ("<U0>",          "a",         0,  "",              0),
+    TEST ("<U0>",          "a",         1,  "a",             0),
+    TEST ("<U0>",          "<U0>@2",    1,  "<U0>",          0),
+    TEST ("<U0>",          "<U0>@2",    2,  "<U0>@2",        0),
+
+    TEST ("cde",           "ab",        2,  "ab",            0),
+    TEST ("cde",           "ab",        1,  "a",             0),
+
+    TEST ("<U0>e<U0>",     "a<U0>b<U0>@2c", 0,  "",          0),
+    TEST ("<U0>e<U0>",     "<U0>ab<U0>@2c", 3,  "<U0>ab",    0),
+    TEST ("<U0>e<U0>",     "a<U0>b<U0>@2c", 6,  "a<U0>b<U0>@2c", 0),
+
+    TEST ("a<U0>b<U0>@2c", "<U0>e<U0>",     3,  "<U0>e<U0>", 0),
+    TEST ("a<U0>b<U0>@2c", "<U0>@2e<U0>",   2,  "<U0>@2",    0),
+    TEST ("<U0>ab<U0>@2c", "<U0>e<U0>",     1,  "<U0>",      0),
+    TEST ("a<U0>bc<U0>@2", "<U0>e",         2,  "<U0>e",     0),
+
+    TEST ("",              0,           0,  "",              0),
+    TEST ("abc",           0,           0,  "",              0),
+    TEST ("abc",           0,           1,  "a",             0),
+    TEST ("abc",           0,           2,  "ab",            0),
+    TEST ("a<U0>bc",       0,           2,  "a<U0>",         0),
+    TEST ("<U0>abc<U0>@2", 0,           1,  "<U0>",          0),
+    TEST ("a<U0>bc<U0>@2", 0,           3,  "a<U0>b",        0),
+    TEST ("a<U0>bc<U0>@2", 0,           6,  "a<U0>bc<U0>@2", 0),
+    TEST ("x@4096",        0,        2048,  "x@2048",        0),
+
+    TEST ("",              "x@4096", 4096,  "x@4096",        0),
+    TEST ("abcd",          "x@4096",    0,  "",              0),
+    TEST ("x@4096",        "x@4096",    0,  "",              0),
+    TEST ("x@4096",        "x@4096",    1,  "x",             0),
+    TEST ("x@4096",        "",          0,  "",              0),
+    TEST ("a@4096",        "b@4096", 2048,  "b@2048",        0),
+
+    TEST ("",              "x@207",   207,  "x@207",         0),
+    TEST ("x@128",         "x@334",   207,  "x@207",         0),
+    TEST ("x@540",         "x@207",   128,  "x@128",         0),
+    TEST ("",              "x@1412",  873,  "x@873",         0),
+    TEST ("x@128",         "x@1412", 1412,  "x@1412",        0),
+    TEST ("x@3695",        "x@1412",  540,  "x@540",         0),
+    TEST ("x@872",         "x@873",   873,  "x@873",         0),
+    TEST ("x@873",         "x@3695", 2284,  "x@2284",        0),
 
-    TEST ("",          "",         -1,  "",           2),
+    TEST ("",              "",         -1,  "",              2),
 
-    TEST ("last",      "test",      4, "test",        0)
+    TEST ("last",          "test",      4, "test",           0)
 };
 
 /**************************************************************************/
@@ -283,82 +283,82 @@
         arg, sizeof arg - 1, res, sizeof res - 1, bthrow        \
     }
 
-    //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- sequence to be inserted
-    //    |            |            +--------------- assign() pos argument
-    //    |            |            |  +------------ assign() n argument
-    //    |            |            |  |  +--------- expected result sequence
-    //    |            |            |  |  |  +------ exception info
-    //    |            |            |  |  |  |        0 - no exception
-    //    |            |            |  |  |  |        1 - out_of_range
-    //    |            |            |  |  |  |        2 - length_error
-    //    |            |            |  |  |  |       -1 - exc. safety
-    //    |            |            |  |  |  |
-    //    |            |            |  |  |  +-----------+
-    //    V            V            V  V  V              V
-    TEST ("ab",        "c",         0, 1, "c",           0),
-
-    TEST ("",          "",          0, 0,  "",           0),
-    TEST ("",          "abc",       1, 1,  "b",          0),
-    TEST ("",          "\0",        0, 1,  "\0",         0),
-
-    TEST ("\0",        "",          0, 0,  "",           0),
-
-    TEST ("abc",       "",          0, 0,  "",           0),
-
-    TEST ("\0",        "a",         0, 1,  "a",          0),
-    TEST ("\0",        "\0\0",      1, 1,  "\0",         0),
-    TEST ("\0",        "\0\0",      0, 2,  "\0\0",       0),
-    TEST ("\0",        "\0\0",      1, 5,  "\0",         0),
-
-    TEST ("cde",       "ab",        0, 2,  "ab",         0),
-    TEST ("cde",       "ab",        0, 1,  "a",          0),
-    TEST ("cde",       "ab",        1, 5,  "b",          0),
-
-    TEST ("ab",        "c\0e",      0, 3,  "c\0e",       0),
-    TEST ("ab",        "c\0e",      1, 2,  "\0e",        0),
-    TEST ("ab",        "c\0e",      0, 2,  "c\0",        0),
-
-    TEST ("\0e\0",     "\0ab\0\0c", 0, 9,  "\0ab\0\0c",  0),
-    TEST ("\0e\0",     "\0ab\0\0c", 0, 3,  "\0ab",       0),
-    TEST ("a\0b\0\0c", "\0e\0",     0, 3,  "\0e\0",      0),
-    TEST ("a\0b\0\0c", "\0\0e\0",   0, 2,  "\0\0",       0),
-    TEST ("\0ab\0\0c", "\0e\0",     2, 1,  "\0",         0),
-    TEST ("\0ab\0\0c", "\0e\0",     2, 9,  "\0",         0),
-    TEST ("a\0bc\0\0", "\0e",       0, 2,  "\0e",        0),
-
-    TEST ("",          0,           0, 0,  "",           0),
-    TEST ("abc",       0,           1, 0,  "",           0),
-    TEST ("abc",       0,           1, 1,  "b",          0),
-    TEST ("abc",       0,           0, 2,  "ab",         0),
-    TEST ("a\0bc\0\0", 0,           4, 2,  "\0\0",       0),
-    TEST ("a\0bc\0\0", 0,           1, 3,  "\0bc",       0),
-    TEST ("a\0bc\0\0", 0,           0, 9,  "a\0bc\0\0",  0),
-    TEST ("abcdef",    0,           1, 2,  "bc",         0),
-    TEST ("x@4096",    0,           1, 2,  "xx",         0),
-
-    TEST ("x@4096",    "",          0, 0,  "",           0),
-    TEST ("",          "x@4096",    9, 2,  "xx",         0),
-    TEST ("",          "x@4096",    9, 0,  "",           0),
-    TEST ("abc",       "x@4096",    2, 1,  "x",          0),
-    TEST ("x@4096",    "x@4096",    2, 3,  "xxx",        0),
-    TEST ("",          "x@4096",    0, 4096, "x@4096",   0),
-    TEST ("",          "x@4096",  100, 2000, "x@2000",   0),
-
-    TEST ("",          "x@207",     0, 207,  "x@207",    0),
-    TEST ("x@128",     "x@334",    10, 207,  "x@207",    0),
-    TEST ("x@540",     "x@207",    50, 128,  "x@128",    0),
-    TEST ("",          "x@1412",  128, 873,  "x@873",    0),
-    TEST ("x@128",     "x@1412",    0,1412,  "x@1412",   0),
-    TEST ("x@3695",    "x@1412",  207, 540,  "x@540",    0),
-    TEST ("x@872",     "x@874",     1, 873,  "x@873",    0),
-    TEST ("x@873",     "x@3695",   10, 2284, "x@2284",   0),
-
-    TEST ("",          "\0",        2, 0,  "",           1),
-    TEST ("",          "a",         2, 0,  "",           1),
-    TEST ("",          "x@4096", 4106, 0,  "",           1),
+    //    +------------------------------------------ controlled sequence
+    //    |                +------------------------- sequence to be inserted
+    //    |                |            +------------ assign() pos argument
+    //    |                |            |  +--------- assign() n argument
+    //    |                |            |  |  +------ expected result sequence
+    //    |                |            |  |  |  +--- exception info
+    //    |                |            |  |  |  |        0 - no exception
+    //    |                |            |  |  |  |        1 - out_of_range
+    //    |                |            |  |  |  |        2 - length_error
+    //    |                |            |  |  |  |       -1 - exc. safety
+    //    |                |            |  |  |  |
+    //    |                |            |  |  |  +---------------+
+    //    V                V            V  V  V                  V
+    TEST ("ab",            "c",         0, 1, "c",               0),
+
+    TEST ("",              "",          0, 0,  "",               0),
+    TEST ("",              "abc",       1, 1,  "b",              0),
+    TEST ("",              "<U0>",      0, 1,  "<U0>",           0),
+
+    TEST ("<U0>",          "",          0, 0,  "",               0),
+
+    TEST ("abc",           "",          0, 0,  "",               0),
+
+    TEST ("<U0>",          "a",         0, 1,  "a",              0),
+    TEST ("<U0>",          "<U0>@2",    1, 1,  "<U0>",           0),
+    TEST ("<U0>",          "<U0>@2",    0, 2,  "<U0>@2",         0),
+    TEST ("<U0>",          "<U0>@2",    1, 5,  "<U0>",           0),
+
+    TEST ("cde",           "ab",        0, 2,  "ab",             0),
+    TEST ("cde",           "ab",        0, 1,  "a",              0),
+    TEST ("cde",           "ab",        1, 5,  "b",              0),
+
+    TEST ("ab",            "c<U0>e",    0, 3,  "c<U0>e",         0),
+    TEST ("ab",            "c<U0>e",    1, 2,  "<U0>e",          0),
+    TEST ("ab",            "c<U0>e",    0, 2,  "c<U0>",          0),
+
+    TEST ("<U0>e<U0>",     "<U0>ab<U0>@2c", 0, 9,  "<U0>ab<U0>@2c", 0),
+    TEST ("<U0>e<U0>",     "<U0>ab<U0>@2c", 0, 3,  "<U0>ab",     0),
+    TEST ("a<U0>b<U0>@2c", "<U0>e<U0>",     0, 3,  "<U0>e<U0>",  0),
+    TEST ("a<U0>b<U0>@2c", "<U0>@2e<U0>",   0, 2,  "<U0>@2",     0),
+    TEST ("<U0>ab<U0>@2c", "<U0>e<U0>",     2, 1,  "<U0>",       0),
+    TEST ("<U0>ab<U0>@2c", "<U0>e<U0>",     2, 9,  "<U0>",       0),
+    TEST ("a<U0>bc<U0>@2", "<U0>e",         0, 2,  "<U0>e",      0),
+
+    TEST ("",              0,       0,     0,  "",               0),
+    TEST ("abc",           0,       1,     0,  "",               0),
+    TEST ("abc",           0,       1,     1,  "b",              0),
+    TEST ("abc",           0,       0,     2,  "ab",             0),
+    TEST ("a<U0>bc<U0>@2", 0,       4,     2,  "<U0>@2",         0),
+    TEST ("a<U0>bc<U0>@2", 0,       1,     3,  "<U0>bc",         0),
+    TEST ("a<U0>bc<U0>@2", 0,       0,     9,  "a<U0>bc<U0>@2",  0),
+    TEST ("abcdef",        0,       1,     2,  "bc",             0),
+    TEST ("x@4096",        0,       1,     2,  "xx",             0),
+
+    TEST ("x@4096",    "",          0,     0,  "",               0),
+    TEST ("",          "x@4096",    9,     2,  "xx",             0),
+    TEST ("",          "x@4096",    9,     0,  "",               0),
+    TEST ("abc",       "x@4096",    2,     1,  "x",              0),
+    TEST ("x@4096",    "x@4096",    2,     3,  "xxx",            0),
+    TEST ("",          "x@4096",    0,  4096, "x@4096",          0),
+    TEST ("",          "x@4096",  100,  2000, "x@2000",          0),
+
+    TEST ("",          "x@207",     0,   207,  "x@207",          0),
+    TEST ("x@128",     "x@334",    10,   207,  "x@207",          0),
+    TEST ("x@540",     "x@207",    50,   128,  "x@128",          0),
+    TEST ("",          "x@1412",  128,   873,  "x@873",          0),
+    TEST ("x@128",     "x@1412",    0,  1412,  "x@1412",         0),
+    TEST ("x@3695",    "x@1412",  207,   540,  "x@540",          0),
+    TEST ("x@872",     "x@874",     1,   873,  "x@873",          0),
+    TEST ("x@873",     "x@3695",   10,  2284, "x@2284",          0),
+
+    TEST ("",          "<U0>",      2,     0,  "",               1),
+    TEST ("",          "a",         2,     0,  "",               1),
+    TEST ("",          "x@4096", 4106,     0,  "",               1),
 
-    TEST ("last",      "test",      0, 4, "test",        0)
+    TEST ("last",      "test",      0,     4, "test",            0)
 };
 
 /**************************************************************************/
@@ -376,55 +376,55 @@
     }
 
     //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- assign() count argument
-    //    |            |   +------------------------ character to be assigned
-    //    |            |   |   +-------------------- expected result sequence
-    //    |            |   |   |       +------------ exception info
-    //    |            |   |   |       |              0 - no exception
-    //    |            |   |   |       |              1 - out_of_range
-    //    |            |   |   |       |              2 - length_error
-    //    |            |   |   |       |             -1 - exc. safety
-    //    |            |   |   |       |
-    //    |            |   |   |       +--------+
-    //    V            V   V   V                V
-    TEST ("ab",        1, 'c', "c",             0),
-
-    TEST ("",          0, ' ',  "",             0),
-    TEST ("",          1, 'b',  "b",            0),
-    TEST ("",          3, 'b',  "bbb",          0),
-
-    TEST ("\0",        0, ' ',  "",             0),
-    TEST ("",          2, '\0', "\0\0",         0),
-
-    TEST ("\0",        1, 'a',  "a",            0),
-    TEST ("\0",        1, '\0', "\0",           0),
-    TEST ("\0",        2, '\0', "\0\0",         0),
-    TEST ("\0",        0, '\0', "",             0),
-
-    TEST ("cde",       3, 'a',  "aaa",          0),
-    TEST ("ab",        2, '\0', "\0\0",         0),
-    TEST ("ab",        1, '\0', "\0",           0),
-
-    TEST ("a\0b\0\0c", 2, '\0', "\0\0",         0),
-    TEST ("a\0b\0\0c", 1, '\0', "\0",           0),
-    TEST ("\0ab\0\0c", 3, '\0', "\0\0\0",       0),
-    TEST ("a\0bc\0\0", 2, 'a',  "aa",           0),
-
-    TEST ("",       4096, 'x',  "x@4096",       0),
-    TEST ("x@4096",    0, 'x',  "",             0),
-
-    TEST ("x@127",   128, 'x', "x@128",         0),
-    TEST ("x@200",   207, 'x', "x@207",         0),
-    TEST ("x@334",   128, 'x', "x@128",         0),
-    TEST ("",        540, 'x', "x@540",         0),
-    TEST ("xx",      873, 'x', "x@873",         0),
-    TEST ("x@873",  1412, 'x', "x@1412",        0),
-    TEST ("x@3695",  207, 'x', "x@207",         0),
-    TEST ("x@540",  3695, 'x', "x@3695",        0),
+    //    |                +------------------------ assign() count argument
+    //    |                |   +-------------------- character to be assigned
+    //    |                |   |   +---------------- expected result sequence
+    //    |                |   |   |       +-------- exception info
+    //    |                |   |   |       |              0 - no exception
+    //    |                |   |   |       |              1 - out_of_range
+    //    |                |   |   |       |              2 - length_error
+    //    |                |   |   |       |             -1 - exc. safety
+    //    |                |   |   |       |
+    //    |                |   |   |       +--------+
+    //    V                V   V   V                V
+    TEST ("ab",            1, 'c', "c",             0),
+
+    TEST ("",              0, ' ',  "",             0),
+    TEST ("",              1, 'b',  "b",            0),
+    TEST ("",              3, 'b',  "bbb",          0),
+
+    TEST ("<U0>",          0, ' ',  "",             0),
+    TEST ("",              2, '\0', "<U0>@2",       0),
+
+    TEST ("<U0>",          1, 'a',  "a",            0),
+    TEST ("<U0>",          1, '\0', "<U0>",         0),
+    TEST ("<U0>",          2, '\0', "<U0>@2",       0),
+    TEST ("<U0>",          0, '\0', "",             0),
+
+    TEST ("cde",           3, 'a',  "aaa",          0),
+    TEST ("ab",            2, '\0', "<U0>@2",       0),
+    TEST ("ab",            1, '\0', "<U0>",         0),
+
+    TEST ("a<U0>b<U0>@2c", 2, '\0', "<U0>@2",       0),
+    TEST ("a<U0>b<U0>@2c", 1, '\0', "<U0>",         0),
+    TEST ("<U0>ab<U0>@2c", 3, '\0', "<U0>@3",       0),
+    TEST ("a<U0>bc<U0>@2", 2, 'a',  "aa",           0),
+
+    TEST ("",           4096, 'x',  "x@4096",       0),
+    TEST ("x@4096",        0, 'x',  "",             0),
+
+    TEST ("x@127",       128, 'x', "x@128",         0),
+    TEST ("x@200",       207, 'x', "x@207",         0),
+    TEST ("x@334",       128, 'x', "x@128",         0),
+    TEST ("",            540, 'x', "x@540",         0),
+    TEST ("xx",          873, 'x', "x@873",         0),
+    TEST ("x@873",      1412, 'x', "x@1412",        0),
+    TEST ("x@3695",      207, 'x', "x@207",         0),
+    TEST ("x@540",      3695, 'x', "x@3695",        0),
 
-    TEST ("",         -1, 'x',  "",             2),
+    TEST ("",             -1, 'x',  "",             2),
 
-    TEST ("last",      4, 't',  "tttt",         0)
+    TEST ("last",          4, 't',  "tttt",         0)
 };
 
 /**************************************************************************/
@@ -651,7 +651,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 == tdata.reslen_, 0, tcase.line,
                            "line %d. %{$FUNCALL}: expected %{/*.*Gs}, "

Modified: incubator/stdcxx/trunk/tests/strings/21.string.capacity.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.capacity.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.capacity.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.capacity.cpp Wed Jun 28 16:47:10 2006
@@ -69,43 +69,43 @@
     }
 
     //    +--------------------------------------- controlled sequence
-    //    |                 +--------------------- expected result
-    //    |                 |                   
-    //    |                 |                   
-    //    V                 V                   
-    TEST (0,                0),
-    TEST ("",               0),
-
-    TEST ("\0",             1),
-    TEST ("a",              1),
-    TEST (" ",              1),
-    TEST ("ab",             2),
-    TEST ("bc",             2),
-
-    TEST ("test string",   11),
-    TEST ("Test String",   11),
-
-    TEST ("t\0 s",          4),
-    TEST ("Test\0string",  11),
-
-    TEST ("\0a\0b",         4),
-    TEST ("a\0\0b",         4),
-    TEST ("a\0\0\0b",       5),
-    TEST ("a\0\0b\0",       5),
-    TEST ("a\0b\0\0c",      6),
-    TEST ("a\0b\0c\0\0",    7),
-
-    TEST ("x@128",        128),
-    TEST ("x@207",        207),
-    TEST ("x@334",        334),
-    TEST ("x@540",        540),
-    TEST ("x@873",        873),
-    TEST ("x@1412",      1412),
-    TEST ("x@2284",      2284),
-    TEST ("x@3695",      3695),
-    TEST ("x@4096",      4096),
+    //    |                    +------------------ expected result
+    //    |                    |                   
+    //    |                    |                   
+    //    V                    V                   
+    TEST (0,                   0),
+    TEST ("",                  0),
+
+    TEST ("<U0>",              1),
+    TEST ("a",                 1),
+    TEST (" ",                 1),
+    TEST ("ab",                2),
+    TEST ("bc",                2),
+
+    TEST ("test string",      11),
+    TEST ("Test String",      11),
+
+    TEST ("t<U0> s",           4),
+    TEST ("Test<U0>string",   11),
+
+    TEST ("<U0>a<U0>b",        4),
+    TEST ("a<U0>@2b",          4),
+    TEST ("a<U0>@3b",          5),
+    TEST ("a<U0>@2b<U0>",      5),
+    TEST ("a<U0>b<U0>@2c",     6),
+    TEST ("a<U0>b<U0>c<U0>@2", 7),
+
+    TEST ("x@128",           128),
+    TEST ("x@207",           207),
+    TEST ("x@334",           334),
+    TEST ("x@540",           540),
+    TEST ("x@873",           873),
+    TEST ("x@1412",         1412),
+    TEST ("x@2284",         2284),
+    TEST ("x@3695",         3695),
+    TEST ("x@4096",         4096),
 
-    TEST ("last",           4)
+    TEST ("last",              4)
 
 };
 
@@ -131,11 +131,11 @@
     TEST (0),     
     TEST (""),   
 
-    TEST ("\0"),    
+    TEST ("<U0>"),    
     TEST ("a"),       
 
     TEST ("test string"), 
-    TEST ("a\0b\0c\0\0"),  
+    TEST ("a<U0>b<U0>c<U0>@2"),  
 
     TEST ("x@128"),     
     TEST ("x@207"),    
@@ -160,59 +160,60 @@
         res, sizeof res - 1, bthrow            \
     }
 
-    //    +----------------------------------------- controlled sequence
-    //    |                +------------------------ new size
-    //    |                |     +------------------ value_type argument
-    //    |                |     |    +------------- expected result sequence
-    //    |                |     |    |                +-- exception info
-    //    |                |     |    |                |     0 - no exception
-    //    |                |     |    |                |     1 - length_error
-    //    |                |     |    |                |
-    //    V                V     V    V                V
-    TEST ("",              0,   'a',  "",              0),
-    TEST ("",              5,  '\0',  "\0\0\0\0\0",    0),
-    TEST ("",            334,   'x',  "x@334",         0),
-
-    TEST ("\0",            0,   'a',  "",              0),
-    TEST ("\0",            2,   'a',  "\0a",           0),
-    TEST ("\0",            1,   'a',  "\0",            0),
-    TEST ("\0",          128,   'a',  "\0a@127",       0),
-
-    TEST ("a",             0,   'a',  "",              0),
-    TEST ("a",             2,  '\0',  "a\0",           0),
-    TEST ("a",           540,   'a',  "a@540",         0),
-
-    TEST ("a\0\0\0b",     10,   'a',  "a\0\0\0baaaaa", 0),
-    TEST ("ab\0\0\0",     10,   'a',  "ab\0\0\0aaaaa", 0),
-    TEST ("\0\0\0ab",     10,   'a',  "\0\0\0abaaaaa", 0),
-    TEST ("a\0\0\0b",      7,  '\0',  "a\0\0\0b\0\0",  0),
-    TEST ("ab\0\0\0",      7,  '\0',  "ab\0\0\0\0\0",  0),
-    TEST ("\0\0\0ba",      7,  '\0',  "\0\0\0ba\0\0",  0),
-
-    TEST ("a\0b\0c\0\0",   6,   'a',  "a\0b\0c\0",     0),
-    TEST ("a\0b\0c\0\0",   5,  '\0',  "a\0b\0c",       0),
-    TEST ("\0ba\0c\0\0",   1,  '\0',  "\0",            0),
-    TEST ("\0ba\0c\0\0",   0,  '\0',  "",              0),
-
-    TEST ("x@540",       127,   'a',  "x@127",         0),
-    TEST ("x@873",       127,   'a',  "x@127",         0),
-    TEST ("x@1412",      127,   'a',  "x@127",         0),
-    TEST ("x@2284",      127,   'a',  "x@127",         0),
-
-    TEST ("x@127",       128,   'a',  "x@127a",        0),
-    TEST ("x@128",       207,   'a',  "x@128a@79",     0),
-    TEST ("x@207",       334,   'a',  "x@207a@127",    0),
-    TEST ("x@334",       540,   'a',  "x@334a@206",    0),
-    TEST ("x@540",       873,   'a',  "x@540a@333",    0),
-    TEST ("x@873",      1412,   'a',  "x@873a@539",    0),
-    TEST ("x@1412",     2284,   'a',  "x@1412a@872",   0),
-    TEST ("x@2284",     3695,   'a',  "x@2284a@1411",  0),
-
-    TEST ("",           NPOS,   'a',  "",              1),
-    TEST ("abc",        NPOS,   'a',  "abc",           1),
-    TEST ("x@3695",     NPOS,   'a',  "x@3695",        1),
+    //    +------------------------------------------ controlled sequence
+    //    |                      +------------------- new size
+    //    |                      |     +------------- value_type argument
+    //    |                      |     |    +-------- expected result sequence
+    //    |                      |     |    |      +- exception info
+    //    |                      |     |    |      |     0 - no exception
+    //    |                      |     |    |      |     1 - length_error
+    //    |                      |     |    |      |    
+    //    |                      |     |    |      +-----------+
+    //    V                      V     V    V                  V
+    TEST ("",                    0,   'a',  "",                0),
+    TEST ("",                    5,  '\0',  "<U0>@3<U0>@2",    0),
+    TEST ("",                  334,   'x',  "x@334",           0),
+
+    TEST ("<U0>",                0,   'a',  "",                0),
+    TEST ("<U0>",                2,   'a',  "<U0>a",           0),
+    TEST ("<U0>",                1,   'a',  "<U0>",            0),
+    TEST ("<U0>",              128,   'a',  "<U0>a@127",       0),
+
+    TEST ("a",                   0,   'a',  "",                0),
+    TEST ("a",                   2,  '\0',  "a<U0>",           0),
+    TEST ("a",                 540,   'a',  "a@540",           0),
+
+    TEST ("a<U0>@3b",           10,   'a',  "a<U0>@3baaaaa",   0),
+    TEST ("ab<U0>@3",           10,   'a',  "ab<U0>@3aaaaa",   0),
+    TEST ("<U0>@3ab",           10,   'a',  "<U0>@3abaaaaa",   0),
+    TEST ("a<U0>@3b",            7,  '\0',  "a<U0>@3b<U0>@2",  0),
+    TEST ("ab<U0>@3",            7,  '\0',  "ab<U0>@3<U0>@2",  0),
+    TEST ("<U0>@3ba",            7,  '\0',  "<U0>@3ba<U0>@2",  0),
+
+    TEST ("a<U0>b<U0>c<U0>@2",   6,   'a',  "a<U0>b<U0>c<U0>", 0),
+    TEST ("a<U0>b<U0>c<U0>@2",   5,  '\0',  "a<U0>b<U0>c",     0),
+    TEST ("<U0>ba<U0>c<U0>@2",   1,  '\0',  "<U0>",            0),
+    TEST ("<U0>ba<U0>c<U0>@2",   0,  '\0',  "",                0),
+
+    TEST ("x@540",             127,   'a',  "x@127",           0),
+    TEST ("x@873",             127,   'a',  "x@127",           0),
+    TEST ("x@1412",            127,   'a',  "x@127",           0),
+    TEST ("x@2284",            127,   'a',  "x@127",           0),
+
+    TEST ("x@127",             128,   'a',  "x@127a",          0),
+    TEST ("x@128",             207,   'a',  "x@128a@79",       0),
+    TEST ("x@207",             334,   'a',  "x@207a@127",      0),
+    TEST ("x@334",             540,   'a',  "x@334a@206",      0),
+    TEST ("x@540",             873,   'a',  "x@540a@333",      0),
+    TEST ("x@873",            1412,   'a',  "x@873a@539",      0),
+    TEST ("x@1412",           2284,   'a',  "x@1412a@872",     0),
+    TEST ("x@2284",           3695,   'a',  "x@2284a@1411",    0),
+
+    TEST ("",                 NPOS,   'a',  "",                1),
+    TEST ("abc",              NPOS,   'a',  "abc",             1),
+    TEST ("x@3695",           NPOS,   'a',  "x@3695",          1),
 
-    TEST ("last",          4,   't',  "last",          0)
+    TEST ("last",                4,   't',  "last",            0)
 
 };
 
@@ -230,58 +231,58 @@
         res, sizeof res - 1, bthrow         \
     }
 
-    //    +--------------------------------------- controlled sequence
-    //    |                +---------------------- new size
-    //    |                |    +----------------- expected result sequence
-    //    |                |    |           +----- exception info
-    //    |                |    |           |          0 - no exception
-    //    |                |    |           |          1 - length_error
-    //    |                |    |           |
-    //    V                V    V           V    
-    TEST ("",              0,   "",         0),
-    TEST ("",              5,   "",         0),
-    TEST ("",            334,   "",         0),
-
-    TEST ("\0",            0,   "",         0),
-    TEST ("\0",            2,   "\0",       0),
-    TEST ("\0",            1,   "\0",       0),
-    TEST ("\0",          127,   "\0",       0),
-
-    TEST ("a",             0,   "",         0),
-    TEST ("a",             2,   "a",        0),
-    TEST ("a",           539,   "a",        0),
-
-    TEST ("a\0\0\0b",     10,   "a\0\0\0b", 0),
-    TEST ("ab\0\0\0",     10,   "ab\0\0\0", 0),
-    TEST ("\0\0\0ab",     10,   "\0\0\0ab", 0),
-    TEST ("a\0\0\0b",      7,   "a\0\0\0b", 0),
-    TEST ("ab\0\0\0",      7,   "ab\0\0\0", 0),
-    TEST ("\0\0\0ba",      7,   "\0\0\0ba", 0),
-
-    TEST ("a\0b\0c\0\0",   5,   "a\0b\0c",  0),
-    TEST ("a\0b\0c\0\0",   4,   "a\0b\0",   0),
-    TEST ("\0ba\0c\0\0",   1,   "\0",       0),
-    TEST ("\0ba\0c\0\0",   0,   "",         0),
-
-    TEST ("x@540",       127,   "x@127",    0),
-    TEST ("x@873",       127,   "x@127",    0),
-    TEST ("x@1412",      127,   "x@127",    0),
-    TEST ("x@2284",      127,   "x@127",    0),
-
-    TEST ("x@127",       128,   "x@127",    0),
-    TEST ("x@128",       207,   "x@128",    0),
-    TEST ("x@207",       334,   "x@207",    0),
-    TEST ("x@334",       540,   "x@334",    0),
-    TEST ("x@540",       873,   "x@540",    0),
-    TEST ("x@873",      1412,   "x@873",    0),
-    TEST ("x@1412",     2284,   "x@1412",   0),
-    TEST ("x@2284",     3695,   "x@2284",   0),
-
-    TEST ("",           NPOS,   "",         1),
-    TEST ("abc",        NPOS,   "abc",      1),
-    TEST ("x@3695",     NPOS,   "x@3695",   1),
+    //    +------------------------------------------ controlled sequence
+    //    |                      +------------------- new size
+    //    |                      |    +-------------- expected result sequence
+    //    |                      |    |              +-- exception info
+    //    |                      |    |              |      0 - no exception
+    //    |                      |    |              |      1 - length_error
+    //    |                      |    |              |
+    //    V                      V    V              V    
+    TEST ("",                    0,   "",            0),
+    TEST ("",                    5,   "",            0),
+    TEST ("",                  334,   "",            0),
+
+    TEST ("<U0>",                0,   "",            0),
+    TEST ("<U0>",                2,   "<U0>",        0),
+    TEST ("<U0>",                1,   "<U0>",        0),
+    TEST ("<U0>",              127,   "<U0>",        0),
+
+    TEST ("a",                   0,   "",            0),
+    TEST ("a",                   2,   "a",           0),
+    TEST ("a",                 539,   "a",           0),
+
+    TEST ("a<U0>@3b",           10,   "a<U0>@3b",    0),
+    TEST ("ab<U0>@3",           10,   "ab<U0>@3",    0),
+    TEST ("<U0>@3ab",           10,   "<U0>@3ab",    0),
+    TEST ("a<U0>@3b",            7,   "a<U0>@3b",    0),
+    TEST ("ab<U0>@3",            7,   "ab<U0>@3",    0),
+    TEST ("<U0>@3ba",            7,   "<U0>@3ba",    0),
+
+    TEST ("a<U0>b<U0>c<U0>@2",   5,   "a<U0>b<U0>c", 0),
+    TEST ("a<U0>b<U0>c<U0>@2",   4,   "a<U0>b<U0>",  0),
+    TEST ("<U0>ba<U0>c<U0>@2",   1,   "<U0>",        0),
+    TEST ("<U0>ba<U0>c<U0>@2",   0,   "",            0),
+
+    TEST ("x@540",             127,   "x@127",       0),
+    TEST ("x@873",             127,   "x@127",       0),
+    TEST ("x@1412",            127,   "x@127",       0),
+    TEST ("x@2284",            127,   "x@127",       0),
+
+    TEST ("x@127",             128,   "x@127",       0),
+    TEST ("x@128",             207,   "x@128",       0),
+    TEST ("x@207",             334,   "x@207",       0),
+    TEST ("x@334",             540,   "x@334",       0),
+    TEST ("x@540",             873,   "x@540",       0),
+    TEST ("x@873",            1412,   "x@873",       0),
+    TEST ("x@1412",           2284,   "x@1412",      0),
+    TEST ("x@2284",           3695,   "x@2284",      0),
+
+    TEST ("",                 NPOS,   "",            1),
+    TEST ("abc",              NPOS,   "abc",         1),
+    TEST ("x@3695",           NPOS,   "x@3695",      1),
 
-    TEST ("last",          4,   "last",     0)
+    TEST ("last",                4,   "last",        0)
 
 };
 
@@ -307,11 +308,11 @@
     TEST (0), 
     TEST (""),   
 
-    TEST ("\0"),    
+    TEST ("<U0>"),    
     TEST ("a"),       
 
     TEST ("test string"), 
-    TEST ("a\0b\0c\0\0"),  
+    TEST ("a<U0>b<U0>c<U0>@2"),  
 
     TEST ("x@128"),     
     TEST ("x@207"),    
@@ -341,52 +342,52 @@
     }
 
     //    +--------------------------------------- controlled sequence
-    //    |                +---------------------- requested capacity
-    //    |                |    +----------------- exception info
-    //    |                |    |                   0 - no exception
-    //    |                |    |                   1 - length_error
-    //    |                |    |    
-    //    V                V    V    
-    TEST ("",              0,   0),
-    TEST ("",              5,   0),
-    TEST ("",            334,   0),
-
-    TEST ("\0",            0,   0),
-    TEST ("\0",            2,   0),
-    TEST ("\0",            1,   0),
-    TEST ("\0",          127,   0),
-
-    TEST ("a",             0,   0),
-    TEST ("a",             2,   0),
-    TEST ("a",           539,   0),
-
-    TEST ("a\0\0\0b",     10,   0),
-    TEST ("ab\0\0\0",     10,   0),
-    TEST ("\0\0\0ab",     10,   0),
-    TEST ("a\0b\0c\0\0",   5,   0),
-    TEST ("a\0b\0c\0\0",   4,   0),
-    TEST ("\0ba\0c\0\0",   1,   0),
-    TEST ("\0ba\0c\0\0",   0,   0),
-
-    TEST ("x@540",       127,   0),
-    TEST ("x@873",       127,   0),
-    TEST ("x@1412",      127,   0),
-    TEST ("x@2284",      127,   0),
-
-    TEST ("x@127",      1412,   0),
-    TEST ("x@128",      1412,   0),
-    TEST ("x@206",       207,   0),
-    TEST ("x@333",       334,   0),
-    TEST ("x@540",       540,   0),
-    TEST ("x@873",       873,   0),
-    TEST ("x@1412",     2284,   0),
-    TEST ("x@2284",     3695,   0),
-
-    TEST ("",           NPOS,   1),
-    TEST ("abc",        NPOS,   1),
-    TEST ("x@3695",     NPOS,   1),
+    //    |                      +---------------- requested capacity
+    //    |                      |    +----------- exception info
+    //    |                      |    |               0 - no exception
+    //    |                      |    |               1 - length_error
+    //    |                      |    |    
+    //    V                      V    V    
+    TEST ("",                    0,   0),
+    TEST ("",                    5,   0),
+    TEST ("",                  334,   0),
+
+    TEST ("<U0>",                0,   0),
+    TEST ("<U0>",                2,   0),
+    TEST ("<U0>",                1,   0),
+    TEST ("<U0>",              127,   0),
+
+    TEST ("a",                   0,   0),
+    TEST ("a",                   2,   0),
+    TEST ("a",                 539,   0),
+
+    TEST ("a<U0>@3b",           10,   0),
+    TEST ("ab<U0>@3",           10,   0),
+    TEST ("<U0>@3ab",           10,   0),
+    TEST ("a<U0>b<U0>c<U0>@2",   5,   0),
+    TEST ("a<U0>b<U0>c<U0>@2",   4,   0),
+    TEST ("<U0>ba<U0>c<U0>@2",   1,   0),
+    TEST ("<U0>ba<U0>c<U0>@2",   0,   0),
+
+    TEST ("x@540",             127,   0),
+    TEST ("x@873",             127,   0),
+    TEST ("x@1412",            127,   0),
+    TEST ("x@2284",            127,   0),
+
+    TEST ("x@127",            1412,   0),
+    TEST ("x@128",            1412,   0),
+    TEST ("x@206",             207,   0),
+    TEST ("x@333",             334,   0),
+    TEST ("x@540",             540,   0),
+    TEST ("x@873",             873,   0),
+    TEST ("x@1412",           2284,   0),
+    TEST ("x@2284",           3695,   0),
+
+    TEST ("",                 NPOS,   1),
+    TEST ("abc",              NPOS,   1),
+    TEST ("x@3695",           NPOS,   1),
 
-    TEST ("last",          4,   0)
+    TEST ("last",                4,   0)
 };
 
 /**************************************************************************/
@@ -408,11 +409,11 @@
     //    |                
     //    V               
     TEST (""),
-    TEST ("\0"),
+    TEST ("<U0>"),
     TEST ("a"),
 
-    TEST ("a\0\0\0b"),
-    TEST ("a\0b\0c\0\0"),
+    TEST ("a<U0>@3b"),
+    TEST ("a<U0>b<U0>c<U0>@2"),
 
     TEST ("x@127"),
     TEST ("x@128"),
@@ -448,11 +449,11 @@
     TEST (0), 
     TEST (""),   
 
-    TEST ("\0"),    
+    TEST ("<U0>"),    
     TEST ("a"),       
 
     TEST ("test string"), 
-    TEST ("a\0b\0c\0\0"),  
+    TEST ("a<U0>b<U0>c<U0>@2"),  
 
     TEST ("x@128"),     
     TEST ("x@207"),    
@@ -482,21 +483,21 @@
     }
 
     //    +------------------------------ controlled sequence
-    //    |          +------------------- expected result              
-    //    |          |                     
-    //    |          |                     
-    //    V          V
-    TEST (0,         1), 
-    TEST ("",        1),   
-
-    TEST ("\0",      0),    
-    TEST ("a",       0),       
-    TEST ("\0ab\0c", 0),  
+    //    |              +--------------- expected result              
+    //    |              |                     
+    //    |              |                     
+    //    V              V
+    TEST (0,             1), 
+    TEST ("",            1),   
+
+    TEST ("<U0>",        0),    
+    TEST ("a",           0),       
+    TEST ("<U0>ab<U0>c", 0),  
 
-    TEST ("x@128",   0),     
-    TEST ("x@3695",  0), 
+    TEST ("x@128",       0),     
+    TEST ("x@3695",      0), 
 
-    TEST ("last",    0) 
+    TEST ("last",        0) 
 };
 
 /**************************************************************************/
@@ -683,7 +684,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}, "
@@ -697,7 +698,7 @@
             if (func.which_ == StringIds::resize_size) {
 
                 std::size_t match =
-                    rw_match (tcase.res, str.data (), tcase.nres);
+                    rw_match (tcase.res, str.data (), res_len);
 
                 rw_assert (match == res_len, 0, tcase.line,
                            "line %d. %{$FUNCALL} expected %{#*s}, "

Modified: incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.cons.cpp Wed Jun 28 16:47:10 2006
@@ -78,34 +78,34 @@
     }
 
     //    +----------------------------------------- source sequence
-    //    |             +--------------------------- expected result sequence
-    //    |             |             
-    //    |             |            
-    //    V             V           
-    TEST ("ab",         "ab"),    
-
-    TEST ("",           ""),   
-    TEST ("\0",         ""),   
-
-    TEST ("a",          "a"),       
-    TEST ("bcd",        "bcd"),       
-    TEST ("cdefaihjb",  "cdefaihjb"),      
-
-    TEST ("\0\0ab",     ""),  
-    TEST ("a\0\0b",     "a"), 
-    TEST ("ab\0\0",     "ab"),  
-    TEST ("abefdcc\0a", "abefdcc"),  
-
-    TEST ("x@128",      "x@128"),
-    TEST ("x@207",      "x@207"),
-    TEST ("x@334",      "x@334"),
-    TEST ("x@540",      "x@540"),
-    TEST ("x@873",      "x@873"),
-    TEST ("x@1412",     "x@1412"),
-    TEST ("x@3695",     "x@3695"),
-    TEST ("x@4096",     "x@4096"),     
+    //    |               +------------------------- expected result sequence
+    //    |               |             
+    //    |               |            
+    //    V               V           
+    TEST ("ab",           "ab"),    
+
+    TEST ("",             ""),   
+    TEST ("<U0>",         ""),   
+
+    TEST ("a",            "a"),       
+    TEST ("bcd",          "bcd"),       
+    TEST ("cdefaihjb",    "cdefaihjb"),      
+
+    TEST ("<U0>@2ab",     ""),  
+    TEST ("a<U0>@2b",     "a"), 
+    TEST ("ab<U0>@2",     "ab"),  
+    TEST ("abefdcc<U0>a", "abefdcc"),  
+
+    TEST ("x@128",        "x@128"),
+    TEST ("x@207",        "x@207"),
+    TEST ("x@334",        "x@334"),
+    TEST ("x@540",        "x@540"),
+    TEST ("x@873",        "x@873"),
+    TEST ("x@1412",       "x@1412"),
+    TEST ("x@3695",       "x@3695"),
+    TEST ("x@4096",       "x@4096"),     
 
-    TEST ("last test",  "last test")
+    TEST ("last test",    "last test")
 };
 
 /**************************************************************************/
@@ -123,35 +123,35 @@
     }
 
     //    +----------------------------------------- source sequence
-    //    |             +--------------------------- expected result sequence
-    //    |             |             
-    //    |             |            
-    //    V             V           
-    TEST ("ab",         "ab"),    
-
-    TEST ("",           ""),   
-    TEST ("\0",         "\0"),
-    TEST ("\0\0",       "\0\0"),
-
-    TEST ("a",          "a"),       
-    TEST ("bcd",        "bcd"),       
-    TEST ("cdefaihjb",  "cdefaihjb"),      
-
-    TEST ("\0\0ab",     "\0\0ab"),  
-    TEST ("a\0\0b",     "a\0\0b"), 
-    TEST ("ab\0\0",     "ab\0\0"),  
-    TEST ("abefdcc\0a", "abefdcc\0a"),  
-
-    TEST ("x@128",      "x@128"),
-    TEST ("x@207",      "x@207"),
-    TEST ("x@334",      "x@334"),
-    TEST ("x@540",      "x@540"),
-    TEST ("x@873",      "x@873"),
-    TEST ("x@1412",     "x@1412"),
-    TEST ("x@3695",     "x@3695"),
-    TEST ("x@4096",     "x@4096"),     
+    //    |               +------------------------- expected result sequence
+    //    |               |             
+    //    |               |            
+    //    V               V           
+    TEST ("ab",           "ab"),    
+
+    TEST ("",             ""),   
+    TEST ("<U0>",         "<U0>"),
+    TEST ("<U0>@2",       "<U0>@2"),
+
+    TEST ("a",            "a"),       
+    TEST ("bcd",          "bcd"),       
+    TEST ("cdefaihjb",    "cdefaihjb"),      
+
+    TEST ("<U0>@2ab",     "<U0>@2ab"),  
+    TEST ("a<U0>@2b",     "a<U0>@2b"), 
+    TEST ("ab<U0>@2",     "ab<U0>@2"),  
+    TEST ("abefdcc<U0>a", "abefdcc<U0>a"),  
+
+    TEST ("x@128",        "x@128"),
+    TEST ("x@207",        "x@207"),
+    TEST ("x@334",        "x@334"),
+    TEST ("x@540",        "x@540"),
+    TEST ("x@873",        "x@873"),
+    TEST ("x@1412",       "x@1412"),
+    TEST ("x@3695",       "x@3695"),
+    TEST ("x@4096",       "x@4096"),     
 
-    TEST ("last test",  "last test")
+    TEST ("last test",    "last test")
 };
 
 /**************************************************************************/
@@ -169,39 +169,39 @@
     }
 
     //    +----------------------------------------- source sequence
-    //    |             +--------------------------- ctor n argument
-    //    |             |  +------------------------ expected result sequence
-    //    |             |  |             
-    //    |             |  |            
-    //    V             V  V         
-    TEST ("ab",         2, "ab"),    
-
-    TEST ("",           0, ""),   
-    TEST ("\0",         1, "\0"),   
-
-    TEST ("a",          1, "a"),       
-    TEST ("bcd",        3, "bcd"),       
-    TEST ("cdefaihjb",  9, "cdefaihjb"),      
-
-    TEST ("\0\0ab",     1, "\0"),
-    TEST ("\0\0ab",     4, "\0\0ab"),
-    TEST ("a\0\0b",     4, "a\0\0b"), 
-    TEST ("ab\0\0",     3, "ab\0"),  
-    TEST ("abefdcc\0a", 7, "abefdcc"), 
-    TEST ("abefdcc\0a", 8, "abefdcc\0"), 
-    TEST ("abefdcc\0a", 9, "abefdcc\0a"), 
-
-    TEST ("x@207",    207, "x@207"),
-    TEST ("x@334",    207, "x@207"),
-    TEST ("x@207",    128, "x@128"),
-    TEST ("x@1412",   873, "x@873"),
-    TEST ("x@1412",  1412, "x@1412"),
-    TEST ("x@1412",   540, "x@540"),
-    TEST ("x@873",    873, "x@873"),
-    TEST ("x@3695",  2284, "x@2284"),
-    TEST ("x@4096",  4096, "x@4096"),     
+    //    |               +------------------------- ctor n argument
+    //    |               |  +---------------------- expected result sequence
+    //    |               |  |             
+    //    |               |  |            
+    //    V               V  V         
+    TEST ("ab",           2, "ab"),    
+
+    TEST ("",             0, ""),   
+    TEST ("<U0>",         1, "<U0>"),   
+
+    TEST ("a",            1, "a"),       
+    TEST ("bcd",          3, "bcd"),       
+    TEST ("cdefaihjb",    9, "cdefaihjb"),      
+
+    TEST ("<U0>@2ab",     1, "<U0>"),
+    TEST ("<U0>@2ab",     4, "<U0>@2ab"),
+    TEST ("a<U0>@2b",     4, "a<U0>@2b"), 
+    TEST ("ab<U0>@2",     3, "ab<U0>"),  
+    TEST ("abefdcc<U0>a", 7, "abefdcc"), 
+    TEST ("abefdcc<U0>a", 8, "abefdcc<U0>"), 
+    TEST ("abefdcc<U0>a", 9, "abefdcc<U0>a"), 
+
+    TEST ("x@207",      207, "x@207"),
+    TEST ("x@334",      207, "x@207"),
+    TEST ("x@207",      128, "x@128"),
+    TEST ("x@1412",     873, "x@873"),
+    TEST ("x@1412",    1412, "x@1412"),
+    TEST ("x@1412",     540, "x@540"),
+    TEST ("x@873",      873, "x@873"),
+    TEST ("x@3695",    2284, "x@2284"),
+    TEST ("x@4096",    4096, "x@4096"),     
 
-    TEST ("last test",  9, "last test")
+    TEST ("last test",    9, "last test")
 };
 
 /**************************************************************************/
@@ -219,50 +219,50 @@
     }
 
     //    +----------------------------------------- source sequence
-    //    |             +--------------------------- ctor off argument
-    //    |             |  +------------------------ expected result sequence
-    //    |             |  |              +--------- exception info
-    //    |             |  |              |             0 - no exception
-    //    |             |  |              |             1 - out_of_range
-    //    |             |  |              |
-    //    |             |  |              |
-    //    V             V  V              V
-    TEST ("ab",         0, "ab",          0),    
-
-    TEST ("",           0, "",            0),   
-    TEST ("\0",         0, "\0",          0),
-    TEST ("\0\0",       0, "\0\0",        0),
-    TEST ("\0\0",       1, "\0",          0),
-    TEST ("\0\0",       2, "",            0),
-
-    TEST ("a",          0, "a",           0),       
-    TEST ("bcd",        0, "bcd",         0),       
-    TEST ("cdefaihjb",  0, "cdefaihjb",   0),      
-
-    TEST ("\0\0ab",     0, "\0\0ab",      0), 
-    TEST ("\0\0ab",     1, "\0ab",        0),
-    TEST ("a\0\0b",     0, "a\0\0b",      0), 
-    TEST ("a\0\0b",     1, "\0\0b",       0), 
-    TEST ("a\0\0b",     2, "\0b",         0),
-    TEST ("ab\0\0",     0, "ab\0\0",      0), 
-    TEST ("ab\0\0",     2, "\0\0",        0),
-    TEST ("ab\0\0",     4, "",            0),
-    TEST ("abefdcc\0a", 0, "abefdcc\0a",  0),  
-    TEST ("abefdcc\0a", 7, "\0a",         0),
-
-    TEST ("x@207",      0, "x@207",       0),
-    TEST ("x@334",    127, "x@207",       0),
-    TEST ("x@1412",   872, "x@540",       0),
-    TEST ("x@1412",     0, "x@1412",      0),
-    TEST ("x@1412",   539, "x@873",       0),
-    TEST ("x@873",      0, "x@873",       0),
-    TEST ("x@3695",     0, "x@3695",      0), 
-    TEST ("x@4096",     0, "x@4096",      0),
+    //    |               +------------------------- ctor off argument
+    //    |               |  +---------------------- expected result sequence
+    //    |               |  |               +------ exception info
+    //    |               |  |               |          0 - no exception
+    //    |               |  |               |          1 - out_of_range
+    //    |               |  |               |
+    //    |               |  |               |
+    //    V               V  V               V
+    TEST ("ab",           0, "ab",           0),    
+
+    TEST ("",             0, "",             0),   
+    TEST ("<U0>",         0, "<U0>",         0),
+    TEST ("<U0>@2",       0, "<U0>@2",       0),
+    TEST ("<U0>@2",       1, "<U0>",         0),
+    TEST ("<U0>@2",       2, "",             0),
+
+    TEST ("a",            0, "a",            0),       
+    TEST ("bcd",          0, "bcd",          0),       
+    TEST ("cdefaihjb",    0, "cdefaihjb",    0),      
+
+    TEST ("<U0>@2ab",     0, "<U0>@2ab",     0), 
+    TEST ("<U0>@2ab",     1, "<U0>ab",       0),
+    TEST ("a<U0>@2b",     0, "a<U0>@2b",     0), 
+    TEST ("a<U0>@2b",     1, "<U0>@2b",      0), 
+    TEST ("a<U0>@2b",     2, "<U0>b",        0),
+    TEST ("ab<U0>@2",     0, "ab<U0>@2",     0), 
+    TEST ("ab<U0>@2",     2, "<U0>@2",       0),
+    TEST ("ab<U0>@2",     4, "",             0),
+    TEST ("abefdcc<U0>a", 0, "abefdcc<U0>a", 0),  
+    TEST ("abefdcc<U0>a", 7, "<U0>a",        0),
+
+    TEST ("x@207",        0, "x@207",        0),
+    TEST ("x@334",      127, "x@207",        0),
+    TEST ("x@1412",     872, "x@540",        0),
+    TEST ("x@1412",       0, "x@1412",       0),
+    TEST ("x@1412",     539, "x@873",        0),
+    TEST ("x@873",        0, "x@873",        0),
+    TEST ("x@3695",       0, "x@3695",       0), 
+    TEST ("x@4096",       0, "x@4096",       0),
 
-    TEST ("abc",        5, "abc",         1),
-    TEST ("x@4096",  4106, "x@4096",      1),
+    TEST ("abc",          5, "abc",          1),
+    TEST ("x@4096",    4106, "x@4096",       1),
  
-    TEST ("last test",  0, "last test",   0)
+    TEST ("last test",    0, "last test",    0)
 };
 
 /**************************************************************************/
@@ -283,44 +283,44 @@
     }
 
     //    +----------------------------------------- source sequence
-    //    |             +--------------------------- ctor off argument
-    //    |             |   +----------------------- ctor n argument
-    //    |             |   |  +-------------------- expected result sequence
-    //    |             |   |  |              +----- exception info
-    //    |             |   |  |              |         0 - no exception
-    //    |             |   |  |              |         1 - out_of_range
-    //    |             |   |  |              |
-    //    |             |   |  |              |
-    //    V             V   V  V              V
-    TEST ("ab",         0,  2, "ab",          0),    
-
-    TEST ("",           0,  0, "",            0),   
-    TEST ("\0",         0,  1, "\0",          0),
-    TEST ("\0\0",       0,  2, "\0\0",        0),
-
-    TEST ("a",          0,  1, "a",           0),       
-    TEST ("bcd",        0,  3, "bcd",         0),       
-    TEST ("cdefaihjb",  0,  9, "cdefaihjb",   0),      
-
-    TEST ("\0\0ab",     0,  4, "\0\0ab",      0),  
-    TEST ("a\0\0b",     0,  4, "a\0\0b",      0), 
-    TEST ("ab\0\0",     0,  4, "ab\0\0",      0),  
-    TEST ("abefdcc\0a", 0,  9, "abefdcc\0a",  0),  
-
-    TEST ("x@207",      0,  207, "x@207",     0),
-    TEST ("x@334",     10,  207, "x@207",     0),
-    TEST ("x@207",     50,  128, "x@128",     0),
-    TEST ("x@1412",   128,  873, "x@873",     0),
-    TEST ("x@1412",     0, 1412, "x@1412",    0),
-    TEST ("x@1412",   207,  540, "x@540",     0),
-    TEST ("x@874",      1,  873, "x@873",     0),
-    TEST ("x@3695",    10, 2284, "x@2284",    0),
-    TEST ("x@4096",     0, 4096, "x@4096",    0),     
+    //    |               +------------------------- ctor off argument
+    //    |               |   +--------------------- ctor n argument
+    //    |               |   |    +---------------- expected result sequence
+    //    |               |   |    |                +--- exception info
+    //    |               |   |    |                |       0 - no exception
+    //    |               |   |    |                |       1 - out_of_range
+    //    |               |   |    |                |
+    //    |               |   |    |                |
+    //    V               V   V    V                V
+    TEST ("ab",           0,  2,   "ab",            0),    
+
+    TEST ("",             0,  0,   "",              0),   
+    TEST ("<U0>",         0,  1,   "<U0>",          0),
+    TEST ("<U0>@2",       0,  2,   "<U0>@2",        0),
+
+    TEST ("a",            0,  1,   "a",             0),       
+    TEST ("bcd",          0,  3,   "bcd",           0),       
+    TEST ("cdefaihjb",    0,  9,   "cdefaihjb",     0),      
+
+    TEST ("<U0>@2ab",     0,  4,   "<U0>@2ab",      0),  
+    TEST ("a<U0>@2b",     0,  4,   "a<U0>@2b",      0), 
+    TEST ("ab<U0>@2",     0,  4,   "ab<U0>@2",      0),  
+    TEST ("abefdcc<U0>a", 0,  9,   "abefdcc<U0>a",  0),  
+
+    TEST ("x@207",        0,  207, "x@207",         0),
+    TEST ("x@334",       10,  207, "x@207",         0),
+    TEST ("x@207",       50,  128, "x@128",         0),
+    TEST ("x@1412",     128,  873, "x@873",         0),
+    TEST ("x@1412",       0, 1412, "x@1412",        0),
+    TEST ("x@1412",     207,  540, "x@540",         0),
+    TEST ("x@874",        1,  873, "x@873",         0),
+    TEST ("x@3695",      10, 2284, "x@2284",        0),
+    TEST ("x@4096",       0, 4096, "x@4096",        0),     
 
-    TEST ("abc",        5,  3,   "",          1), 
-    TEST ("x@4096",  4106,  3,   "",          1), 
+    TEST ("abc",          5,  3,   "",              1), 
+    TEST ("x@4096",    4106,  3,   "",              1), 
 
-    TEST ("last test",  0,  9, "last test",   0)
+    TEST ("last test",    0,  9,  "last test",      0)
 };
 
 /**************************************************************************/
@@ -344,12 +344,12 @@
     //    |          |    |            
     //    V          V    V         
     TEST (1,        'a',  "a"), 
-    TEST (1,        '\0', "\0"),
+    TEST (1,        '\0', "<U0>"),
 
     TEST (2,        'a',  "aa"), 
-    TEST (2,        '\0', "\0\0"),
+    TEST (2,        '\0', "<U0>@2"),
 
-    TEST (5,        '\0', "\0\0\0\0\0"),
+    TEST (5,        '\0', "<U0>@5"),
     TEST (10,       'a',  "aaaaaaaaaa"), 
 
     TEST (128,      'x',  "x@128"),
@@ -379,54 +379,54 @@
 
     //    +----------------------------------------- source sequence
     //    |          +------------------------------ argument sequence
-    //    |          |            +----------------- expected result sequence
-    //    |          |            |              +-- exception info
-    //    |          |            |              |      0 - no exception
-    //    |          |            |              |     -1 - excpetion safety 
-    //    |          |            |              |  
-    //    |          |            |              |            
-    //    V          V            V              V          
-    TEST ("",       "ab",         "ab",          0),    
-
-    TEST ("",       "",           "",            0),   
-    TEST ("abc",    "",           "",            0),   
-    TEST ("",       "\0",         "",            0), 
-    TEST ("abc",    "\0",         "",            0),
-
-    TEST ("",       "a",          "a",           0),  
-    TEST ("\0\0",   "a",          "a",           0), 
-    TEST ("a",      "bcd",        "bcd",         0),       
-    TEST ("x@4096", "bcd",        "bcd",         0), 
-    TEST ("",       "cdefaihjb",  "cdefaihjb",   0),      
-    TEST ("a\0b",   "cdefaihjb",  "cdefaihjb",   0),
-
-    TEST ("",       "\0\0ab",     "",            0),  
-    TEST ("c\0d",   "\0\0ab",     "",            0),
-    TEST ("",       "a\0\0b",     "a",           0), 
-    TEST ("bcd",    "a\0\0b",     "a",           0), 
-    TEST ("\0",     "ab\0\0",     "ab",          0), 
-    TEST ("x@4096", "ab\0\0",     "ab",          0), 
-    TEST ("\0a",    "abefdcc\0a", "abefdcc",     0),  
-    TEST ("x@4096", "abefdcc\0a", "abefdcc",     0),
-
-    TEST ("",       "x@207",      "x@207",       0),
-    TEST ("x@128",  "x@207",      "x@207",       0),
-    TEST ("x@540",  "x@207",      "x@207",       0),
-    TEST ("",       "x@1412",     "x@1412",      0),
-    TEST ("x@128",  "x@1412",     "x@1412",      0),
-    TEST ("x@3695", "x@1412",     "x@1412",      0),
-    TEST ("x@872",  "x@873",      "x@873",       0),
-    TEST ("x@873",  "x@3695",     "x@3695",      0),
-
-    TEST ("abc",    "x@4096",     "x@4096",      0),  
-
-    TEST ("",       0,            "",            0),
-    TEST ("a\0b\0", 0,            "a",           0), 
-    TEST ("x@4096", 0,            "x@4096",      0), 
+    //    |          |               +-------------- expected result sequence
+    //    |          |               |             +--- exception info
+    //    |          |               |             |      0 - no exception
+    //    |          |               |             |     -1 - excpetion safety 
+    //    |          |               |             |  
+    //    |          |               |             |            
+    //    V          V               V             V          
+    TEST ("",       "ab",           "ab",          0),    
+
+    TEST ("",       "",             "",            0),   
+    TEST ("abc",    "",             "",            0),   
+    TEST ("",       "<U0>",         "",            0), 
+    TEST ("abc",    "<U0>",         "",            0),
+
+    TEST ("",       "a",            "a",           0),  
+    TEST ("<U0>@2", "a",            "a",           0), 
+    TEST ("a",      "bcd",          "bcd",         0),       
+    TEST ("x@4096", "bcd",          "bcd",         0), 
+    TEST ("",       "cdefaihjb",    "cdefaihjb",   0),      
+    TEST ("a<U0>b", "cdefaihjb",    "cdefaihjb",   0),
+
+    TEST ("",       "<U0>@2ab",     "",            0),  
+    TEST ("c<U0>d", "<U0>@2ab",     "",            0),
+    TEST ("",       "a<U0>@2b",     "a",           0), 
+    TEST ("bcd",    "a<U0>@2b",     "a",           0), 
+    TEST ("<U0>",   "ab<U0>@2",     "ab",          0), 
+    TEST ("x@4096", "ab<U0>@2",     "ab",          0), 
+    TEST ("<U0>a",  "abefdcc<U0>a", "abefdcc",     0),  
+    TEST ("x@4096", "abefdcc<U0>a", "abefdcc",     0),
+
+    TEST ("",       "x@207",        "x@207",       0),
+    TEST ("x@128",  "x@207",        "x@207",       0),
+    TEST ("x@540",  "x@207",        "x@207",       0),
+    TEST ("",       "x@1412",       "x@1412",      0),
+    TEST ("x@128",  "x@1412",       "x@1412",      0),
+    TEST ("x@3695", "x@1412",       "x@1412",      0),
+    TEST ("x@872",  "x@873",        "x@873",       0),
+    TEST ("x@873",  "x@3695",       "x@3695",      0),
+
+    TEST ("abc",    "x@4096",       "x@4096",      0),  
+
+    TEST ("",              0,       "",            0),
+    TEST ("a<U0>b<U0>",    0,       "a",           0), 
+    TEST ("x@4096",        0,       "x@4096",      0), 
 
-    TEST ("abcd",   "x@4096",     "x@4096",      0), 
+    TEST ("abcd",   "x@4096",       "x@4096",      0), 
 
-    TEST ("",       "last test",  "last test",   0)
+    TEST ("",       "last test",    "last test",   0)
 };
 
 /**************************************************************************/
@@ -444,52 +444,52 @@
 
     //    +----------------------------------------- source sequence
     //    |          +------------------------------ argument sequence
-    //    |          |            +----------------- expected result sequence
-    //    |          |            |              +-- exception info
-    //    |          |            |              |      0 - no exception
-    //    |          |            |              |     -1 - excpetion safety 
-    //    |          |            |              |  
-    //    |          |            |              |            
-    //    V          V            V              V
-    TEST ("",       "ab",         "ab",          0),    
-
-    TEST ("",       "",           "",            0),   
-    TEST ("abc",    "",           "",            0),   
-    TEST ("",       "\0",         "\0",          0), 
-    TEST ("abc",    "\0",         "\0",          0),
-
-    TEST ("",       "a",          "a",           0),  
-    TEST ("\0\0",   "a",          "a",           0), 
-    TEST ("a",      "bcd",        "bcd",         0),       
-    TEST ("x@4096", "bcd",        "bcd",         0), 
-    TEST ("",       "cdefaihjb",  "cdefaihjb",   0),      
-    TEST ("a\0b",   "cdefaihjb",  "cdefaihjb",   0),
-
-    TEST ("",       "\0\0ab",     "\0\0ab",      0),  
-    TEST ("c\0d",   "\0\0ab",     "\0\0ab",      0),
-    TEST ("",       "a\0\0b",     "a\0\0b",      0), 
-    TEST ("bcd",    "a\0\0b",     "a\0\0b",      0), 
-    TEST ("\0",     "ab\0\0",     "ab\0\0",      0), 
-    TEST ("x@4096", "ab\0\0",     "ab\0\0",      0), 
-    TEST ("\0a",    "abefdcc\0a", "abefdcc\0a",  0),  
-    TEST ("x@4096", "abefdcc\0a", "abefdcc\0a",  0),
-
-    TEST ("",       "x@207",      "x@207",       0),
-    TEST ("x@128",  "x@207",      "x@207",       0),
-    TEST ("x@540",  "x@207",      "x@207",       0),
-    TEST ("",       "x@1412",     "x@1412",      0),
-    TEST ("x@128",  "x@1412",     "x@1412",      0),
-    TEST ("x@3695", "x@1412",     "x@1412",      0),
-    TEST ("x@872",  "x@873",      "x@873",       0),
-    TEST ("x@873",  "x@3695",     "x@3695",      0),
-
-    TEST ("abc",    "x@4096",     "x@4096",      0),   
-
-    TEST ("",       0,            "",            0),
-    TEST ("a\0b\0", 0,            "a\0b\0",      0), 
-    TEST ("x@4096", 0,            "x@4096",      0), 
+    //    |          |              +--------------- expected result sequence
+    //    |          |              |                +- exception info
+    //    |          |              |                |    0 - no exception
+    //    |          |              |                |   -1 - excpetion safety
+    //    |          |              |                |  
+    //    |          |              |                |            
+    //    V          V              V                V
+    TEST ("",       "ab",           "ab",            0),    
+
+    TEST ("",       "",             "",              0),   
+    TEST ("abc",    "",             "",              0),   
+    TEST ("",       "<U0>",         "<U0>",          0), 
+    TEST ("abc",    "<U0>",         "<U0>",          0),
+
+    TEST ("",       "a",            "a",             0),  
+    TEST ("<U0>@2", "a",            "a",             0), 
+    TEST ("a",      "bcd",          "bcd",           0),       
+    TEST ("x@4096", "bcd",          "bcd",           0), 
+    TEST ("",       "cdefaihjb",    "cdefaihjb",     0),      
+    TEST ("a<U0>b", "cdefaihjb",    "cdefaihjb",     0),
+ 
+    TEST ("",       "<U0>@2ab",     "<U0>@2ab",      0),  
+    TEST ("c<U0>d", "<U0>@2ab",     "<U0>@2ab",      0),
+    TEST ("",       "a<U0>@2b",     "a<U0>@2b",      0), 
+    TEST ("bcd",    "a<U0>@2b",     "a<U0>@2b",      0), 
+    TEST ("<U0>",   "ab<U0>@2",     "ab<U0>@2",      0), 
+    TEST ("x@4096", "ab<U0>@2",     "ab<U0>@2",      0), 
+    TEST ("<U0>a",  "abefdcc<U0>a", "abefdcc<U0>a",  0),  
+    TEST ("x@4096", "abefdcc<U0>a", "abefdcc<U0>a",  0),
+
+    TEST ("",       "x@207",        "x@207",         0),
+    TEST ("x@128",  "x@207",        "x@207",         0),
+    TEST ("x@540",  "x@207",        "x@207",         0),
+    TEST ("",       "x@1412",       "x@1412",        0),
+    TEST ("x@128",  "x@1412",       "x@1412",        0),
+    TEST ("x@3695", "x@1412",       "x@1412",        0),
+    TEST ("x@872",  "x@873",        "x@873",         0),
+    TEST ("x@873",  "x@3695",       "x@3695",        0),
+
+    TEST ("abc",    "x@4096",       "x@4096",        0),   
+
+    TEST ("",           0,          "",              0),
+    TEST ("a<U0>b<U0>", 0,          "a<U0>b<U0>",    0), 
+    TEST ("x@4096",     0,          "x@4096",        0), 
 
-    TEST ("",       "last test",  "last test",   0)
+    TEST ("",       "last test",    "last test",     0)
 };
 
 
@@ -515,12 +515,12 @@
     //    V          V    V         
     TEST ("",       'a',  "a"), 
     TEST ("abcdef", 'a',  "a"),
-    TEST ("",       '\0', "\0"),
-    TEST ("a",      '\0', "\0"),
-    TEST ("\0\0",   'x',  "x"),
+    TEST ("",       '\0', "<U0>"),
+    TEST ("a",      '\0', "<U0>"),
+    TEST ("<U0>@2", 'x',  "x"),
 
     TEST ("x@207",  'a',  "a"), 
-    TEST ("x@873",  '\0', "\0"),
+    TEST ("x@873",  '\0', "<U0>"),
     TEST ("x@2284", 't',  "t"),
     TEST ("x@4096", 'x',  "x"),
 
@@ -746,7 +746,7 @@
                 // (and only then), also verify that the modified
                 // string matches the expected result
                 const std::size_t match =
-                    rw_match (tcase.res, ret_ptr->c_str (), tcase.nres);
+                    rw_match (tcase.res, ret_ptr->c_str (), ret_ptr->size ());
 
                 rw_assert (match == tdata.reslen_, 0, tcase.line,
                            "line %d. %{$FUNCALL} expected %{/*.*Gs}, "
@@ -923,7 +923,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 == tdata.reslen_, 0, tcase.line,
                            "line %d. %{$FUNCALL} expected %{/*.*Gs}, "



Mime
View raw message