Delete test iterators

Summary:
Valgrind reports an issue with the test for GeoIterator.
This diff explicitly deletes the two iterators used in this test.

Test Plan: This diff is for a test. The test still passes.

Reviewers: IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D50193
This commit is contained in:
Satnam Singh 2015-11-05 13:30:51 -08:00
parent 9d50afc3b9
commit c8e01ef982

View File

@ -103,21 +103,23 @@ TEST_F(GeoDBTest, Search) {
// search all objects centered at 46 degree latitude with
// a radius of 200 kilometers. We should find the one object that
// we inserted earlier.
GeoIterator* iter = getdb()->SearchRadial(GeoPosition(46, 46), 200000);
GeoIterator* iter1 = getdb()->SearchRadial(GeoPosition(46, 46), 200000);
ASSERT_TRUE(status.ok());
ASSERT_EQ(iter->geo_object().value, "midvalue1");
ASSERT_EQ(iter1->geo_object().value, "midvalue1");
uint32_t size = 0;
while (iter->Valid()) {
while (iter1->Valid()) {
size++;
iter->Next();
iter1->Next();
}
ASSERT_EQ(size, 1U);
delete iter1;
// search all objects centered at 46 degree latitude with
// a radius of 2 kilometers. There should be none.
iter = getdb()->SearchRadial(GeoPosition(46, 46), 2);
GeoIterator* iter2 = getdb()->SearchRadial(GeoPosition(46, 46), 2);
ASSERT_TRUE(status.ok());
ASSERT_FALSE(iter->Valid());
ASSERT_FALSE(iter2->Valid());
delete iter2;
}
} // namespace rocksdb