From a9639bda8471ff57ed5bcefefa25ba67207dd96f Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 11 Sep 2014 15:36:30 -0700 Subject: [PATCH] Fix valgrind test Summary: Get valgrind to stop complaining about uninitialized value Test Plan: valgrind not complaining anymore Reviewers: sdong, yhchiang, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D23289 --- db/db_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index f79167adb..a7c88eddd 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -2799,16 +2799,17 @@ TEST(DBTest, FlushSchedule) { CreateAndReopenWithCF({"pikachu"}, &options); std::vector threads; - std::atomic thread_num; + std::atomic thread_num(0); // each column family will have 5 thread, each thread generating 2 memtables. // each column family should end up with 10 table files for (int i = 0; i < 10; ++i) { threads.emplace_back([&]() { int a = thread_num.fetch_add(1); Random rnd(a); + WriteOptions wo; // this should fill up 2 memtables for (int k = 0; k < 5000; ++k) { - Put(a & 1, RandomString(&rnd, 13), ""); + ASSERT_OK(db_->Put(wo, handles_[a & 1], RandomString(&rnd, 13), "")); } }); }