|
|
@ -131,7 +131,7 @@ class TtlTest : public testing::Test { |
|
|
|
batch.Delete(kv_it_->first); |
|
|
|
batch.Delete(kv_it_->first); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
ASSERT_TRUE(false); |
|
|
|
FAIL(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
db_ttl_->Write(wopts, &batch); |
|
|
|
db_ttl_->Write(wopts, &batch); |
|
|
@ -184,12 +184,12 @@ class TtlTest : public testing::Test { |
|
|
|
if (ret == false || value_found == false) { |
|
|
|
if (ret == false || value_found == false) { |
|
|
|
fprintf(stderr, "KeyMayExist could not find key=%s in the database but" |
|
|
|
fprintf(stderr, "KeyMayExist could not find key=%s in the database but" |
|
|
|
" should have\n", kv.first.c_str()); |
|
|
|
" should have\n", kv.first.c_str()); |
|
|
|
ASSERT_TRUE(false); |
|
|
|
FAIL(); |
|
|
|
} else if (val.compare(kv.second) != 0) { |
|
|
|
} else if (val.compare(kv.second) != 0) { |
|
|
|
fprintf(stderr, " value for key=%s present in database is %s but" |
|
|
|
fprintf(stderr, " value for key=%s present in database is %s but" |
|
|
|
" should be %s\n", kv.first.c_str(), val.c_str(), |
|
|
|
" should be %s\n", kv.first.c_str(), val.c_str(), |
|
|
|
kv.second.c_str()); |
|
|
|
kv.second.c_str()); |
|
|
|
ASSERT_TRUE(false); |
|
|
|
FAIL(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -239,18 +239,18 @@ class TtlTest : public testing::Test { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fprintf(stderr, "is present in db but was expected to be absent\n"); |
|
|
|
fprintf(stderr, "is present in db but was expected to be absent\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
ASSERT_TRUE(false); |
|
|
|
FAIL(); |
|
|
|
} else if (s.ok()) { |
|
|
|
} else if (s.ok()) { |
|
|
|
if (test_compaction_change && v.compare(kNewValue_) != 0) { |
|
|
|
if (test_compaction_change && v.compare(kNewValue_) != 0) { |
|
|
|
fprintf(stderr, " value for key=%s present in database is %s but " |
|
|
|
fprintf(stderr, " value for key=%s present in database is %s but " |
|
|
|
" should be %s\n", kv_it_->first.c_str(), v.c_str(), |
|
|
|
" should be %s\n", kv_it_->first.c_str(), v.c_str(), |
|
|
|
kNewValue_.c_str()); |
|
|
|
kNewValue_.c_str()); |
|
|
|
ASSERT_TRUE(false); |
|
|
|
FAIL(); |
|
|
|
} else if (!test_compaction_change && v.compare(kv_it_->second) !=0) { |
|
|
|
} else if (!test_compaction_change && v.compare(kv_it_->second) !=0) { |
|
|
|
fprintf(stderr, " value for key=%s present in database is %s but " |
|
|
|
fprintf(stderr, " value for key=%s present in database is %s but " |
|
|
|
" should be %s\n", kv_it_->first.c_str(), v.c_str(), |
|
|
|
" should be %s\n", kv_it_->first.c_str(), v.c_str(), |
|
|
|
kv_it_->second.c_str()); |
|
|
|
kv_it_->second.c_str()); |
|
|
|
ASSERT_TRUE(false); |
|
|
|
FAIL(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|