Skip to content

Commit

Permalink
fixed memory leak in unit test DBIteratorBoundTest
Browse files Browse the repository at this point in the history
Summary: fixed memory leak in unit test DBIteratorBoundTest

Test Plan: ran valgrind test on my unit test

Reviewers: sdong

Differential Revision: https://reviews.facebook.net/D22911
  • Loading branch information
Raghav Pisolkar committed Sep 5, 2014
1 parent adcd253 commit 0fbb3fa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7791,7 +7791,8 @@ TEST(DBTest, DBIteratorBoundTest) {
{
ReadOptions ro;
// iterate_upper_bound points beyond the last expected entry
ro.iterate_upper_bound = new Slice("foo2");
Slice prefix("foo2");
ro.iterate_upper_bound = &prefix;

std::unique_ptr<Iterator> iter(db_->NewIterator(ro));

Expand Down Expand Up @@ -7823,7 +7824,8 @@ TEST(DBTest, DBIteratorBoundTest) {
// This should be an error
{
ReadOptions ro;
ro.iterate_upper_bound = new Slice("g1");
Slice prefix("g1");
ro.iterate_upper_bound = &prefix;

std::unique_ptr<Iterator> iter(db_->NewIterator(ro));

Expand Down Expand Up @@ -7868,7 +7870,8 @@ TEST(DBTest, DBIteratorBoundTest) {
ASSERT_EQ(static_cast<int>(perf_context.internal_delete_skipped_count), 2);

// now testing with iterate_bound
ro.iterate_upper_bound = new Slice("c");
Slice prefix("c");
ro.iterate_upper_bound = &prefix;

iter.reset(db_->NewIterator(ro));

Expand Down

0 comments on commit 0fbb3fa

Please sign in to comment.