Fixed compile error on Mac: default arguments for lambda expressions
Summary: Fixed the following compile error on Mac. db/db_test.cc:8618: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) { ^ ~ 1 error generated. Test Plan: db_test
This commit is contained in:
parent
cd0d581ff5
commit
5a76186340
@ -8615,7 +8615,7 @@ TEST(DBTest, DynamicCompactionOptions) {
|
||||
options.max_bytes_for_level_multiplier = 4;
|
||||
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);
|
||||
std::vector<std::string> values;
|
||||
for (int i = 0; i < size; i++) {
|
||||
@ -8627,11 +8627,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, 128);
|
||||
gen_l0_kb(0, 128, 1);
|
||||
ASSERT_EQ(NumTableFilesAtLevel(0), 1);
|
||||
gen_l0_kb(0, 128);
|
||||
gen_l0_kb(0, 128, 1);
|
||||
ASSERT_EQ(NumTableFilesAtLevel(0), 2);
|
||||
gen_l0_kb(0, 128);
|
||||
gen_l0_kb(0, 128, 1);
|
||||
dbfull()->TEST_WaitForCompact();
|
||||
ASSERT_EQ("0,1", FilesPerLevel());
|
||||
std::vector<LiveFileMetaData> metadata;
|
||||
@ -8646,9 +8646,9 @@ TEST(DBTest, DynamicCompactionOptions) {
|
||||
{"target_file_size_base", "65536"}
|
||||
}));
|
||||
|
||||
gen_l0_kb(0, 128);
|
||||
gen_l0_kb(0, 128, 1);
|
||||
ASSERT_EQ("1,1", FilesPerLevel());
|
||||
gen_l0_kb(0, 128);
|
||||
gen_l0_kb(0, 128, 1);
|
||||
dbfull()->TEST_WaitForCompact();
|
||||
ASSERT_EQ("0,2", FilesPerLevel());
|
||||
metadata.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user