mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 10:57:12 +08:00
locale_facets.tcc (collate::do_hash): Fix.
2002-02-11 Aaron W LaFramboise <AWLaFramboise@aol.com> * include/bits/locale_facets.tcc (collate::do_hash): Fix. * testsuite/22_locale/collate_members_char.cc (test03): New test. * testsuite/22_locale/collate_members_wchar_t.cc (test03): Same. From-SVN: r49682
This commit is contained in:
parent
df61a3d22a
commit
4e2f8bcf6f
@ -1,3 +1,9 @@
|
||||
2002-02-11 Aaron W LaFramboise <AWLaFramboise@aol.com>
|
||||
|
||||
* include/bits/locale_facets.tcc (collate::do_hash): Fix.
|
||||
* testsuite/22_locale/collate_members_char.cc (test03): New test.
|
||||
* testsuite/22_locale/collate_members_wchar_t.cc (test03): Same.
|
||||
|
||||
2002-02-10 Phil Edwards <pme@gcc.gnu.org>
|
||||
|
||||
* include/bits/stl_algo.h (transform (both signatures), generate_n):
|
||||
|
@ -1855,7 +1855,7 @@ namespace std
|
||||
unsigned long __val = 0;
|
||||
for (; __lo < __hi; ++__lo)
|
||||
__val = *__lo + ((__val << 7) |
|
||||
(__val >> (numeric_limits<unsigned long>::digits - 1)));
|
||||
(__val >> (numeric_limits<unsigned long>::digits - 7)));
|
||||
return static_cast<long>(__val);
|
||||
}
|
||||
|
||||
|
@ -147,12 +147,24 @@ void test02()
|
||||
#endif
|
||||
}
|
||||
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
std::string str1("fffff");
|
||||
std::string str2("ffffffffffff");
|
||||
|
||||
const std::locale cloc = std::locale::classic();
|
||||
const std::collate<char> &col = std::use_facet<std::collate<char> >(cloc);
|
||||
|
||||
long l1 = col.hash(str1.c_str(), str1.c_str() + str1.size());
|
||||
long l2 = col.hash(str2.c_str(), str2.c_str() + str2.size());
|
||||
VERIFY( l1 != l2 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -146,6 +146,20 @@ void test02()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
std::wstring str1(L"fffff");
|
||||
std::wstring str2(L"ffffffffffff");
|
||||
|
||||
const std::locale cloc = std::locale::classic();
|
||||
const std::collate<wchar_t> &col = std::use_facet<std::collate<wchar_t> >(cloc);
|
||||
|
||||
long l1 = col.hash(str1.c_str(), str1.c_str() + str1.size());
|
||||
long l2 = col.hash(str2.c_str(), str2.c_str() + str2.size());
|
||||
VERIFY( l1 != l2 );
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
@ -153,10 +167,7 @@ int main()
|
||||
#if _GLIBCPP_USE_WCHAR_T
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user