Make stringappend_test runnable in ROCKSDB_LITE
Summary: Make stringappend_test runnable in ROCKSDB_LITE Test Plan: stringappend_test Reviewers: sdong, rven, anthony, kradhakrishnan, IslamAbdelRahman, igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D40593
This commit is contained in:
parent
48da7a9cad
commit
62a8fd154a
@ -36,6 +36,7 @@ std::shared_ptr<DB> OpenNormalDb(char delim_char) {
|
|||||||
return std::shared_ptr<DB>(db);
|
return std::shared_ptr<DB>(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ROCKSDB_LITE // TtlDb is not supported in Lite
|
||||||
// Open a TtlDB with a non-associative StringAppendTESTOperator
|
// Open a TtlDB with a non-associative StringAppendTESTOperator
|
||||||
std::shared_ptr<DB> OpenTtlDb(char delim_char) {
|
std::shared_ptr<DB> OpenTtlDb(char delim_char) {
|
||||||
DBWithTTL* db;
|
DBWithTTL* db;
|
||||||
@ -45,6 +46,7 @@ std::shared_ptr<DB> OpenTtlDb(char delim_char) {
|
|||||||
EXPECT_OK(DBWithTTL::Open(options, kDbName, &db, 123456));
|
EXPECT_OK(DBWithTTL::Open(options, kDbName, &db, 123456));
|
||||||
return std::shared_ptr<DB>(db);
|
return std::shared_ptr<DB>(db);
|
||||||
}
|
}
|
||||||
|
#endif // !ROCKSDB_LITE
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
/// StringLists represents a set of string-lists, each with a key-index.
|
/// StringLists represents a set of string-lists, each with a key-index.
|
||||||
@ -585,12 +587,14 @@ int main(int argc, char** argv) {
|
|||||||
result = RUN_ALL_TESTS();
|
result = RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ROCKSDB_LITE // TtlDb is not supported in Lite
|
||||||
// Run with TTL
|
// Run with TTL
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Running tests with ttl db and generic operator.\n");
|
fprintf(stderr, "Running tests with ttl db and generic operator.\n");
|
||||||
StringAppendOperatorTest::SetOpenDbFunction(&OpenTtlDb);
|
StringAppendOperatorTest::SetOpenDbFunction(&OpenTtlDb);
|
||||||
result |= RUN_ALL_TESTS();
|
result |= RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
#endif // !ROCKSDB_LITE
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user