Fix Mac compile error: C++11 forbids default arguments for lambda expressions

Summary:
Fix the following Mac compile error.
db/db_test.cc:8686:52: error: C++11 forbids default arguments for lambda expressions [-Werror,-Wlambda-extensions]
  auto gen_l0_kb = [this](int start, int size, int stride = 1) {
                                                   ^        ~
Test Plan:
db_test
This commit is contained in:
Yueh-Hsuan Chiang 2014-10-17 14:46:40 -07:00
parent f4363fb81c
commit 5db9e76644

View File

@ -8683,7 +8683,7 @@ TEST(DBTest, DynamicCompactionOptions) {
env_->SetBackgroundThreads(1, Env::HIGH);
DestroyAndReopen(&options);
auto gen_l0_kb = [this](int start, int size, int stride = 1) {
auto gen_l0_kb = [this](int start, int size, int stride) {
Random rnd(301);
for (int i = 0; i < size; i++) {
ASSERT_OK(Put(Key(start + stride * i), RandomString(&rnd, 1024)));
@ -8693,11 +8693,11 @@ TEST(DBTest, DynamicCompactionOptions) {
// Write 3 files that have the same key range, trigger compaction and
// result in one L1 file
gen_l0_kb(0, 64);
gen_l0_kb(0, 64, 1);
ASSERT_EQ(NumTableFilesAtLevel(0), 1);
gen_l0_kb(0, 64);
gen_l0_kb(0, 64, 1);
ASSERT_EQ(NumTableFilesAtLevel(0), 2);
gen_l0_kb(0, 64);
gen_l0_kb(0, 64, 1);
dbfull()->TEST_WaitForCompact();
ASSERT_EQ("0,1", FilesPerLevel());
std::vector<LiveFileMetaData> metadata;
@ -8712,9 +8712,9 @@ TEST(DBTest, DynamicCompactionOptions) {
{"target_file_size_base", std::to_string(k32KB) }
}));
gen_l0_kb(0, 64);
gen_l0_kb(0, 64, 1);
ASSERT_EQ("1,1", FilesPerLevel());
gen_l0_kb(0, 64);
gen_l0_kb(0, 64, 1);
dbfull()->TEST_WaitForCompact();
ASSERT_EQ("0,2", FilesPerLevel());
metadata.clear();