]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/utilities/cassandra/cassandra_serialize_test.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / utilities / cassandra / cassandra_serialize_test.cc
index 8d0cf66672c9f1d19709d9e7f50873c7e4ec585a..c14d8fd809d6d5fbf55e82c4dbf513709bfed935 100644 (file)
@@ -6,46 +6,39 @@
 #include "test_util/testharness.h"
 #include "utilities/cassandra/serialize.h"
 
-
 namespace ROCKSDB_NAMESPACE {
 namespace cassandra {
 
 TEST(SerializeTest, SerializeI64) {
   std::string dest;
   Serialize<int64_t>(0, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00'}),
-      dest);
+  EXPECT_EQ(std::string({'\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00',
+                         '\x00'}),
+            dest);
 
   dest.clear();
   Serialize<int64_t>(1, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x01'}),
-      dest);
-
+  EXPECT_EQ(std::string({'\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00',
+                         '\x01'}),
+            dest);
 
   dest.clear();
   Serialize<int64_t>(-1, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\xff', '\xff', '\xff', '\xff', '\xff', '\xff', '\xff', '\xff'}),
-      dest);
+  EXPECT_EQ(std::string({'\xff', '\xff', '\xff', '\xff', '\xff', '\xff', '\xff',
+                         '\xff'}),
+            dest);
 
   dest.clear();
   Serialize<int64_t>(9223372036854775807, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x7f', '\xff', '\xff', '\xff', '\xff', '\xff', '\xff', '\xff'}),
-      dest);
+  EXPECT_EQ(std::string({'\x7f', '\xff', '\xff', '\xff', '\xff', '\xff', '\xff',
+                         '\xff'}),
+            dest);
 
   dest.clear();
   Serialize<int64_t>(-9223372036854775807, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x80', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x01'}),
-      dest);
+  EXPECT_EQ(std::string({'\x80', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00',
+                         '\x01'}),
+            dest);
 }
 
 TEST(SerializeTest, DeserializeI64) {
@@ -74,39 +67,23 @@ TEST(SerializeTest, DeserializeI64) {
 TEST(SerializeTest, SerializeI32) {
   std::string dest;
   Serialize<int32_t>(0, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x00', '\x00', '\x00', '\x00'}),
-      dest);
+  EXPECT_EQ(std::string({'\x00', '\x00', '\x00', '\x00'}), dest);
 
   dest.clear();
   Serialize<int32_t>(1, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x00', '\x00', '\x00', '\x01'}),
-      dest);
-
+  EXPECT_EQ(std::string({'\x00', '\x00', '\x00', '\x01'}), dest);
 
   dest.clear();
   Serialize<int32_t>(-1, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\xff', '\xff', '\xff', '\xff'}),
-      dest);
+  EXPECT_EQ(std::string({'\xff', '\xff', '\xff', '\xff'}), dest);
 
   dest.clear();
   Serialize<int32_t>(2147483647, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x7f', '\xff', '\xff', '\xff'}),
-      dest);
+  EXPECT_EQ(std::string({'\x7f', '\xff', '\xff', '\xff'}), dest);
 
   dest.clear();
   Serialize<int32_t>(-2147483648LL, &dest);
-  EXPECT_EQ(
-      std::string(
-          {'\x80', '\x00', '\x00', '\x00'}),
-      dest);
+  EXPECT_EQ(std::string({'\x80', '\x00', '\x00', '\x00'}), dest);
 }
 
 TEST(SerializeTest, DeserializeI32) {
@@ -141,7 +118,6 @@ TEST(SerializeTest, SerializeI8) {
   Serialize<int8_t>(1, &dest);
   EXPECT_EQ(std::string({'\x01'}), dest);
 
-
   dest.clear();
   Serialize<int8_t>(-1, &dest);
   EXPECT_EQ(std::string({'\xff'}), dest);
@@ -178,10 +154,11 @@ TEST(SerializeTest, DeserializeI8) {
   EXPECT_EQ(-128, Deserialize<int8_t>(dest.c_str(), offset));
 }
 
-} // namespace cassandra
+}  // namespace cassandra
 }  // namespace ROCKSDB_NAMESPACE
 
 int main(int argc, char** argv) {
+  ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
 }