]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/functional/hash/test/hash_number_test.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / functional / hash / test / hash_number_test.cpp
index 9adb5c6c949a8763c0b29e5df807b8aabf728fa6..18756c32a68e30739450a81681a7c0896215dbbc 100644 (file)
@@ -127,9 +127,13 @@ void poor_quality_tests(T*)
         BOOST_TEST(x1(T(1)) !=  x2(T(-1)));
     if(T(1) != T(2))
         BOOST_TEST(x1(T(1)) !=  x2(T(2)));
-    if((limits::max)() != (limits::max)() - 1)
-        BOOST_TEST(x1(static_cast<T>((limits::max)()))
-            != x2(static_cast<T>((limits::max)() - 1)));
+
+    // TODO: This test is useless for floating point numbers.
+    T max_number = static_cast<T>((limits::max)());
+    T max_minus_one = static_cast<T>(max_number - 1);
+    if (max_number != max_minus_one) {
+        BOOST_TEST(x1(max_number) != x1(max_minus_one));
+    }
 }
 
 void bool_test()
@@ -160,6 +164,12 @@ int main()
     NUMERIC_TEST(unsigned char, uchar)
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
     NUMERIC_TEST(wchar_t, wchar)
+#endif
+#ifndef BOOST_NO_CXX11_CHAR16_T
+    NUMERIC_TEST(char16_t, char16)
+#endif
+#ifndef BOOST_NO_CXX11_CHAR32_T
+    NUMERIC_TEST(char32_t, char32)
 #endif
     NUMERIC_TEST(short, short)
     NUMERIC_TEST(unsigned short, ushort)