stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r417904 [3/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.copy.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp Wed Jun 28 16:47:10 2006
@@ -59,33 +59,33 @@
     }
 
     //    +--------------------------------------- controlled sequence
-    //    |                 +--------------------- copy() n argument
-    //    |                 |   +----------------- expected result sequence
-    //    |                 |   |     
-    //    V                 V   V             
-    TEST ("ab",             2,  "ab"),       
-
-    TEST ("",               0,  ""),         
-    TEST ("",              10,  ""),          
-
-    TEST ("\0",             1,  "\0"),       
-    TEST ("\0\0",           2,  "\0\0"),    
-
-    TEST ("abc",            0,  ""), 
-    TEST ("abc",            1,  "a"),                 
-    TEST ("abc",            2,  "ab"),       
-    TEST ("abc",            3,  "abc"), 
-    TEST ("abc",            5,  "abc"),
-
-    TEST ("a\0b\0\0c",     10,  "a\0b\0\0c"),  
-    TEST ("\0ab\0\0\0c\0",  1,  "\0"),
-    TEST ("\0ab\0\0\0c\0",  8,  "\0ab\0\0\0c\0"),
-    TEST ("\0ab\0\0\0c\0",  5,  "\0ab\0\0"),   
-    TEST ("\0\0ab\0\0c\0",  6,  "\0\0ab\0\0"), 
+    //    |                       +--------------- copy() n argument
+    //    |                       |   +----------- expected result sequence
+    //    |                       |   |     
+    //    V                       V   V             
+    TEST ("ab",                   2,  "ab"),       
+
+    TEST ("",                     0,  ""),         
+    TEST ("",                    10,  ""),          
+
+    TEST ("<U0>",                 1,  "<U0>"),       
+    TEST ("<U0>@2",               2,  "<U0>@2"),    
+
+    TEST ("abc",                  0,  ""), 
+    TEST ("abc",                  1,  "a"),                 
+    TEST ("abc",                  2,  "ab"),       
+    TEST ("abc",                  3,  "abc"), 
+    TEST ("abc",                  5,  "abc"),
+
+    TEST ("a<U0>b<U0>@2c",       10,  "a<U0>b<U0>@2c"),  
+    TEST ("<U0>ab<U0>@3c<U0>",    1,  "<U0>"),
+    TEST ("<U0>ab<U0>@3c<U0>",    8,  "<U0>ab<U0>@3c<U0>"),
+    TEST ("<U0>ab<U0>@3c<U0>",    5,  "<U0>ab<U0>@2"),   
+    TEST ("<U0>@2ab<U0>@2c<U0>",  6,  "<U0>@2ab<U0>@2"), 
 
-    TEST ("x@4096",      4096,  "x@4096"),
+    TEST ("x@4096",            4096,  "x@4096"),
 
-    TEST ("last",           4,  "last")       
+    TEST ("last",                 4,  "last")       
 };
 
 /**************************************************************************/
@@ -103,53 +103,55 @@
     }
 
     //    +------------------------------------------ controlled sequence
-    //    |                 +------------------------ copy() n argument
-    //    |                 |   +-------------------- copy() pos argument
-    //    |                 |   |  +----------------- expected result sequence
-    //    |                 |   |  |             +--- exception info:
-    //    |                 |   |  |             |      0 - no exception    
-    //    |                 |   |  |             |      1 - out_of_range        
-    //    V                 V   V  V             V  
-    TEST ("ab",             2,  0, "ab",         0),
-
-    TEST ("",               0,  0, "",           0),
-    TEST ("",              10,  0, "",           0),
-
-    TEST ("\0",             1,  0, "\0",         0),
-    TEST ("\0\0",           1,  1, "\0",         0),
-    TEST ("\0\0",           2,  0, "\0\0",       0),
-
-    TEST ("abc",            1,  0, "a",          0),
-    TEST ("abc",            1,  1, "b",          0),
-    TEST ("abc",            1,  2, "c",          0),
-
-    TEST ("abc",            0,  0, "",           0),
-    TEST ("abc",            2,  0, "ab",         0),
-    TEST ("abc",            2,  1, "bc",         0),
-    TEST ("abc",            3,  0, "abc",        0),
-    TEST ("abc",           10,  1, "bc",         0),
-    TEST ("abc",            3,  2, "c",          0),
-
-    TEST ("a\0b\0\0c",     10,  1, "\0b\0\0c",   0),
-    TEST ("a\0b\0\0c",     10,  0, "a\0b\0\0c",  0),
-    TEST ("a\0b\0\0c",      1,  1, "\0",         0),
-
-    TEST ("\0ab\0\0\0c\0", 10,  1, "ab\0\0\0c\0",0),
-    TEST ("\0ab\0\0\0c\0",  5,  0, "\0ab\0\0",   0),
-    TEST ("\0ab\0\0\0c\0",  3,  3, "\0\0\0",     0),
-
-    TEST ("\0\0ab\0\0c\0",  6,  0, "\0\0ab\0\0", 0),
-    TEST ("\0\0ab\0\0c\0",  4,  1, "\0ab\0",     0),
-
-    TEST ("x@4096",      4096,  0, "x@4096",     0),
-    TEST ("x@4096",         2,  1, "xx",         0),
-    TEST ("x@4096",      4096, 4095, "x",        0),
-
-    TEST ("\0",             0,  2, "",           1),
-    TEST ("a",              0, 10, "",           1),
-    TEST ("x@4096",         0, 4106, "",         1),
+    //    |                       +------------------ copy() n argument
+    //    |                       |   +-------------- copy() pos argument
+    //    |                       |   |  +----------- expected result sequence
+    //    |                       |   |  |       +--- exception info:
+    //    |                       |   |  |       |      0 - no exception    
+    //    |                       |   |  |       |      1 - out_of_range 
+    //    |                       |   |  |       |   
+    //    |                       |   |  |       +---------+   
+    //    V                       V   V  V                 V  
+    TEST ("ab",                   2,  0, "ab",             0),
+
+    TEST ("",                     0,  0, "",               0),
+    TEST ("",                    10,  0, "",               0),
+
+    TEST ("<U0>",                 1,  0, "<U0>",           0),
+    TEST ("<U0>@2",               1,  1, "<U0>",           0),
+    TEST ("<U0>@2",               2,  0, "<U0>@2",         0),
+
+    TEST ("abc",                  1,  0, "a",              0),
+    TEST ("abc",                  1,  1, "b",              0),
+    TEST ("abc",                  1,  2, "c",              0),
+
+    TEST ("abc",                  0,  0, "",               0),
+    TEST ("abc",                  2,  0, "ab",             0),
+    TEST ("abc",                  2,  1, "bc",             0),
+    TEST ("abc",                  3,  0, "abc",            0),
+    TEST ("abc",                 10,  1, "bc",             0),
+    TEST ("abc",                  3,  2, "c",              0),
+
+    TEST ("a<U0>b<U0>@2c",       10,  1, "<U0>b<U0>@2c",   0),
+    TEST ("a<U0>b<U0>@2c",       10,  0, "a<U0>b<U0>@2c",  0),
+    TEST ("a<U0>b<U0>@2c",        1,  1, "<U0>",           0),
+
+    TEST ("<U0>ab<U0>@3c<U0>",   10,  1, "ab<U0>@3c<U0>",  0),
+    TEST ("<U0>ab<U0>@3c<U0>",    5,  0, "<U0>ab<U0>@2",   0),
+    TEST ("<U0>ab<U0>@3c<U0>",    3,  3, "<U0>@3",         0),
+
+    TEST ("<U0>@2ab<U0>@2c<U0>",  6,  0, "<U0>@2ab<U0>@2", 0),
+    TEST ("<U0>@2ab<U0>@2c<U0>",  4,  1, "<U0>ab<U0>",     0),
+
+    TEST ("x@4096",            4096,  0, "x@4096",         0),
+    TEST ("x@4096",               2,  1, "xx",             0),
+    TEST ("x@4096",            4096, 4095, "x",            0),
+
+    TEST ("<U0>",                 0,  2, "",               1),
+    TEST ("a",                    0, 10, "",               1),
+    TEST ("x@4096",               0, 4106, "",             1),
 
-    TEST ("last",           4,  0, "last",       0)
+    TEST ("last",                 4,  0, "last",           0)
 };
 
 /**************************************************************************/
@@ -187,7 +189,7 @@
     // create destination array and initialize it with garbage
     charT* const s_res = new charT [min_len + 1];
 
-    char cgb = '@';
+    char cgb = '#';
     charT wcgb = make_char (cgb, (charT*)0);
     Traits::assign (s_res, min_len + 1, wcgb);
 
@@ -234,19 +236,22 @@
                    "line %d. %{$FUNCALL} == %zu, got %zu", 
                    __LINE__, res_len, res);
 
-        const std::size_t match = rw_match (tcase.res, s_res, tcase.nres);
-        bool success = match == res_len;
-
-        rw_assert (success, 0, tcase.line,
-                   "line %d. %{$FUNCALL} expected %{#*s}, "
-                   "got %{/*.*Gs}, differ at pos %zu",
-                   __LINE__, int (tcase.nres), tcase.res, 
-                   int (sizeof (charT)), int (res), s_res, match);
-
-        success = 1 == rw_match (&cgb, &s_res [min_len], 1);
-        rw_assert (success, 0, tcase.line,
-                   "line %d. %{$FUNCALL} detected writing past the end of "
-                   "the provided buffer", __LINE__);
+        if (res == res_len) 
+        {
+            const std::size_t match = rw_match (tcase.res, s_res, res_len);
+            bool success = match == res_len;
+
+            rw_assert (success, 0, tcase.line,
+                       "line %d. %{$FUNCALL} expected %{#*s}, "
+                       "got %{/*.*Gs}, differ at pos %zu",
+                       __LINE__, int (tcase.nres), tcase.res, 
+                       int (sizeof (charT)), int (res), s_res, match);
+
+            success = 1 == rw_match (&cgb, &s_res [min_len], 1);
+            rw_assert (success, 0, tcase.line,
+                       "line %d. %{$FUNCALL} detected writing past the end of "
+                       "the provided buffer", __LINE__);
+        }
     }
 
 #ifndef _RWSTD_NO_EXCEPTIONS

Modified: incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.erase.cpp Wed Jun 28 16:47:10 2006
@@ -58,21 +58,21 @@
         0, 0, res, sizeof res - 1, 0 }
 
     //    +--------------------------------- controlled sequence
-    //    |               +----------------- expected result sequence
-    //    |               |
-    //    V               V
-    TEST ("a",            ""),
-
-    TEST ("",             ""),
-    TEST ("\0",           ""),
-    TEST ("abc",          ""),
-    TEST ("t\0 s",        ""),
-    TEST ("\0ab\0\0c",    ""),
-    TEST ("a\0b\0\0c",    ""),
-    TEST ("a\0bc\0\0",    ""),
+    //    |                 +--------------- expected result sequence
+    //    |                 |
+    //    V                 V
+    TEST ("a",              ""),
+
+    TEST ("",               ""),
+    TEST ("<U0>",           ""),
+    TEST ("abc",            ""),
+    TEST ("t<U0> s",        ""),
+    TEST ("<U0>ab<U0>@2c",  ""),
+    TEST ("a<U0>b<U0>@2c",  ""),
+    TEST ("a<U0>bc<U0>@2",  ""),
 
-    TEST ("x@4096",       ""),
-    TEST ("last",         "")
+    TEST ("x@4096",         ""),
+    TEST ("last",           "")
 };
 
 
@@ -89,52 +89,52 @@
         0, 0, res, sizeof res - 1, bthrow }
 
     //    +-------------------------------------- controlled sequence
-    //    |               +---------------------- erase() pos argument
-    //    |               |    +----------------- expected result sequence
-    //    |               |    |             +--- exception info
-    //    |               |    |             |      0 - no exception
-    //    |               |    |             |      1 - out_of_range
-    //    |               |    |             |
-    //    V               V    V             V
-    TEST ("",             0,   "",           0),
-    TEST ("\0",           0,   "",           0),
-    TEST ("\0",           1,   "\0",         0),
-    TEST ("\0\0",         1,   "\0",         0),
-
-    TEST ("a",            0,   "",           0),
-    TEST ("a",            1,   "a",          0),
-
-    TEST ("abc",          0,   "",           0),
-    TEST ("abc",          1,   "a",          0),
-    TEST ("abc",          2,   "ab",         0),
-    TEST ("abc",          3,   "abc",        0),
-
-    TEST ("t\0 s",        0,   "",           0),
-    TEST ("t\0 s",        1,   "t",          0),
-    TEST ("t\0 s",        2,   "t\0",        0),
-    TEST ("t\0 s",        3,   "t\0 ",       0),
-    TEST ("t\0 s",        4,   "t\0 s",      0),
-
-    TEST ("a\0\0\0b",     2,   "a\0",        0),
-    TEST ("a\0\0\0b",     1,   "a",          0),
-    TEST ("a\0\0\0b",     0,   "",           0),
-    TEST ("a\0b\0\0c",    0,   "",           0),
-    TEST ("a\0b\0\0c",    4,   "a\0b\0",     0),
-    TEST ("\0ab\0\0c",    2,   "\0a",        0),
-    TEST ("ab\0c\0\0",    5,   "ab\0c\0",    0),
-
-    TEST ("a",            3,   "a",          1),
-    TEST ("t\0 s",        5,   "t\0 s",      1),
-    TEST ("ab\0c\0\0",   10,   "ab\0c\0\0",  1),
-    TEST ("x@4096",    4106,   "x@4096",     1),
-
-    TEST ("x@4096",        0,  "",           0),
-    TEST ("x@4096",        1,  "x",          0),
-    TEST ("x@4096",        4,  "xxxx",       0),
-    TEST ("x@4096",     4096,  "x@4096",     0),
-    TEST ("x@2048y@2048", 2048,"x@2048",     0),
+    //    |                   +------------------ erase() pos argument
+    //    |                   |    +------------- expected result sequence
+    //    |                   |    |                +--- exception info
+    //    |                   |    |                |      0 - no exception
+    //    |                   |    |                |      1 - out_of_range
+    //    |                   |    |                |
+    //    V                   V    V                V
+    TEST ("",                 0,   "",              0),
+    TEST ("<U0>",             0,   "",              0),
+    TEST ("<U0>",             1,   "<U0>",          0),
+    TEST ("<U0>@2",           1,   "<U0>",          0),
+
+    TEST ("a",                0,   "",              0),
+    TEST ("a",                1,   "a",             0),
+
+    TEST ("abc",              0,   "",              0),
+    TEST ("abc",              1,   "a",             0),
+    TEST ("abc",              2,   "ab",            0),
+    TEST ("abc",              3,   "abc",           0),
+
+    TEST ("t<U0> s",          0,   "",              0),
+    TEST ("t<U0> s",          1,   "t",             0),
+    TEST ("t<U0> s",          2,   "t<U0>",         0),
+    TEST ("t<U0> s",          3,   "t<U0> ",        0),
+    TEST ("t<U0> s",          4,   "t<U0> s",       0),
+
+    TEST ("a<U0>@3b",         2,   "a<U0>",         0),
+    TEST ("a<U0>@3b",         1,   "a",             0),
+    TEST ("a<U0>@3b",         0,   "",              0),
+    TEST ("a<U0>b<U0>@2c",    0,   "",              0),
+    TEST ("a<U0>b<U0>@2c",    4,   "a<U0>b<U0>",    0),
+    TEST ("<U0>ab<U0>@2c",    2,   "<U0>a",         0),
+    TEST ("ab<U0>c<U0>@2",    5,   "ab<U0>c<U0>",   0),
+
+    TEST ("a",                3,   "a",             1),
+    TEST ("t<U0> s",          5,   "t<U0> s",       1),
+    TEST ("ab<U0>c<U0>@2",   10,   "ab<U0>c<U0>@2", 1),
+    TEST ("x@4096",        4106,   "x@4096",        1),
+
+    TEST ("x@4096",           0,   "",              0),
+    TEST ("x@4096",           1,   "x",             0),
+    TEST ("x@4096",           4,   "xxxx",          0),
+    TEST ("x@4096",        4096,   "x@4096",        0),
+    TEST ("x@2048y@2048",  2048,   "x@2048",        0),
 
-    TEST ("last test",    4,   "last",       0)
+    TEST ("last test",        4,   "last",          0)
 };
 
 
@@ -155,73 +155,74 @@
         0, 0, res, sizeof res - 1, bthrow }
 
     //    +----------------------------------------- controlled sequence
-    //    |               +------------------------- erase() pos argument
-    //    |               |         +--------------- erase() n argument
-    //    |               |         |   +----------- expected result sequence
-    //    |               |         |   |             +--- exception info
-    //    |               |         |   |             |      0 - no exception
-    //    |               |         |   |             |      1 - out_of_range
-    //    |               |         |   |             |
-    //    V               V         V   V             V
-    TEST ("",             0,        0,  "",           0),
-    TEST ("\0",           0,        1,  "",           0),
-    TEST ("\0",           0,        0,  "\0",         0),
-    TEST ("\0",           1,        1,  "\0",         0),
-    TEST ("\0\0",         1,        1,  "\0",         0),
-    TEST ("\0\0",         0,        1,  "\0",         0),
-
-    TEST ("a",            0,        1,  "",           0),
-    TEST ("a",            0,        0,  "a",          0),
-    TEST ("a",            1,        1,  "a",          0),
-
-    TEST ("abc",          0,        3,  "",           0),
-    TEST ("abc",          0,        2,  "c",          0),
-    TEST ("abc",          1,        2,  "a",          0),
-    TEST ("abc",          1,        1,  "ac",         0),
-    TEST ("abc",          2,        1,  "ab",         0),
-    TEST ("abc",          3,        0,  "abc",        0),
-
-    TEST ("t\0 s",        0,        3,  "s",          0),
-    TEST ("t\0 s",        0,        4,  "",           0),
-    TEST ("t\0 s",        0,        1,  "\0 s",       0),
-    TEST ("t\0 s",        1,        3,  "t",          0),
-    TEST ("t\0 s",        1,        2,  "ts",         0),
-    TEST ("t\0 s",        2,        2,  "t\0",        0),
-    TEST ("t\0 s",        2,        1,  "t\0s",       0),
-    TEST ("t\0 s",        3,        2,  "t\0 ",       0),
-    TEST ("t\0 s",        4,        0,  "t\0 s",      0),
-
-    TEST ("a\0\0\0b",     2,        0,  "a\0\0\0b",   0),
-    TEST ("a\0\0\0b",     2,        3,  "a\0",        0),
-    TEST ("a\0\0\0b",     2,        2,  "a\0b",       0),
-    TEST ("a\0\0\0b",     1,        4,  "a",          0),
-    TEST ("a\0\0\0b",     0,        5,  "",           0),
-    TEST ("a\0\0\0b",     0,        2,  "\0\0b",      0),
-    TEST ("a\0b\0\0c",    0,        6,  "",           0),
-    TEST ("a\0b\0\0c",    4,        2,  "a\0b\0",     0),
-    TEST ("a\0b\0\0c",    4,        1,  "a\0b\0c",    0),
-    TEST ("\0ab\0\0c",    2,        5,  "\0a",        0),
-    TEST ("\0ab\0\0c",    0,        4,  "\0c",        0),
-    TEST ("ab\0c\0\0",    5,        1,  "ab\0c\0",    0),
-
-    TEST ("a",            0,        3,  "",           0),
-    TEST ("t\0 s",        0,        9,  "",           0),
-    TEST ("ab\0c\0\0",    0,       10,  "",           0),
-    TEST ("x@4096",       0,     4105,  "",           0),
-
-    TEST ("a",            3,        1,  "a",          1),
-    TEST ("t\0 s",        5,        1,  "t\0 s",      1),
-    TEST ("ab\0c\0\0",   10,        1,  "ab\0c\0\0",  1),
-    TEST ("x@4096",    4106,        1,  "x@4096",     1),
-
-    TEST ("x@4096",       0,     4096,  "",           0),
-    TEST ("x@4096",       1,     4095,  "x",          0),
-    TEST ("x@4096",       4,     4092,  "xxxx",       0),
-    TEST ("x@4096",       4,     4090,  "xxxxxx",     0),
-    TEST ("x@4096",    4096,     4096,  "x@4096",     0),
-    TEST ("x@2048y@2048", 1,     4094,  "xy",         0),
+    //    |                   +--------------------- erase() pos argument
+    //    |                   |         +----------- erase() n argument
+    //    |                   |         |   +------- expected result sequence
+    //    |                   |         |   |        +--- exception info
+    //    |                   |         |   |        |      0 - no exception
+    //    |                   |         |   |        |      1 - out_of_range
+    //    |                   |         |   |        |        
+    //    |                   |         |   |        +-------+
+    //    V                   V         V   V                V
+    TEST ("",                 0,        0,  "",              0),
+    TEST ("<U0>",             0,        1,  "",              0),
+    TEST ("<U0>",             0,        0,  "<U0>",          0),
+    TEST ("<U0>",             1,        1,  "<U0>",          0),
+    TEST ("<U0>@2",           1,        1,  "<U0>",          0),
+    TEST ("<U0>@2",           0,        1,  "<U0>",          0),
+
+    TEST ("a",                0,        1,  "",              0),
+    TEST ("a",                0,        0,  "a",             0),
+    TEST ("a",                1,        1,  "a",             0),
+
+    TEST ("abc",              0,        3,  "",              0),
+    TEST ("abc",              0,        2,  "c",             0),
+    TEST ("abc",              1,        2,  "a",             0),
+    TEST ("abc",              1,        1,  "ac",            0),
+    TEST ("abc",              2,        1,  "ab",            0),
+    TEST ("abc",              3,        0,  "abc",           0),
+
+    TEST ("t<U0> s",          0,        3,  "s",             0),
+    TEST ("t<U0> s",          0,        4,  "",              0),
+    TEST ("t<U0> s",          0,        1,  "<U0> s",        0),
+    TEST ("t<U0> s",          1,        3,  "t",             0),
+    TEST ("t<U0> s",          1,        2,  "ts",            0),
+    TEST ("t<U0> s",          2,        2,  "t<U0>",         0),
+    TEST ("t<U0> s",          2,        1,  "t<U0>s",        0),
+    TEST ("t<U0> s",          3,        2,  "t<U0> ",        0),
+    TEST ("t<U0> s",          4,        0,  "t<U0> s",       0),
+
+    TEST ("a<U0>@3b",         2,        0,  "a<U0>@3b",      0),
+    TEST ("a<U0>@3b",         2,        3,  "a<U0>",         0),
+    TEST ("a<U0>@3b",         2,        2,  "a<U0>b",        0),
+    TEST ("a<U0>@3b",         1,        4,  "a",             0),
+    TEST ("a<U0>@3b",         0,        5,  "",              0),
+    TEST ("a<U0>@3b",         0,        2,  "<U0>@2b",       0),
+    TEST ("a<U0>b<U0>@2c",    0,        6,  "",              0),
+    TEST ("a<U0>b<U0>@2c",    4,        2,  "a<U0>b<U0>",    0),
+    TEST ("a<U0>b<U0>@2c",    4,        1,  "a<U0>b<U0>c",   0),
+    TEST ("<U0>ab<U0>@2c",    2,        5,  "<U0>a",         0),
+    TEST ("<U0>ab<U0>@2c",    0,        4,  "<U0>c",         0),
+    TEST ("ab<U0>c<U0>@2",    5,        1,  "ab<U0>c<U0>",   0),
+
+    TEST ("a",                0,        3,  "",              0),
+    TEST ("t<U0> s",          0,        9,  "",              0),
+    TEST ("ab<U0>c<U0>@2",    0,       10,  "",              0),
+    TEST ("x@4096",           0,     4105,  "",              0),
+
+    TEST ("a",                3,        1,  "a",             1),
+    TEST ("t<U0> s",          5,        1,  "t<U0> s",       1),
+    TEST ("ab<U0>c<U0>@2",   10,        1,  "ab<U0>c<U0>@2", 1),
+    TEST ("x@4096",        4106,        1,  "x@4096",        1),
+
+    TEST ("x@4096",           0,     4096,  "",              0),
+    TEST ("x@4096",           1,     4095,  "x",             0),
+    TEST ("x@4096",           4,     4092,  "xxxx",          0),
+    TEST ("x@4096",           4,     4090,  "xxxxxx",        0),
+    TEST ("x@4096",        4096,     4096,  "x@4096",        0),
+    TEST ("x@2048y@2048",     1,     4094,  "xy",            0),
 
-    TEST ("last test",    4,        1,  "lasttest",   0)
+    TEST ("last test",        4,        1,  "lasttest",      0)
 };
 
 
@@ -238,40 +239,40 @@
         0, 0, res, sizeof res - 1, 0 }
 
     //    +-------------------------------------- controlled sequence
-    //    |               +---------------------- iterator offset
-    //    |               |    +----------------- expected result sequence
-    //    |               |    |
-    //    V               V    V
-    TEST ("a",            0,   ""),
-
-    TEST ("\0",           0,   ""),
-    TEST ("\0\0",         0,   "\0"),
-    TEST ("\0\0",         1,   "\0"),
-
-    TEST ("abc",          0,   "bc"),
-    TEST ("abc",          1,   "ac"),
-    TEST ("abc",          2,   "ab"),
-
-    TEST ("t\0 s",        0,   "\0 s"),
-    TEST ("t\0 s",        1,   "t s"),
-    TEST ("t\0 s",        2,   "t\0s"),
-    TEST ("t\0 s",        3,   "t\0 "),
-
-    TEST ("a\0\0\0b",     4,   "a\0\0\0"),
-    TEST ("a\0\0\0b",     2,   "a\0\0b"),
-    TEST ("a\0\0\0b",     1,   "a\0\0b"),
-    TEST ("a\0\0\0b",     0,   "\0\0\0b"),
-    TEST ("a\0b\0\0c",    4,   "a\0b\0c"),
-    TEST ("\0ab\0\0c",    0,   "ab\0\0c"),
-    TEST ("\0ab\0\0c",    2,   "\0a\0\0c"),
-    TEST ("ab\0c\0\0",    5,   "ab\0c\0"),
-
-    TEST ("x@4096y",   4096,   "x@4096"),
-    TEST ("x@4096",    4088,   "x@4095"),
-    TEST ("ax@4096",      0,   "x@4096"),
-    TEST ("x@4096",       9,   "x@4095"),
+    //    |                   +------------------ iterator offset
+    //    |                   |    +------------- expected result sequence
+    //    |                   |    |
+    //    V                   V    V
+    TEST ("a",                0,   ""),
+
+    TEST ("<U0>",             0,   ""),
+    TEST ("<U0>@2",           0,   "<U0>"),
+    TEST ("<U0>@2",           1,   "<U0>"),
+
+    TEST ("abc",              0,   "bc"),
+    TEST ("abc",              1,   "ac"),
+    TEST ("abc",              2,   "ab"),
+
+    TEST ("t<U0> s",          0,   "<U0> s"),
+    TEST ("t<U0> s",          1,   "t s"),
+    TEST ("t<U0> s",          2,   "t<U0>s"),
+    TEST ("t<U0> s",          3,   "t<U0> "),
+
+    TEST ("a<U0>@3b",         4,   "a<U0>@3"),
+    TEST ("a<U0>@3b",         2,   "a<U0>@2b"),
+    TEST ("a<U0>@3b",         1,   "a<U0>@2b"),
+    TEST ("a<U0>@3b",         0,   "<U0>@3b"),
+    TEST ("a<U0>b<U0>@2c",    4,   "a<U0>b<U0>c"),
+    TEST ("<U0>ab<U0>@2c",    0,   "ab<U0>@2c"),
+    TEST ("<U0>ab<U0>@2c",    2,   "<U0>a<U0>@2c"),
+    TEST ("ab<U0>c<U0>@2",    5,   "ab<U0>c<U0>"),
+
+    TEST ("x@4096y",       4096,   "x@4096"),
+    TEST ("x@4096",        4088,   "x@4095"),
+    TEST ("ax@4096",          0,   "x@4096"),
+    TEST ("x@4096",           9,   "x@4095"),
 
-    TEST ("last test",    4,   "lasttest")
+    TEST ("last test",        4,   "lasttest")
 };
 
 /**************************************************************************/
@@ -438,7 +439,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.insert.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.insert.cpp Wed Jun 28 16:47:10 2006
@@ -60,70 +60,70 @@
     }
 
     //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- insert() pos argument
-    //    |            |  +------------------------- sequence to be inserted
-    //    |            |  |           +------------- 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",        0, "c",        "cab",                0),
-
-    TEST ("",          0, "",         "",                   0),
-    TEST ("",          0, "abc",      "abc",                0),
-
-    TEST ("\0",        0, "",         "\0",                 0),
-    TEST ("",          0, "\0",       "",                   0),
-
-    TEST ("abc",       0, "",         "abc",                0),
-    TEST ("abc",       1, "",         "abc",                0),
-    TEST ("abc",       3, "",         "abc",                0),
-
-    TEST ("\0",        0, "a",        "a\0",                0),
-    TEST ("\0",        1, "a",        "\0a",                0),
-    TEST ("\0",        0, "\0",       "\0",                 0),
-    TEST ("\0",        1, "\0\0",     "\0",                 0),
-
-    TEST ("cde",       0, "ab",       "abcde",              0),
-    TEST ("cde",       1, "ab",       "cabde",              0),
-    TEST ("cde",       2, "ab",       "cdabe",              0),
-    TEST ("cde",       3, "ab",       "cdeab",              0),
-
-    TEST ("\0ab\0\0c", 0, "\0e\0",    "\0ab\0\0c",          0),
-    TEST ("a\0b\0\0c", 2, "e\0e",     "a\0eb\0\0c",         0),
-    TEST ("a\0bc\0\0", 6, "e\0e",     "a\0bc\0\0e",         0),
-
-    TEST ("",          0, 0,          "",                   0),
-    TEST ("abc",       0, 0,          "abcabc",             0),
-    TEST ("abc",       2, 0,          "ababcc",             0),
-    TEST ("a\0bc\0\0", 0, 0,          "aa\0bc\0\0",         0),
-    TEST ("a\0bc\0\0", 6, 0,          "a\0bc\0\0a",         0),
-    TEST ("x@4096",    5, 0,          "x@8192",             0),
-
-    TEST ("",          0, "x@4096",   "x@4096",             0),
-    TEST ("x@4096",    0, "",         "x@4096",             0),
-    TEST ("x@4096",    2, "a@100",    "xxa@100x@4094",      0),
-    TEST ("a@102",     2, "x@4096",   "aax@4096a@100",      0),
-
-    TEST ("x@10",      1, "x@118",    "x@128",              0),
-    TEST ("x@128",   128, "x@79",     "x@207",              0),
-    TEST ("x@207",     0, "x@127",    "x@334",              0),
-    TEST ("x@334",     1, "x@206",    "x@540",              0),
-    TEST ("x@540",   539, "x@333",    "x@873",              0),
-    TEST ("x@539",   539, "x@873",    "x@1412",             0),
-    TEST ("x@872",     0, "x@1412",   "x@2284",             0),
-    TEST ("x@1411",  207, "x@2284",   "x@3695",             0),
-    TEST ("x@1412",    0, "x@2284",   "x@3696",             0),
-
-    TEST ("\0",        2, "",         "",                   1),
-    TEST ("a",         2, "",         "",                   1),
-    TEST ("x@4096", 4106, "",         "",                   1),
+    //    |                +------------------------ insert() pos argument
+    //    |                |  +--------------------- sequence to be inserted
+    //    |                |  |           +--------- 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",            0, "c",        "cab",                0),
+
+    TEST ("",              0, "",         "",                   0),
+    TEST ("",              0, "abc",      "abc",                0),
+
+    TEST ("<U0>",          0, "",         "<U0>",               0),
+    TEST ("",              0, "<U0>",     "",                   0),
+
+    TEST ("abc",           0, "",         "abc",                0),
+    TEST ("abc",           1, "",         "abc",                0),
+    TEST ("abc",           3, "",         "abc",                0),
+
+    TEST ("<U0>",          0, "a",        "a<U0>",              0),
+    TEST ("<U0>",          1, "a",        "<U0>a",              0),
+    TEST ("<U0>",          0, "<U0>",     "<U0>",               0),
+    TEST ("<U0>",          1, "<U0>@2",   "<U0>",               0),
+
+    TEST ("cde",           0, "ab",       "abcde",              0),
+    TEST ("cde",           1, "ab",       "cabde",              0),
+    TEST ("cde",           2, "ab",       "cdabe",              0),
+    TEST ("cde",           3, "ab",       "cdeab",              0),
+
+    TEST ("<U0>ab<U0>@2c", 0, "<U0>e<U0>",  "<U0>ab<U0>@2c",    0),
+    TEST ("a<U0>b<U0>@2c", 2, "e<U0>e",   "a<U0>eb<U0>@2c",     0),
+    TEST ("a<U0>bc<U0>@2", 6, "e<U0>e",   "a<U0>bc<U0>@2e",     0),
+
+    TEST ("",              0, 0,          "",                   0),
+    TEST ("abc",           0, 0,          "abcabc",             0),
+    TEST ("abc",           2, 0,          "ababcc",             0),
+    TEST ("a<U0>bc<U0>@2", 0, 0,          "aa<U0>bc<U0>@2",     0),
+    TEST ("a<U0>bc<U0>@2", 6, 0,          "a<U0>bc<U0>@2a",     0),
+    TEST ("x@4096",        5, 0,          "x@8192",             0),
+
+    TEST ("",              0, "x@4096",   "x@4096",             0),
+    TEST ("x@4096",        0, "",         "x@4096",             0),
+    TEST ("x@4096",        2, "a@100",    "xxa@100x@4094",      0),
+    TEST ("a@102",         2, "x@4096",   "aax@4096a@100",      0),
+
+    TEST ("x@10",          1, "x@118",    "x@128",              0),
+    TEST ("x@128",       128, "x@79",     "x@207",              0),
+    TEST ("x@207",         0, "x@127",    "x@334",              0),
+    TEST ("x@334",         1, "x@206",    "x@540",              0),
+    TEST ("x@540",       539, "x@333",    "x@873",              0),
+    TEST ("x@539",       539, "x@873",    "x@1412",             0),
+    TEST ("x@872",         0, "x@1412",   "x@2284",             0),
+    TEST ("x@1411",      207, "x@2284",   "x@3695",             0),
+    TEST ("x@1412",        0, "x@2284",   "x@3696",             0),
+
+    TEST ("<U0>",          2, "",         "",                   1),
+    TEST ("a",             2, "",         "",                   1),
+    TEST ("x@4096",     4106, "",         "",                   1),
 
-    TEST ("last",      4, "test",     "lasttest",           0)
+    TEST ("last",          4, "test",     "lasttest",           0)
 };
 
 /**************************************************************************/
@@ -140,69 +140,69 @@
     }
 
     //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- insert() pos argument
-    //    |            |  +------------------------- sequence to be inserted
-    //    |            |  |           +------------- 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",        0, "c",        "cab",                0),
-
-    TEST ("",          0, "",         "",                   0),
-    TEST ("",          0, "abc",      "abc",                0),
-
-    TEST ("\0",        0, "",         "\0",                 0),
-    TEST ("",          0, "\0",       "\0",                 0),
-
-    TEST ("abc",       0, "",         "abc",                0),
-    TEST ("abc",       1, "",         "abc",                0),
-    TEST ("abc",       3, "",         "abc",                0),
-
-    TEST ("\0",        0, "a",        "a\0",                0),
-    TEST ("\0",        1, "a",        "\0a",                0),
-    TEST ("\0",        0, "\0",       "\0\0",               0),
-    TEST ("\0",        1, "\0\0",     "\0\0\0",             0),
-
-    TEST ("cde",       0, "ab",       "abcde",              0),
-    TEST ("cde",       1, "ab",       "cabde",              0),
-    TEST ("cde",       2, "ab",       "cdabe",              0),
-    TEST ("cde",       3, "ab",       "cdeab",              0),
-
-    TEST ("\0ab\0\0c", 0, "\0e\0",    "\0e\0\0ab\0\0c",     0),
-    TEST ("a\0b\0\0c", 2, "e\0e",     "a\0e\0eb\0\0c",      0),
-    TEST ("a\0bc\0\0", 6, "e\0\0e\0", "a\0bc\0\0e\0\0e\0",  0),
-
-    TEST ("abc",       0, 0,          "abcabc",             0),
-    TEST ("abc",       2, 0,          "ababcc",             0),
-    TEST ("a\0bc\0\0", 0, 0,          "a\0bc\0\0a\0bc\0\0", 0),
-    TEST ("a\0bc\0\0", 6, 0,          "a\0bc\0\0a\0bc\0\0", 0),
-    TEST ("x@4096",    5, 0,          "x@8192",             0),
-
-    TEST ("",          0, "x@4096",   "x@4096",             0),
-    TEST ("x@4096",    0, "",         "x@4096",             0),
-    TEST ("x@4096",    2, "a@100",    "xxa@100x@4094",      0),
-    TEST ("a@102",     2, "x@4096",   "aax@4096a@100",      0),
-
-    TEST ("x@10",      1, "x@118",    "x@128",              0),
-    TEST ("x@128",   128, "x@79",     "x@207",              0),
-    TEST ("x@207",     0, "x@127",    "x@334",              0),
-    TEST ("x@334",     1, "x@206",    "x@540",              0),
-    TEST ("x@540",   539, "x@333",    "x@873",              0),
-    TEST ("x@539",   539, "x@873",    "x@1412",             0),
-    TEST ("x@872",     0, "x@1412",   "x@2284",             0),
-    TEST ("x@1411",  207, "x@2284",   "x@3695",             0),
-    TEST ("x@1412",    0, "x@2284",   "x@3696",             0),
-
-    TEST ("\0",        2, "",         "",                   1),
-    TEST ("a",         2, "",         "",                   1),
-    TEST ("x@4096", 4106, "",         "",                   1),
+    //    |                +------------------------ insert() pos argument
+    //    |                |  +--------------------- sequence to be inserted
+    //    |                |  |           +--------- 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",            0, "c",        "cab",                0),
+
+    TEST ("",              0, "",         "",                   0),
+    TEST ("",              0, "abc",      "abc",                0),
+
+    TEST ("<U0>",          0, "",         "<U0>",               0),
+    TEST ("",              0, "<U0>",     "<U0>",               0),
+
+    TEST ("abc",           0, "",         "abc",                0),
+    TEST ("abc",           1, "",         "abc",                0),
+    TEST ("abc",           3, "",         "abc",                0),
+
+    TEST ("<U0>",          0, "a",        "a<U0>",              0),
+    TEST ("<U0>",          1, "a",        "<U0>a",              0),
+    TEST ("<U0>",          0, "<U0>",     "<U0>@2",             0),
+    TEST ("<U0>",          1, "<U0>@2",   "<U0>@3",             0),
+
+    TEST ("cde",           0, "ab",       "abcde",              0),
+    TEST ("cde",           1, "ab",       "cabde",              0),
+    TEST ("cde",           2, "ab",       "cdabe",              0),
+    TEST ("cde",           3, "ab",       "cdeab",              0),
+
+    TEST ("<U0>ab<U0>@2c", 0, "<U0>e<U0>",    "<U0>e<U0>@2ab<U0>@2c",      0),
+    TEST ("a<U0>b<U0>@2c", 2, "e<U0>e",       "a<U0>e<U0>eb<U0>@2c",       0),
+    TEST ("a<U0>bc<U0>@2", 6, "e<U0>@2e<U0>", "a<U0>bc<U0>@2e<U0>@2e<U0>", 0),
+
+    TEST ("abc",           0, 0,          "abcabc",             0),
+    TEST ("abc",           2, 0,          "ababcc",             0),
+    TEST ("a<U0>bc<U0>@2", 0, 0,          "a<U0>bc<U0>@2a<U0>bc<U0>@2", 0),
+    TEST ("a<U0>bc<U0>@2", 6, 0,          "a<U0>bc<U0>@2a<U0>bc<U0>@2", 0),
+    TEST ("x@4096",        5, 0,          "x@8192",             0),
+
+    TEST ("",              0, "x@4096",   "x@4096",             0),
+    TEST ("x@4096",        0, "",         "x@4096",             0),
+    TEST ("x@4096",        2, "a@100",    "xxa@100x@4094",      0),
+    TEST ("a@102",         2, "x@4096",   "aax@4096a@100",      0),
+
+    TEST ("x@10",          1, "x@118",    "x@128",              0),
+    TEST ("x@128",       128, "x@79",     "x@207",              0),
+    TEST ("x@207",         0, "x@127",    "x@334",              0),
+    TEST ("x@334",         1, "x@206",    "x@540",              0),
+    TEST ("x@540",       539, "x@333",    "x@873",              0),
+    TEST ("x@539",       539, "x@873",    "x@1412",             0),
+    TEST ("x@872",         0, "x@1412",   "x@2284",             0),
+    TEST ("x@1411",      207, "x@2284",   "x@3695",             0),
+    TEST ("x@1412",        0, "x@2284",   "x@3696",             0),
+
+    TEST ("<U0>",          2, "",         "",                   1),
+    TEST ("a",             2, "",         "",                   1),
+    TEST ("x@4096",     4106, "",         "",                   1),
 
-    TEST ("last",      4, "test",     "lasttest",           0)
+    TEST ("last",          4, "test",     "lasttest",           0)
 };
 
 /**************************************************************************/
@@ -223,92 +223,92 @@
     }
 
     //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- insert() pos argument
-    //    |            |  +------------------------- sequence to be inserted
-    //    |            |  |            +------------ insert() off2 argument
-    //    |            |  |            |  +--------- insert() num 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                   V
-    TEST ("ab",        0, "c",         0, 1, "cab",              0),
-
-    TEST ("",          0, "",          0, 0,  "",                0),
-    TEST ("",          0, "abc",       1, 1,  "b",               0),
-    TEST ("",          0, "\0",        0, 1,  "\0",              0),
-
-    TEST ("\0",        0, "",          0, 0,  "\0",              0),
-    TEST ("\0",        1, "",          0, 0,  "\0",              0),
-
-    TEST ("abc",       0, "",          0, 0,  "abc",             0),
-    TEST ("abc",       1, "",          0, 0,  "abc",             0),
-    TEST ("abc",       3, "",          0, 0,  "abc",             0),
-
-    TEST ("\0",        0, "a",         0, 1,  "a\0",             0),
-    TEST ("\0",        1, "a",         0, 1,  "\0a",             0),
-    TEST ("\0",        0, "\0\0",      1, 1,  "\0\0",            0),
-    TEST ("\0",        1, "\0\0",      0, 2,  "\0\0\0",          0),
-    TEST ("\0",        1, "\0\0",      1, 5,  "\0\0",            0),
-
-    TEST ("cde",       0, "ab",        0, 2,  "abcde",           0),
-    TEST ("cde",       1, "ab",        0, 1,  "cade",            0),
-    TEST ("cde",       2, "ab",        1, 5,  "cdbe",            0),
-    TEST ("cde",       3, "ab",        1, 1,  "cdeb",            0),
-
-    TEST ("ab",        0, "c\0e",      0, 3,  "c\0eab",          0),
-    TEST ("ab",        1, "c\0e",      1, 2,  "a\0eb",           0),
-    TEST ("ab",        2, "c\0e",      0, 2,  "abc\0",           0),
-
-    TEST ("\0e\0",     1, "\0ab\0\0c", 0, 9,  "\0\0ab\0\0ce\0",  0),
-    TEST ("\0e\0",     1, "\0ab\0\0c", 0, 3,  "\0\0abe\0",       0),
-    TEST ("a\0b\0\0c", 3, "\0e\0",     0, 3,  "a\0b\0e\0\0\0c",  0),
-    TEST ("a\0b\0\0c", 2, "\0\0e\0",   0, 2,  "a\0\0\0b\0\0c",   0),
-    TEST ("\0ab\0\0c", 0, "\0e\0",     2, 1,  "\0\0ab\0\0c",     0),
-    TEST ("a\0bc\0\0", 6, "\0e",       0, 2,  "a\0bc\0\0\0e",    0),
-
-    TEST ("abc",       0, 0,           1, 1,  "babc",            0),
-    TEST ("abc",       2, 0,           0, 2,  "ababc",           0),
-    TEST ("a\0bc\0\0", 0, 0,           4, 2,  "\0\0a\0bc\0\0",   0),
-    TEST ("a\0bc\0\0", 6, 0,           1, 3,  "a\0bc\0\0\0bc",   0),
-    TEST ("abcdef",    0, 0,           1, 2,  "bcabcdef",        0),
-
-    TEST ("",          0, "x@4096",    0, 4096, "x@4096",        0),
-    TEST ("x@4096",    0, "",          0,    0, "x@4096",        0),
-    TEST ("a@1000",    0, "b@1000",    0,  999, "b@999a@1000",   0),
-    TEST ("a@1000",    1, "b@1001",    0, 1000, "ab@1000a@999",  0),
-    TEST ("a@1000",    2, "b@1002",    0, 1001, "aab@1001a@998", 0),
-    TEST ("a@1000",  998, "b@1000",    1,  999, "a@998b@999aa",  0),
-    TEST ("a@1000",  999, "b@1001",    2, 1000, "a@999b@999a",   0),
-    TEST ("a@1000",    2, "b@1002",  999, 1001, "aabbba@998",    0),
-
-    TEST ("x@10",      1, "x@118",     0,  118, "x@128",         0),
-    TEST ("x@128",     0, "x@129",    50,   79, "x@207",         0),
-    TEST ("x@207",   207, "x@127",     0,  127, "x@334",         0),
-    TEST ("x@207",   128, "x@207",    10,  127, "x@334",         0),
-    TEST ("x@334",   334, "x@208",     2,  206, "x@540",         0),
-    TEST ("x@540",     0, "x@336",     3,  333, "x@873",         0),
-    TEST ("x@539",   538, "x@873",     0,  873, "x@1412",        0),
-    TEST ("x@873",   540, "x@540",     1,  539, "x@1412",        0),
-    TEST ("x@872",     0, "x@1412",    0, 1412, "x@2284",        0),
-    TEST ("x@1411", 1411, "x@2288",    4, 2284, "x@3695",        0),
-    TEST ("x@1411",  872, "x@3695",  128, 2284, "x@3695",        0),
-    TEST ("x@1412",    0, "x@2284",    0, 2284, "x@3696",        0),
-
-    TEST ("\0",        2, "",          0,    0,  "\0",           1),
-    TEST ("",          0, "\0",        2,    0,  "",             2),
+    //    |                +------------------------ insert() pos argument
+    //    |                |  +--------------------- sequence to be inserted
+    //    |                |  |            +-------- insert() off2 argument
+    //    |                |  |            |  +----- insert() num 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                   V
+    TEST ("ab",            0, "c",         0, 1, "cab",              0),
+
+    TEST ("",              0, "",          0, 0,  "",                0),
+    TEST ("",              0, "abc",       1, 1,  "b",               0),
+    TEST ("",              0, "<U0>",      0, 1,  "<U0>",            0),
+
+    TEST ("<U0>",          0, "",          0, 0,  "<U0>",            0),
+    TEST ("<U0>",          1, "",          0, 0,  "<U0>",            0),
+
+    TEST ("abc",           0, "",          0, 0,  "abc",             0),
+    TEST ("abc",           1, "",          0, 0,  "abc",             0),
+    TEST ("abc",           3, "",          0, 0,  "abc",             0),
+
+    TEST ("<U0>",          0, "a",         0, 1,  "a<U0>",           0),
+    TEST ("<U0>",          1, "a",         0, 1,  "<U0>a",           0),
+    TEST ("<U0>",          0, "<U0>@2",    1, 1,  "<U0>@2",          0),
+    TEST ("<U0>",          1, "<U0>@2",    0, 2,  "<U0>@3",          0),
+    TEST ("<U0>",          1, "<U0>@2",    1, 5,  "<U0>@2",          0),
+
+    TEST ("cde",           0, "ab",        0, 2,  "abcde",           0),
+    TEST ("cde",           1, "ab",        0, 1,  "cade",            0),
+    TEST ("cde",           2, "ab",        1, 5,  "cdbe",            0),
+    TEST ("cde",           3, "ab",        1, 1,  "cdeb",            0),
+
+    TEST ("ab",            0, "c<U0>e",    0, 3,  "c<U0>eab",        0),
+    TEST ("ab",            1, "c<U0>e",    1, 2,  "a<U0>eb",         0),
+    TEST ("ab",            2, "c<U0>e",    0, 2,  "abc<U0>",         0),
+
+    TEST ("<U0>e<U0>",     1, "<U0>ab<U0>@2c", 0, 9, "<U0>@2ab<U0>@2ce<U0>",0),
+    TEST ("<U0>e<U0>",     1, "<U0>ab<U0>@2c", 0, 3, "<U0>@2abe<U0>",       0),
+    TEST ("a<U0>b<U0>@2c", 3, "<U0>e<U0>",     0, 3, "a<U0>b<U0>e<U0>@3c",  0),
+    TEST ("a<U0>b<U0>@2c", 2, "<U0>@2e<U0>",   0, 2, "a<U0>@3b<U0>@2c",     0),
+    TEST ("<U0>ab<U0>@2c", 0, "<U0>e<U0>",     2, 1, "<U0>@2ab<U0>@2c",     0),
+    TEST ("a<U0>bc<U0>@2", 6, "<U0>e",         0, 2, "a<U0>bc<U0>@3e",      0),
+
+    TEST ("abc",           0, 0,           1, 1,  "babc",                0),
+    TEST ("abc",           2, 0,           0, 2,  "ababc",               0),
+    TEST ("a<U0>bc<U0>@2", 0, 0,           4, 2,  "<U0>@2a<U0>bc<U0>@2", 0),
+    TEST ("a<U0>bc<U0>@2", 6, 0,           1, 3,  "a<U0>bc<U0>@3bc",     0),
+    TEST ("abcdef",        0, 0,           1, 2,  "bcabcdef",            0),
+
+    TEST ("",              0, "x@4096",    0, 4096, "x@4096",        0),
+    TEST ("x@4096",        0, "",          0,    0, "x@4096",        0),
+    TEST ("a@1000",        0, "b@1000",    0,  999, "b@999a@1000",   0),
+    TEST ("a@1000",        1, "b@1001",    0, 1000, "ab@1000a@999",  0),
+    TEST ("a@1000",        2, "b@1002",    0, 1001, "aab@1001a@998", 0),
+    TEST ("a@1000",      998, "b@1000",    1,  999, "a@998b@999aa",  0),
+    TEST ("a@1000",      999, "b@1001",    2, 1000, "a@999b@999a",   0),
+    TEST ("a@1000",        2, "b@1002",  999, 1001, "aabbba@998",    0),
+
+    TEST ("x@10",          1, "x@118",     0,  118, "x@128",         0),
+    TEST ("x@128",         0, "x@129",    50,   79, "x@207",         0),
+    TEST ("x@207",       207, "x@127",     0,  127, "x@334",         0),
+    TEST ("x@207",       128, "x@207",    10,  127, "x@334",         0),
+    TEST ("x@334",       334, "x@208",     2,  206, "x@540",         0),
+    TEST ("x@540",         0, "x@336",     3,  333, "x@873",         0),
+    TEST ("x@539",       538, "x@873",     0,  873, "x@1412",        0),
+    TEST ("x@873",       540, "x@540",     1,  539, "x@1412",        0),
+    TEST ("x@872",         0, "x@1412",    0, 1412, "x@2284",        0),
+    TEST ("x@1411",     1411, "x@2288",    4, 2284, "x@3695",        0),
+    TEST ("x@1411",      872, "x@3695",  128, 2284, "x@3695",        0),
+    TEST ("x@1412",        0, "x@2284",    0, 2284, "x@3696",        0),
+
+    TEST ("<U0>",          2, "",          0,    0,  "<U0>",         1),
+    TEST ("",              0, "<U0>",      2,    0,  "",             2),
 
-    TEST ("a",         2, "",          0,    0,  "a",            1),
-    TEST ("",          0, "a",         2,    0,  "",             2),
+    TEST ("a",             2, "",          0,    0,  "a",            1),
+    TEST ("",              0, "a",         2,    0,  "",             2),
 
-    TEST ("x@4096", 4106, "",          0,    0,  "x@4096",       1),
-    TEST ("",          0, "x@4096", 4106,    0,  "",             2),
+    TEST ("x@4096",     4106, "",          0,    0,  "x@4096",       1),
+    TEST ("",              0, "x@4096", 4106,    0,  "",             2),
 
-    TEST ("last",      4, "test",      0,    4,  "lasttest",     0)
+    TEST ("last",          4, "test",      0,    4,  "lasttest",     0)
 };
 
 /**************************************************************************/
@@ -324,82 +324,82 @@
         arg, sizeof arg - 1, res, sizeof res - 1, bthrow }
 
     //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- insert() pos argument
-    //    |            |  +------------------------- sequence to be inserted
-    //    |            |  |            +------------ insert() num 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",        0, "c",         1, "cab",             0),
-
-    TEST ("",          0, "",          0,  "",               0),
-    TEST ("",          0, "abc",       1,  "a",              0),
-
-    TEST ("\0",        0, "",          0,  "\0",             0),
-    TEST ("\0",        1, "",          0,  "\0",             0),
-    TEST ("",          0, "\0",        1,  "\0",             0),
-
-    TEST ("\0",        0, "a",         0,  "\0",             0),
-    TEST ("\0",        1, "a",         1,  "\0a",            0),
-    TEST ("\0",        0, "\0\0",      1,  "\0\0",           0),
-    TEST ("\0",        1, "\0\0",      2,  "\0\0\0",         0),
-
-    TEST ("cde",       0, "ab",        2,  "abcde",          0),
-    TEST ("cde",       1, "ab",        1,  "cade",           0),
-    TEST ("cde",       3, "ab",        1,  "cdea",           0),
-    TEST ("cde",       2, "ab",        2,  "cdabe",          0),
-
-    TEST ("\0e\0",     3, "a\0b\0\0c", 0,  "\0e\0",          0),
-    TEST ("\0e\0",     3, "\0ab\0\0c", 3,  "\0e\0\0ab",      0),
-
-    TEST ("a\0b\0\0c", 3, "\0e\0",     3,  "a\0b\0e\0\0\0c", 0),
-    TEST ("a\0b\0\0c", 2, "\0\0e\0",   2,  "a\0\0\0b\0\0c",  0),
-    TEST ("\0ab\0\0c", 0, "\0e\0",     1,  "\0\0ab\0\0c",    0),
-    TEST ("a\0bc\0\0", 6, "\0e",       2,  "a\0bc\0\0\0e",   0),
-
-    TEST ("abc",       0, 0,           1,  "aabc",           0),
-    TEST ("abc",       2, 0,           2,  "ababc",          0),
-    TEST ("\0abc\0\0", 0, 0,           1,  "\0\0abc\0\0",    0),
-    TEST ("a\0bc\0\0", 6, 0,           3,  "a\0bc\0\0a\0b",  0),
-    TEST ("a@4096",    0, 0,        1111, "a@5207",          0),
-    TEST ("b@4096",    1, 0,        2222, "b@6318",          0),
-
-    TEST ("x@4096",    1, "\0",        1, "x\0x@4095",       0),
-    TEST ("x@4096",    0, "\0",        1, "\0x@4096",        0),
-    TEST ("x@4096", 4096, "\0",        1, "x@4096\0",        0),
-    TEST ("x@4096",    0, "ab",        2, "abx@4096",        0),
-    TEST ("x@4096", 4095, "ab",        1, "x@4095ax",        0),
-    TEST ("x@4096", 4094, "\0\0",      2, "x@4094\0\0xx",    0),
-
-    TEST ("",          0, "x@4096", 4096, "x@4096",          0),
-    TEST ("x@4096",    0, "",          0, "x@4096",          0),
-
-    TEST ("",          0, "x@873",   540, "x@540",           0),
-    TEST ("x@10",      1, "x@118",   118, "x@128",           0),
-    TEST ("x@128",   128, "x@79",     79, "x@207",           0),
-    TEST ("x@207",     0, "x@127",   127, "x@334",           0),
-    TEST ("x@207",   207, "x@207",   127, "x@334",           0),
-    TEST ("x@334",   128, "x@206",   206, "x@540",           0),
-    TEST ("x@540",   540, "x@333",   333, "x@873",           0),
-    TEST ("x@539",     0, "x@873",   873, "x@1412",          0),
-    TEST ("x@873",     5, "x@540",   539, "x@1412",          0),
-    TEST ("x@872",     0, "x@1412", 1412, "x@2284",          0),
-    TEST ("x@1411", 1411, "x@2284", 2284, "x@3695",          0),
-    TEST ("x@1411",  873, "x@3695", 2284, "x@3695",          0),
-    TEST ("x@1412",    0, "x@2284", 2284, "x@3696",          0),
-    TEST ("",          0, "x@3696", 3696, "x@3696",          0),
-
-    TEST ("\0",        2, "",          0,  "",               1),
-    TEST ("a",         2, "",          0,  "",               1),
-    TEST ("x@4096", 4106, "",          0,  "",               1),
+    //    |                +------------------------ insert() pos argument
+    //    |                |  +--------------------- sequence to be inserted
+    //    |                |  |            +-------- insert() num 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",            0, "c",         1, "cab",            0),
+
+    TEST ("",              0, "",          0, "",               0),
+    TEST ("",              0, "abc",       1, "a",              0),
+
+    TEST ("<U0>",          0, "",          0, "<U0>",           0),
+    TEST ("<U0>",          1, "",          0, "<U0>",           0),
+    TEST ("",              0, "<U0>",      1, "<U0>",           0),
+
+    TEST ("<U0>",          0, "a",         0, "<U0>",           0),
+    TEST ("<U0>",          1, "a",         1, "<U0>a",          0),
+    TEST ("<U0>",          0, "<U0>@2",    1, "<U0>@2",         0),
+    TEST ("<U0>",          1, "<U0>@2",    2, "<U0>@3",         0),
+
+    TEST ("cde",           0, "ab",        2, "abcde",          0),
+    TEST ("cde",           1, "ab",        1, "cade",           0),
+    TEST ("cde",           3, "ab",        1, "cdea",           0),
+    TEST ("cde",           2, "ab",        2, "cdabe",          0),
+
+    TEST ("<U0>e<U0>",     3, "a<U0>b<U0>@2c", 0,  "<U0>e<U0>",          0),
+    TEST ("<U0>e<U0>",     3, "<U0>ab<U0>@2c", 3,  "<U0>e<U0>@2ab",      0),
+
+    TEST ("a<U0>b<U0>@2c", 3, "<U0>e<U0>",     3,  "a<U0>b<U0>e<U0>@3c", 0),
+    TEST ("a<U0>b<U0>@2c", 2, "<U0>@2e<U0>",   2,  "a<U0>@3b<U0>@2c",    0),
+    TEST ("<U0>ab<U0>@2c", 0, "<U0>e<U0>",     1,  "<U0>@2ab<U0>@2c",    0),
+    TEST ("a<U0>bc<U0>@2", 6, "<U0>e",         2,  "a<U0>bc<U0>@3e",     0),
+
+    TEST ("abc",           0, 0,           1, "aabc",            0),
+    TEST ("abc",           2, 0,           2, "ababc",           0),
+    TEST ("<U0>abc<U0>@2", 0, 0,           1, "<U0>@2abc<U0>@2", 0),
+    TEST ("a<U0>bc<U0>@2", 6, 0,           3, "a<U0>bc<U0>@2a<U0>b",  0),
+    TEST ("a@4096",        0, 0,        1111, "a@5207",          0),
+    TEST ("b@4096",        1, 0,        2222, "b@6318",          0),
+
+    TEST ("x@4096",        1, "<U0>",      1, "x<U0>x@4095",     0),
+    TEST ("x@4096",        0, "<U0>",      1, "<U0>x@4096",      0),
+    TEST ("x@4096",     4096, "<U0>",      1, "x@4096<U0>",      0),
+    TEST ("x@4096",        0, "ab",        2, "abx@4096",        0),
+    TEST ("x@4096",     4095, "ab",        1, "x@4095ax",        0),
+    TEST ("x@4096",     4094, "<U0>@2",    2, "x@4094<U0>@2xx",  0),
+
+    TEST ("",              0, "x@4096", 4096, "x@4096",          0),
+    TEST ("x@4096",        0, "",          0, "x@4096",          0),
+
+    TEST ("",              0, "x@873",   540, "x@540",           0),
+    TEST ("x@10",          1, "x@118",   118, "x@128",           0),
+    TEST ("x@128",       128, "x@79",     79, "x@207",           0),
+    TEST ("x@207",         0, "x@127",   127, "x@334",           0),
+    TEST ("x@207",       207, "x@207",   127, "x@334",           0),
+    TEST ("x@334",       128, "x@206",   206, "x@540",           0),
+    TEST ("x@540",       540, "x@333",   333, "x@873",           0),
+    TEST ("x@539",         0, "x@873",   873, "x@1412",          0),
+    TEST ("x@873",         5, "x@540",   539, "x@1412",          0),
+    TEST ("x@872",         0, "x@1412", 1412, "x@2284",          0),
+    TEST ("x@1411",     1411, "x@2284", 2284, "x@3695",          0),
+    TEST ("x@1411",      873, "x@3695", 2284, "x@3695",          0),
+    TEST ("x@1412",        0, "x@2284", 2284, "x@3696",          0),
+    TEST ("",              0, "x@3696", 3696, "x@3696",          0),
+
+    TEST ("<U0>",          2, "",          0,  "",               1),
+    TEST ("a",             2, "",          0,  "",               1),
+    TEST ("x@4096",     4106, "",          0,  "",               1),
 
-    TEST ("last",      4, "test",      4,  "lasttest",       0)
+    TEST ("last",          4, "test",      4,  "lasttest",       0)
 };
 
 /**************************************************************************/
@@ -419,70 +419,70 @@
         0, 0, res, sizeof res - 1, bthrow                       \
     }
 
-    //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- insert() pos argument
-    //    |            |  +------------------------- insert() size2 argument
-    //    |            |  |   +--------------------- character to be inserted
-    //    |            |  |   |   +----------------- 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",        0, 1, 'c', "cab",              0),
-
-    TEST ("",          0, 0, ' ',  "",                0),
-    TEST ("",          0, 1, 'b',  "b",               0),
-
-    TEST ("\0",        0, 0, ' ',  "\0",              0),
-    TEST ("\0",        1, 0, ' ',  "\0",              0),
-    TEST ("",          0, 2, '\0', "\0\0",            0),
-
-    TEST ("\0",        0, 1, 'a',  "a\0",             0),
-    TEST ("\0",        1, 1, 'a',  "\0a",             0),
-    TEST ("\0",        0, 1, '\0', "\0\0",            0),
-    TEST ("\0",        1, 2, '\0', "\0\0\0",          0),
-    TEST ("\0",        1, 0, '\0', "\0",              0),
-
-    TEST ("cde",       0, 2, 'a',  "aacde",           0),
-    TEST ("cde",       1, 1, 'a',  "cade",            0),
-    TEST ("cde",       3, 3, 'a',  "cdeaaa",          0),
-    TEST ("cde",       2, 3, 'a',  "cdaaae",          0),
-
-    TEST ("ab",        0, 2, '\0', "\0\0ab",          0),
-    TEST ("ab",        1, 1, '\0', "a\0b",            0),
-    TEST ("ab",        2, 2, '\0', "ab\0\0",          0),
-
-    TEST ("a\0b\0\0c", 3, 2, '\0', "a\0b\0\0\0\0c",   0),
-    TEST ("a\0b\0\0c", 2, 1, '\0', "a\0\0b\0\0c",     0),
-    TEST ("\0ab\0\0c", 0, 3, '\0', "\0\0\0\0ab\0\0c", 0),
-    TEST ("a\0bc\0\0", 6, 2, 'a',  "a\0bc\0\0aa",     0),
-
-    TEST ("",          0, 4106, 'x', "x@4106",        0),
-    TEST ("x@4096",    0, 2,    'a', "aax@4096",      0),
-
-    TEST ("x@4096",    0, 2, 'a',  "aax@4096",        0),
-    TEST ("x@4096",    1, 2, 'a',  "xaax@4095",       0),
-    TEST ("x@4096",    1, 1, '\0', "x\0x@4095",       0),
-
-    TEST ("x@127",     0, 1,    'x', "x@128",         0),
-    TEST ("x@200",   128, 7,    'x', "x@207",         0),
-    TEST ("x@331",   331, 3,    'x', "x@334",         0),
-    TEST ("x@539",     0, 1,    'x', "x@540",         0),
-    TEST ("x@539",     0, 873,  'x', "x@1412",        0),
-    TEST ("x@873",   873, 1411, 'x', "x@2284",        0),
-    TEST ("x@3694",  128, 1,    'x', "x@3695",        0),
-    TEST ("x@540",     0, 1,    'x', "x@541",         0),
-    TEST ("",          0, 3695, 'x', "x@3695",        0),
-
-    TEST ("a",         0, 4095, 'x', "x@4095a",       0),
-    TEST ("x@4096",    0, 2047, 'b', "b@2047x@4096",  0),
-    TEST ("x@4096", 2047, 2048, 'x', "x@6144",        0),
+    //    +---------------------------------------- controlled sequence
+    //    |                +----------------------- insert() pos argument
+    //    |                |  +-------------------- insert() size2 argument
+    //    |                |  |      +------------- character to be inserted
+    //    |                |  |      |   +--------- 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",            0, 1,    'c', "cab",            0),
+
+    TEST ("",              0, 0,    ' ',  "",              0),
+    TEST ("",              0, 1,    'b',  "b",             0),
+
+    TEST ("<U0>",          0, 0,    ' ',  "<U0>",          0),
+    TEST ("<U0>",          1, 0,    ' ',  "<U0>",          0),
+    TEST ("",              0, 2,    '\0', "<U0>@2",        0),
+
+    TEST ("<U0>",          0, 1,    'a',  "a<U0>",         0),
+    TEST ("<U0>",          1, 1,    'a',  "<U0>a",         0),
+    TEST ("<U0>",          0, 1,    '\0', "<U0>@2",        0),
+    TEST ("<U0>",          1, 2,    '\0', "<U0>@3",        0),
+    TEST ("<U0>",          1, 0,    '\0', "<U0>",          0),
+
+    TEST ("cde",           0, 2,    'a',  "aacde",         0),
+    TEST ("cde",           1, 1,    'a',  "cade",          0),
+    TEST ("cde",           3, 3,    'a',  "cdeaaa",        0),
+    TEST ("cde",           2, 3,    'a',  "cdaaae",        0),
+
+    TEST ("ab",            0, 2,    '\0', "<U0>@2ab",      0),
+    TEST ("ab",            1, 1,    '\0', "a<U0>b",        0),
+    TEST ("ab",            2, 2,    '\0', "ab<U0>@2",      0),
+
+    TEST ("a<U0>b<U0>@2c", 3, 2,    '\0', "a<U0>b<U0>@3<U0>c",   0),
+    TEST ("a<U0>b<U0>@2c", 2, 1,    '\0', "a<U0>@2b<U0>@2c",     0),
+    TEST ("<U0>ab<U0>@2c", 0, 3,    '\0', "<U0>@3<U0>ab<U0>@2c", 0),
+    TEST ("a<U0>bc<U0>@2", 6, 2,    'a',  "a<U0>bc<U0>@2aa",     0),
+
+    TEST ("",              0, 4106, 'x',  "x@4106",        0),
+    TEST ("x@4096",        0, 2,    'a',  "aax@4096",      0),
+
+    TEST ("x@4096",        0, 2,    'a',  "aax@4096",      0),
+    TEST ("x@4096",        1, 2,    'a',  "xaax@4095",     0),
+    TEST ("x@4096",        1, 1,    '\0', "x<U0>x@4095",   0),
+
+    TEST ("x@127",         0, 1,    'x',  "x@128",         0),
+    TEST ("x@200",       128, 7,    'x',  "x@207",         0),
+    TEST ("x@331",       331, 3,    'x',  "x@334",         0),
+    TEST ("x@539",         0, 1,    'x',  "x@540",         0),
+    TEST ("x@539",         0, 873,  'x',  "x@1412",        0),
+    TEST ("x@873",       873, 1411, 'x',  "x@2284",        0),
+    TEST ("x@3694",      128, 1,    'x',  "x@3695",        0),
+    TEST ("x@540",         0, 1,    'x',  "x@541",         0),
+    TEST ("",              0, 3695, 'x',  "x@3695",        0),
+
+    TEST ("a",             0, 4095, 'x',  "x@4095a",       0),
+    TEST ("x@4096",        0, 2047, 'b',  "b@2047x@4096",  0),
+    TEST ("x@4096",     2047, 2048, 'x',  "x@6144",        0),
 
-    TEST ("last",      4, 4, 't',  "lasttttt",        0)
+    TEST ("last",          4, 4,    't',  "lasttttt",      0)
 };
 
 /**************************************************************************/
@@ -498,50 +498,50 @@
       0, res, sizeof res - 1, bthrow }
 
     //    +----------------------------------------- controlled sequence
-    //    |            +---------------------------- insert() pos argument
-    //    |            |    +----------------------- character to be inserted
-    //    |            |    |   +------------------- 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",        0,  'c', "cab",          0),
-
-    TEST ("",          0,  'b', "b",            0),
-    TEST ("",          0, '\0', "\0",           0),
-
-    TEST ("\0",        0,  'a', "a\0",          0),
-    TEST ("\0",        1,  'a', "\0a",          0),
-    TEST ("\0",        0, '\0', "\0\0",         0),
-    TEST ("\0",        1, '\0', "\0\0",         0),
-
-    TEST ("cde",       0,  'a', "acde",         0),
-    TEST ("cde",       1,  'a', "cade",         0),
-    TEST ("cde",       2,  'a', "cdae",         0),
-    TEST ("cde",       3,  'a', "cdea",         0),
-
-    TEST ("a\0b\0\0c", 3, '\0', "a\0b\0\0\0c",  0),
-    TEST ("\0ab\0\0c", 0, '\0', "\0\0ab\0\0c",  0),
-    TEST ("a\0bc\0\0", 6,  'a', "a\0bc\0\0a",   0),
-
-    TEST ("x@4096",    0,  'a',  "ax@4096",     0),
-    TEST ("x@4096",    1,  'a',  "xax@4095",    0),
-    TEST ("x@4096",    1, '\0',  "x\0x@4095",   0),
-
-    TEST ("x@127",     0, 'x',  "x@128",        0),
-    TEST ("x@206",     1, 'x',  "x@207",        0),
-    TEST ("x@333",   333, 'x',  "x@334",        0),
-    TEST ("x@539",   128, 'x',  "x@540",        0),
-    TEST ("x@1411",    0, 'x',  "x@1412",       0),
-    TEST ("x@2283",   10, 'x',  "x@2284",       0),
-    TEST ("x@3694", 3694, 'x',  "x@3695",       0),
-    TEST ("x@540",   538, 'x',  "x@541",        0),
+    //    |                +------------------------ insert() pos argument
+    //    |                |    +------------------- character to be inserted
+    //    |                |    |   +--------------- 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",            0,  'c', "cab",          0),
+
+    TEST ("",              0,  'b', "b",            0),
+    TEST ("",              0, '\0', "<U0>",         0),
+
+    TEST ("<U0>",          0,  'a', "a<U0>",        0),
+    TEST ("<U0>",          1,  'a', "<U0>a",        0),
+    TEST ("<U0>",          0, '\0', "<U0>@2",       0),
+    TEST ("<U0>",          1, '\0', "<U0>@2",       0),
+
+    TEST ("cde",           0,  'a', "acde",         0),
+    TEST ("cde",           1,  'a', "cade",         0),
+    TEST ("cde",           2,  'a', "cdae",         0),
+    TEST ("cde",           3,  'a', "cdea",         0),
+
+    TEST ("a<U0>b<U0>@2c", 3, '\0', "a<U0>b<U0>@3c",    0),
+    TEST ("<U0>ab<U0>@2c", 0, '\0', "<U0>@2ab<U0>@2c",  0),
+    TEST ("a<U0>bc<U0>@2", 6,  'a', "a<U0>bc<U0>@2a",   0),
+
+    TEST ("x@4096",        0,  'a', "ax@4096",      0),
+    TEST ("x@4096",        1,  'a', "xax@4095",     0),
+    TEST ("x@4096",        1, '\0', "x<U0>x@4095",  0),
+
+    TEST ("x@127",         0, 'x',  "x@128",        0),
+    TEST ("x@206",         1, 'x',  "x@207",        0),
+    TEST ("x@333",       333, 'x',  "x@334",        0),
+    TEST ("x@539",       128, 'x',  "x@540",        0),
+    TEST ("x@1411",        0, 'x',  "x@1412",       0),
+    TEST ("x@2283",       10, 'x',  "x@2284",       0),
+    TEST ("x@3694",     3694, 'x',  "x@3695",       0),
+    TEST ("x@540",       538, 'x',  "x@541",        0),
 
-    TEST ("last",      4,  't', "lastt",        0)
+    TEST ("last",          4,  't', "lastt",        0)
 };
 
 /**************************************************************************/
@@ -805,7 +805,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.iterators.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.iterators.cpp?rev=417904&r1=417903&r2=417904&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.iterators.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.iterators.cpp Wed Jun 28 16:47:10 2006
@@ -56,17 +56,17 @@
 }
 
     //    +--------------------------------- controlled sequence
-    //    |                +---------------- expected result 
-    //    |                |     
-    //    V                V     
-    TEST ("a",            'a' ), 
-    TEST ("\0",           '\0'),
-    TEST ("abc",          'a' ),  
-    TEST ("\0ab\0\0c",    '\0'), 
-    TEST ("a\0b\0\0c",    'a' ),  
-    TEST ("a\0bc\0\0",    'a' ), 
-    TEST ("x@4096",       'x' ),  
-    TEST ("last",         'l' )  
+    //    |                 +--------------- expected result 
+    //    |                 |     
+    //    V                 V     
+    TEST ("a",             'a' ), 
+    TEST ("<U0>",          '\0'),
+    TEST ("abc",           'a' ),  
+    TEST ("<U0>ab<U0>@2c", '\0'), 
+    TEST ("a<U0>b<U0>@2c", 'a' ),  
+    TEST ("a<U0>bc<U0>@2", 'a' ), 
+    TEST ("x@4096",        'x' ),  
+    TEST ("last",          'l' )  
 };
 
 /**************************************************************************/
@@ -84,17 +84,17 @@
 }
 
     //    +--------------------------------- controlled sequence
-    //    |                +---------------- expected result 
-    //    |                |     
-    //    V                V     
-    TEST ("a",            'a' ), 
-    TEST ("\0",           '\0'),
-    TEST ("abc",          'c' ),  
-    TEST ("\0ab\0\0c",    'c' ), 
-    TEST ("a\0b\0\0c",    'c' ),  
-    TEST ("a\0bc\0\0",    '\0'), 
-    TEST ("x@4096",       'x' ),  
-    TEST ("last",         't' )  
+    //    |                 +--------------- expected result 
+    //    |                 |     
+    //    V                 V     
+    TEST ("a",             'a' ), 
+    TEST ("<U0>",          '\0'),
+    TEST ("abc",           'c' ),  
+    TEST ("<U0>ab<U0>@2c", 'c' ), 
+    TEST ("a<U0>b<U0>@2c", 'c' ),  
+    TEST ("a<U0>bc<U0>@2", '\0'), 
+    TEST ("x@4096",        'x' ),  
+    TEST ("last",          't' )  
 };
 
 /**************************************************************************/
@@ -124,7 +124,7 @@
 
     TEST (""                ),
                              
-    TEST ("\0"              ),
+    TEST ("<U0>"              ),
                              
     TEST ("abcdefghij"      ),
     TEST ("abcdefghi"       ),
@@ -142,13 +142,13 @@
     TEST ("abcdffghij"      ),
     TEST ("abcdefghjj"      ),
                              
-    TEST ("a\0b\0\0c"       ),
-    TEST ("abc\0\0\0"       ),
-    TEST ("\0ab\0\0c"       ),
+    TEST ("a<U0>b<U0>@2c"   ),
+    TEST ("abc<U0>@3"       ),
+    TEST ("<U0>ab<U0>@2c"   ),
                              
-    TEST ("a\0b"            ),
-    TEST ("ab\0"            ),
-    TEST ("\0ab"            ),
+    TEST ("a<U0>b"          ),
+    TEST ("ab<U0>"          ),
+    TEST ("<U0>ab"          ),
                              
     TEST ("x@4096"          ),
     TEST ("xx"              ),
@@ -184,9 +184,9 @@
     //    V 
     TEST ("ab"            ),
     TEST (""              ),
-    TEST ("\0"            ),
+    TEST ("<U0>"          ),
     TEST ("x@4096"        ),
-    TEST ("a\0b"          ),
+    TEST ("a<U0>b"        ),
     TEST ("a@2048cb@2047" ),
     TEST ("last"          )
 };
@@ -381,7 +381,7 @@
                 // equal the corresponding elements of the string controlled
                 // by *this
                 const std::size_t match = 
-                    rw_match (tcase.res, ret_ptr, tcase.nres);
+                    rw_match (tcase.res, ret_ptr, tdata.reslen_);
 
                 rw_assert (match == tdata.reslen_, 0, tcase.line,
                            "line %d. %{$FUNCALL} expected %{#*s}, "



Mime
View raw message