Fixed valgrind error in DBTest.CompressedCache

Summary:
Fixed valgrind error in DBTest.CompressedCache.
This fixes the valgrind error (thanks to Haobo). I am still trying to reproduce the test-failure case deterministically.

Test Plan: db_test

Reviewers: haobo

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D13899
This commit is contained in:
Dhruba Borthakur 2013-11-04 22:02:59 -08:00
parent f837f5b1c9
commit 7845fd9db9

View File

@ -1797,12 +1797,12 @@ TEST(DBTest, CompressedCache) {
// Write 8MB (80 values, each 100K)
ASSERT_EQ(NumTableFilesAtLevel(0), 0);
std::vector<std::string> values;
Slice str;
std::string str;
for (int i = 0; i < num_iter; i++) {
if (i % 4 == 0) { // high compression ratio
str = RandomString(&rnd, 100000);
}
values.push_back(str.ToString(true));
values.push_back(str);
ASSERT_OK(Put(Key(i), values[i]));
}