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 <[EMAIL PROTECTED]>
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);
}