stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r552912 - in /incubator/stdcxx/trunk/tests/strings: 21.string.access.cpp 21.string.copy.cpp
Date Tue, 03 Jul 2007 17:01:01 GMT
Author: faridz
Date: Tue Jul  3 10:00:59 2007
New Revision: 552912

URL: http://svn.apache.org/viewvc?view=rev&rev=552912
Log:
2007-07-03 Farid Zaripov <Farid_Zaripov@epam.com>

	* 21.string.access.cpp (test_access): Avoid use rw_match() for
	comparing the single characters.
	* 21.string.copy.cpp (test_copy): Ditto.

Modified:
    incubator/stdcxx/trunk/tests/strings/21.string.access.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp

Modified: incubator/stdcxx/trunk/tests/strings/21.string.access.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.access.cpp?view=diff&rev=552912&r1=552911&r2=552912
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.access.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.access.cpp Tue Jul  3 10:00:59 2007
@@ -266,10 +266,12 @@
             return;
         }
 
-        const char exp_res =
-            NPOS != tcase.nres ? char (tcase.nres) : char ();
+        const char exp_res [2] = {
+            NPOS != tcase.nres ? char (tcase.nres) : char (),
+            char ()
+        };
 
-        const bool success = 1 == rw_match (&exp_res, pres, 1);
+        const bool success = 1 == rw_match (exp_res, pres, 1);
 
         rw_assert (success, 0, tcase.line,
                    "line %d. %{$FUNCALL} == %{#c}, got %{#c}",

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?view=diff&rev=552912&r1=552911&r2=552912
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.copy.cpp Tue Jul  3 10:00:59 2007
@@ -187,11 +187,12 @@
     std::size_t res = 0;
 
     // create destination array and initialize it with garbage
-    charT* const s_res = new charT [min_len + 1];
+    charT* const s_res = new charT [min_len + 2];
 
-    char cgb = '#';
-    charT wcgb = make_char (cgb, (charT*)0);
+    const char cgb [2] = "#";
+    const charT wcgb = make_char (cgb [0], (charT*)0);
     Traits::assign (s_res, min_len + 1, wcgb);
+    s_res [min_len + 1] = charT ();
 
     // save the state of the string object before the call
     // to detect wxception safety violations (changes to
@@ -247,7 +248,7 @@
                        __LINE__, int (tcase.nres), tcase.res, 
                        int (sizeof (charT)), int (res), s_res, match);
 
-            success = 1 == rw_match (&cgb, &s_res [min_len], 1);
+            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__);



Mime
View raw message