From 7845fd9db903f8075a7c78e59f8a1f11e4c33e42 Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Mon, 4 Nov 2013 22:02:59 -0800 Subject: [PATCH] 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 --- db/db_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index 5bcbde803..0f56a7cd0 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -1797,12 +1797,12 @@ TEST(DBTest, CompressedCache) { // Write 8MB (80 values, each 100K) ASSERT_EQ(NumTableFilesAtLevel(0), 0); std::vector 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])); }