Fix the valgrind error in newly added unittests for table stats

Summary:

Previous the newly added test called NewBloomFilter without releasing it at the end of the test, which resulted in memory leak and was detected by valgrind.

Test Plan:

Ran valgrind test.
main
Kai Liu 11 years ago
parent bcc8557901
commit 43ee5e2b3a
  1. 5
      table/table_test.cc

@ -906,7 +906,10 @@ TEST(TableTest, FilterPolicyNameStats) {
std::vector<std::string> keys;
KVMap kvmap;
Options options;
options.filter_policy = NewBloomFilterPolicy(10);
std::unique_ptr<const FilterPolicy> filter_policy(
NewBloomFilterPolicy(10)
);
options.filter_policy = filter_policy.get();
c.Finish(options, &keys, &kvmap);
auto& stats = c.table()->GetTableStats();

Loading…
Cancel
Save