From 335e4ce8ca3b598ce4fc1f811a8371afb38521a2 Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 30 Oct 2015 11:50:28 -0700 Subject: [PATCH] options_test: fix a bug of assertion Summary: new_cf_opt.table_factory->Name() is char*, ASSERT_EQ doesn't work with char* directly. Construct a string using it. Test Plan: Run the test that failed. Reviewers: igor, kradhakrishnan, rven, IslamAbdelRahman, anthony Reviewed By: anthony Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D49767 --- util/options_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/options_test.cc b/util/options_test.cc index d5ef73c56..1cabce6c1 100644 --- a/util/options_test.cc +++ b/util/options_test.cc @@ -599,7 +599,7 @@ TEST_F(OptionsTest, GetColumnFamilyOptionsFromStringTest) { "plain_table_factory={};arena_block_size=1024", &new_cf_opt)); ASSERT_TRUE(new_cf_opt.table_factory != nullptr); - ASSERT_EQ(new_cf_opt.table_factory->Name(), "PlainTable"); + ASSERT_EQ(std::string(new_cf_opt.table_factory->Name()), "PlainTable"); // Non-empty ASSERT_OK(GetColumnFamilyOptionsFromString(base_cf_opt, "write_buffer_size=10;max_write_buffer_number=16;" @@ -607,7 +607,7 @@ TEST_F(OptionsTest, GetColumnFamilyOptionsFromStringTest) { "arena_block_size=1024", &new_cf_opt)); ASSERT_TRUE(new_cf_opt.table_factory != nullptr); - ASSERT_EQ(new_cf_opt.table_factory->Name(), "PlainTable"); + ASSERT_EQ(std::string(new_cf_opt.table_factory->Name()), "PlainTable"); } #endif // !ROCKSDB_LITE