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.
This commit is contained in:
Kai Liu
2013-10-20 22:02:05 -07:00
parent bcc8557901
commit 43ee5e2b3a

View File

@@ -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();