From f5e22ce607c0734b32b76ed8fc29dcbdbff75c35 Mon Sep 17 00:00:00 2001 From: darionyaphet Date: Thu, 1 Oct 2020 15:21:17 -0700 Subject: [PATCH] fix dummy collector's name (#7442) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/7442 Reviewed By: jay-zhuang Differential Revision: D24011201 Pulled By: ajkr fbshipit-source-id: 54f24c29875f7575612a780f15a42cda918d6641 --- table/table_test.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/table/table_test.cc b/table/table_test.cc index f736f3458..afaf1f1bd 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -70,7 +70,7 @@ const std::string kDummyValue(10000, 'o'); // DummyPropertiesCollector used to test BlockBasedTableProperties class DummyPropertiesCollector : public TablePropertiesCollector { public: - const char* Name() const override { return ""; } + const char* Name() const override { return "DummyPropertiesCollector"; } Status Finish(UserCollectedProperties* /*properties*/) override { return Status::OK(); @@ -92,7 +92,9 @@ class DummyPropertiesCollectorFactory1 TablePropertiesCollectorFactory::Context /*context*/) override { return new DummyPropertiesCollector(); } - const char* Name() const override { return "DummyPropertiesCollector1"; } + const char* Name() const override { + return "DummyPropertiesCollectorFactory1"; + } }; class DummyPropertiesCollectorFactory2 @@ -102,7 +104,9 @@ class DummyPropertiesCollectorFactory2 TablePropertiesCollectorFactory::Context /*context*/) override { return new DummyPropertiesCollector(); } - const char* Name() const override { return "DummyPropertiesCollector2"; } + const char* Name() const override { + return "DummyPropertiesCollectorFactory2"; + } }; // Return reverse of "key". @@ -1498,8 +1502,9 @@ TEST_P(BlockBasedTableTest, BlockBasedTableProperties2) { ASSERT_EQ("rocksdb.ReverseBytewiseComparator", props.comparator_name); ASSERT_EQ("UInt64AddOperator", props.merge_operator_name); ASSERT_EQ("rocksdb.Noop", props.prefix_extractor_name); - ASSERT_EQ("[DummyPropertiesCollector1,DummyPropertiesCollector2]", - props.property_collectors_names); + ASSERT_EQ( + "[DummyPropertiesCollectorFactory1,DummyPropertiesCollectorFactory2]", + props.property_collectors_names); ASSERT_EQ("", props.filter_policy_name); // no filter policy is used c.ResetTableReader(); } @@ -2186,7 +2191,8 @@ class CustomFlushBlockPolicy : public FlushBlockPolicyFactory, explicit CustomFlushBlockPolicy(std::vector keys_per_block) : keys_per_block_(keys_per_block) {} - const char* Name() const override { return "table_test"; } + const char* Name() const override { return "CustomFlushBlockPolicy"; } + FlushBlockPolicy* NewFlushBlockPolicy(const BlockBasedTableOptions&, const BlockBuilder&) const override { return new CustomFlushBlockPolicy(keys_per_block_);