mirror of
https://github.com/boostorg/functional.git
synced 2025-08-01 21:44:28 +02:00
Add test for strings of null character.
They're working, but wanted to make that explicitly clear.
This commit is contained in:
@@ -38,6 +38,23 @@ void string_tests()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void string0_tests()
|
||||||
|
{
|
||||||
|
std::string x1(1, '\0');
|
||||||
|
std::string x2(2, '\0');
|
||||||
|
std::string x3(3, '\0');
|
||||||
|
std::string x4(10, '\0');
|
||||||
|
|
||||||
|
BOOST_HASH_TEST_NAMESPACE::hash<std::string> hasher;
|
||||||
|
|
||||||
|
BOOST_TEST(hasher(x1) != hasher(x2));
|
||||||
|
BOOST_TEST(hasher(x1) != hasher(x3));
|
||||||
|
BOOST_TEST(hasher(x1) != hasher(x4));
|
||||||
|
BOOST_TEST(hasher(x2) != hasher(x3));
|
||||||
|
BOOST_TEST(hasher(x2) != hasher(x4));
|
||||||
|
BOOST_TEST(hasher(x3) != hasher(x4));
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(BOOST_NO_STD_WSTRING)
|
#if !defined(BOOST_NO_STD_WSTRING)
|
||||||
void wstring_tests()
|
void wstring_tests()
|
||||||
{
|
{
|
||||||
@@ -66,6 +83,7 @@ void wstring_tests()
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
string_tests();
|
string_tests();
|
||||||
|
string0_tests();
|
||||||
#if !defined(BOOST_NO_STD_WSTRING)
|
#if !defined(BOOST_NO_STD_WSTRING)
|
||||||
wstring_tests();
|
wstring_tests();
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user