fix test failure

Summary: as subject

Test Plan: db_test

Reviewers: dhruba, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D6309
main
heyongqiang 12 years ago
parent 925f60d39d
commit fb8d437325
  1. 19
      db/db_test.cc

@ -1687,21 +1687,22 @@ TEST(DBTest, DBOpen_Change_NumLevels) {
DestroyDB(dbname, Options());
Options opts;
Status s;
DB* db = NULL;
opts.create_if_missing = true;
s = DB::Open(opts, dbname, &db_);
s = DB::Open(opts, dbname, &db);
ASSERT_OK(s);
ASSERT_TRUE(db_ != NULL);
db_->Put(WriteOptions(), "a", "123");
db_->Put(WriteOptions(), "b", "234");
db_->CompactRange(NULL, NULL);
delete db_;
db_ = NULL;
ASSERT_TRUE(db != NULL);
db->Put(WriteOptions(), "a", "123");
db->Put(WriteOptions(), "b", "234");
db->CompactRange(NULL, NULL);
delete db;
db = NULL;
opts.create_if_missing = false;
opts.num_levels = 2;
s = DB::Open(opts, dbname, &db_);
s = DB::Open(opts, dbname, &db);
ASSERT_TRUE(strstr(s.ToString().c_str(), "Corruption") != NULL);
ASSERT_TRUE(db_ == NULL);
ASSERT_TRUE(db == NULL);
}
// Check that number of files does not grow when we are out of space

Loading…
Cancel
Save