stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r647729 - /stdcxx/trunk/tests/self/0.char.cpp
Date Mon, 14 Apr 2008 10:46:08 GMT
Author: faridz
Date: Mon Apr 14 03:46:07 2008
New Revision: 647729

URL: http://svn.apache.org/viewvc?rev=647729&view=rev
Log:
2008-04-14 Farid Zaripov <farid_zaripov@epam.com>

	STDXX-862
	* tests/self/0.char.cpp (test_rw_widen): Use UserTraits<UserChar>::compare() instead
	of memcmp() to avoid false assertions due to possibly different binary representation
	of (long double)0 and (long double)0. on Sun C++ 5.9 / Linux.

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

Modified: stdcxx/trunk/tests/self/0.char.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/self/0.char.cpp?rev=647729&r1=647728&r2=647729&view=diff
==============================================================================
--- stdcxx/trunk/tests/self/0.char.cpp (original)
+++ stdcxx/trunk/tests/self/0.char.cpp Mon Apr 14 03:46:07 2008
@@ -467,6 +467,8 @@
         { 0, '\0' }
     };
 
+    typedef UserTraits<UserChar> Traits;
+
     UserChar udst [nsrc + 1];
 
     for (size_t i = 0; i != nsrc + 1; ++i) {
@@ -480,7 +482,7 @@
                    "rw_widen(UserChar*, %{#s}%{?}, %zu%{;})",
                    src, i < nsrc, i);
 
-        rw_assert (   0 == memcmp (udst, usrc, i * sizeof *udst)
+        rw_assert (   0 == Traits::compare (udst, usrc, i)
                    && 0 == udst [i].f && 0 == udst [i].c,
                    0, __LINE__,
                    "rw_widen(UserChar*, %{#s}%{?}, %zu%{;})",
@@ -490,7 +492,7 @@
     memset (udst, 1, sizeof udst);
     rw_widen (udst, 0, sizeof udst / sizeof *udst);
 
-    rw_assert (0 == memcmp (udst, unull, sizeof udst), 0, __LINE__,
+    rw_assert (0 == Traits::compare (udst, unull, nsrc + 1), 0, __LINE__,
                "rw_widen(UserChar*, %{#s}, %zu)",
                0, sizeof udst, int (sizeof udst), wnull);
 }



Mime
View raw message