Make merge_test runnable in ROCKSDB_LITE

Summary: Make merge_test runnable in ROCKSDB_LITE

Test Plan: merge_test

Reviewers: igor, sdong, yhchiang, kradhakrishnan, anthony

Reviewed By: anthony

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D42579
This commit is contained in:
Islam AbdelRahman 2015-07-20 11:17:52 -07:00
parent 144d2910db
commit c06d1d8393
1 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,8 @@ std::shared_ptr<DB> OpenDb(const string& dbname, const bool ttl = false,
options.min_partial_merge_operands = min_partial_merge_operands; options.min_partial_merge_operands = min_partial_merge_operands;
Status s; Status s;
DestroyDB(dbname, Options()); DestroyDB(dbname, Options());
// DBWithTTL is not supported in ROCKSDB_LITE
#ifndef ROCKSDB_LITE
if (ttl) { if (ttl) {
cout << "Opening database with TTL\n"; cout << "Opening database with TTL\n";
DBWithTTL* db_with_ttl; DBWithTTL* db_with_ttl;
@ -95,6 +97,10 @@ std::shared_ptr<DB> OpenDb(const string& dbname, const bool ttl = false,
} else { } else {
s = DB::Open(options, dbname, &db); s = DB::Open(options, dbname, &db);
} }
#else
assert(!ttl);
s = DB::Open(options, dbname, &db);
#endif // !ROCKSDB_LITE
if (!s.ok()) { if (!s.ok()) {
cerr << s.ToString() << endl; cerr << s.ToString() << endl;
assert(false); assert(false);
@ -503,7 +509,10 @@ int main(int argc, char *argv[]) {
//TODO: Make this test like a general rocksdb unit-test //TODO: Make this test like a general rocksdb unit-test
rocksdb::port::InstallStackTraceHandler(); rocksdb::port::InstallStackTraceHandler();
runTest(argc, test::TmpDir() + "/merge_testdb"); runTest(argc, test::TmpDir() + "/merge_testdb");
// DBWithTTL is not supported in ROCKSDB_LITE
#ifndef ROCKSDB_LITE
runTest(argc, test::TmpDir() + "/merge_testdbttl", true); // Run test on TTL database runTest(argc, test::TmpDir() + "/merge_testdbttl", true); // Run test on TTL database
#endif // !ROCKSDB_LITE
printf("Passed all tests!\n"); printf("Passed all tests!\n");
return 0; return 0;
} }