Fix RocksDB lite build

Summary:
NewMemEnv() is defined in rocksdb lite but just returns nullptr --
would it be better to just not define it so we can catch issues like this at
compile-time?

Test Plan:
  $ make clean && OPT="-DTRAVIS -DROCKSDB_LITE" V=1 make -j32 db_test
  $ ./db_test --gtest_filter='DBTest.MemEnvTest'
  ...
  [  PASSED  ] 0 tests.

Reviewers: yhchiang, sdong

Reviewed By: sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D53427
This commit is contained in:
Andrew Kryczka 2016-01-26 13:15:36 -08:00
parent 77ef87ccb0
commit 035857a312
1 changed files with 4 additions and 0 deletions

View File

@ -169,6 +169,9 @@ TEST_F(DBTest, MockEnvTest) {
delete db; delete db;
} }
// NewMemEnv returns nullptr in ROCKSDB_LITE since class InMemoryEnv isn't
// defined.
#ifndef ROCKSDB_LITE
TEST_F(DBTest, MemEnvTest) { TEST_F(DBTest, MemEnvTest) {
unique_ptr<Env> env{NewMemEnv(Env::Default())}; unique_ptr<Env> env{NewMemEnv(Env::Default())};
Options options; Options options;
@ -221,6 +224,7 @@ TEST_F(DBTest, MemEnvTest) {
} }
delete db; delete db;
} }
#endif // ROCKSDB_LITE
TEST_F(DBTest, WriteEmptyBatch) { TEST_F(DBTest, WriteEmptyBatch) {
Options options; Options options;