+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):
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);
}
#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;
}
-
-
-
}
#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()
#if _GLIBCPP_USE_WCHAR_T
test01();
test02();
+ test03();
#endif
return 0;
}
-
-
-
-