tests/test_hash_key.cpp

changeset 690
2c2304622981
parent 663
d50b5dc1e058
--- a/tests/test_hash_key.cpp	Thu Apr 20 19:13:25 2023 +0200
+++ b/tests/test_hash_key.cpp	Fri Apr 21 18:38:18 2023 +0200
@@ -49,10 +49,7 @@
     EXPECT_EQ(cxstr_key.len, len);
     EXPECT_EQ(bytes_key.len, len);
     EXPECT_EQ(bytes_key.len, len);
-    EXPECT_EQ(str_key.data.cstr, str);
-    EXPECT_EQ(bytes_key.data.cbytes, reinterpret_cast<unsigned char const *>(str));
-    EXPECT_EQ(bytes_key.data.cobj, reinterpret_cast<void const *>(str));
-    EXPECT_EQ(cxstr_key.data.cobj, reinterpret_cast<void const *>(str));
+    EXPECT_EQ(str_key.data, str);
 }
 
 TEST(cx_hash_key, empty_string) {
@@ -70,9 +67,7 @@
     EXPECT_EQ(str_key.len, 0);
     EXPECT_EQ(bytes_key.len, 0);
     EXPECT_EQ(bytes_key.len, 0);
-    EXPECT_EQ(str_key.data.cstr, str);
-    EXPECT_EQ(bytes_key.data.cbytes, reinterpret_cast<unsigned char const *>(str));
-    EXPECT_EQ(bytes_key.data.cobj, reinterpret_cast<void const *>(str));
+    EXPECT_EQ(str_key.data, str);
 }
 
 TEST(cx_hash_key, null_ptr) {
@@ -86,7 +81,5 @@
     EXPECT_EQ(str_key.len, 0);
     EXPECT_EQ(bytes_key.len, 0);
     EXPECT_EQ(bytes_key.len, 0);
-    EXPECT_EQ(str_key.data.cstr, nullptr);
-    EXPECT_EQ(bytes_key.data.cbytes, nullptr);
-    EXPECT_EQ(bytes_key.data.cobj, nullptr);
+    EXPECT_EQ(str_key.data, nullptr);
 }

mercurial