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
main
Dhruba Borthakur 11 years ago
parent f837f5b1c9
commit 7845fd9db9
  1. 4
      db/db_test.cc

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

Loading…
Cancel
Save