This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[libstdc++] Fix for 22_locale/collate_byname.cc
- From: Peter Schmid <schmid at snake dot iap dot physik dot tu-darmstadt dot de>
- To: <bkoz at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 17 Feb 2002 00:17:44 +0100 (CET)
- Subject: [libstdc++] Fix for 22_locale/collate_byname.cc
The 22_locale/collate_members_char.cc test does not pass. That is
because of the wrong end argument in the transform and compare
string collation calls for str5. To make this consistent with the
corresponding string str3, the end argument, strlit3 + size4, should
be replaced with strlit3 + size3. After applying the appended patch
collate_byname passes.
Hope this helps,
Peter Schmid
2002-02-16 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
* testsuite/22_locale/collate_byname.cc (test01): Replace size4
with size3 for the string collations of str5.
*** collate_byname.cc~ Sat Feb 16 22:01:49 2002
--- collate_byname.cc Sat Feb 16 22:15:26 2002
*************** void test01()
*** 120,128 ****
l4 = coll_de.hash(strlit4, strlit4 + size4);
VERIFY ( l3 != l4 );
! string str5 = coll_de.transform(strlit3, strlit3 + size4);
string str6 = coll_de.transform(strlit4, strlit4 + size4);
! i3 = coll_de.compare(str5.c_str(), str5.c_str() + size4,
str6.c_str(), str6.c_str() + size4);
i4 = coll_de.compare(strlit3, strlit3 + size4, strlit4, strlit4 + size4);
VERIFY(i3 == i4);
--- 120,128 ----
l4 = coll_de.hash(strlit4, strlit4 + size4);
VERIFY ( l3 != l4 );
! string str5 = coll_de.transform(strlit3, strlit3 + size3);
string str6 = coll_de.transform(strlit4, strlit4 + size4);
! i3 = coll_de.compare(str5.c_str(), str5.c_str() + size3,
str6.c_str(), str6.c_str() + size4);
i4 = coll_de.compare(strlit3, strlit3 + size4, strlit4, strlit4 + size4);
VERIFY(i3 == i4);