stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ant...@apache.org
Subject svn commit: r391043 - /incubator/stdcxx/trunk/tests/self/0.char.cpp
Date Mon, 03 Apr 2006 13:35:09 GMT
Author: antonp
Date: Mon Apr  3 06:35:07 2006
New Revision: 391043

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

	* 0.char.cpp (rw_widen): Exercised r391042
	(rw_narrow): The same.

Modified:
    incubator/stdcxx/trunk/tests/self/0.char.cpp

Modified: incubator/stdcxx/trunk/tests/self/0.char.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/self/0.char.cpp?rev=391043&r1=391042&r2=391043&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/self/0.char.cpp (original)
+++ incubator/stdcxx/trunk/tests/self/0.char.cpp Mon Apr  3 06:35:07 2006
@@ -383,7 +383,7 @@
     rw_info (0, 0, 0, "rw_widen(char*, const char*, size_t)");
 
     static const char   src []  = "abcdefgh";
-    static const size_t nsrc = sizeof src;
+    const size_t nsrc = sizeof src - 1;
     static const char   null [nsrc + 1] = "";
     char                cdst [nsrc + 1];
 
@@ -443,8 +443,8 @@
     memset (wdst, '@', sizeof wdst);
     rw_widen (wdst, 0, sizeof wdst / sizeof *wdst);
 
-    rw_assert (0 == memcmp (wdst, wnull, nsrc + 1), 0, __LINE__,
-               "rw_widen(char*, %{#s}, %zu) == %{#*s}, got L%{#*ls}",
+    rw_assert (0 == memcmp (wdst, wnull, sizeof wdst), 0, __LINE__,
+               "rw_widen(wchar_t*, %{#s}, %zu) == %{#*s}, got L%{#*ls}",
                0, sizeof wdst, int (sizeof wdst / sizeof *wdst), wnull,
                int (sizeof wdst / sizeof *wdst), wdst);
 
@@ -462,6 +462,12 @@
         { 0, 'e' }, { 0, 'f' }, { 0, 'g' }, { 0, 'h' },
         { 0, '\0' }
     };
+    static const UserChar unull [] = {
+        { 0, '\0' }, { 0, '\0' }, { 0, '\0' }, { 0, '\0' },
+        { 0, '\0' }, { 0, '\0' }, { 0, '\0' }, { 0, '\0' },
+        { 0, '\0' }
+    };
+
     UserChar udst [nsrc + 1];
 
     for (size_t i = 0; i != nsrc + 1; ++i) {
@@ -485,8 +491,8 @@
     memset (udst, 1, sizeof udst);
     rw_widen (udst, 0, sizeof udst / sizeof *udst);
 
-    rw_assert (0 == memcmp (wdst, wnull, nsrc + 1), 0, __LINE__,
-               "rw_widen(char*, %{#s}, %zu)",
+    rw_assert (0 == memcmp (udst, unull, sizeof udst), 0, __LINE__,
+               "rw_widen(UserChar*, %{#s}, %zu)",
                0, sizeof udst, int (sizeof udst), wnull);
 }
 
@@ -499,7 +505,7 @@
     rw_info (0, 0, 0, "rw_narrow(char*, const char*, size_t)");
 
     static const char   src []  = "abcdefgh";
-    static const size_t nsrc = sizeof src;
+    const size_t nsrc = sizeof src - 1;
     static const char   null [nsrc + 1] = "";
     char                cdst [nsrc + 1];
 



Mime
View raw message