Skip to content

Commit

Permalink
Codemod NULL to nullptr
Browse files Browse the repository at this point in the history
Summary:
scripted NULL to nullptr in
* include/leveldb/
* db/
* table/
* util/

Test Plan: make all check

Reviewers: dhruba, emayanke

Reviewed By: emayanke

CC: leveldb

Differential Revision: https://reviews.facebook.net/D9003
  • Loading branch information
Abhishek Kona committed Mar 1, 2013
1 parent e45c7a8 commit c41f1e9
Show file tree
Hide file tree
Showing 45 changed files with 452 additions and 445 deletions.
16 changes: 8 additions & 8 deletions db/corruption_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CorruptionTest {
dbname_ = test::TmpDir() + "/db_test";
DestroyDB(dbname_, options_);

db_ = NULL;
db_ = nullptr;
options_.create_if_missing = true;
Reopen();
options_.create_if_missing = false;
Expand All @@ -49,22 +49,22 @@ class CorruptionTest {
DestroyDB(dbname_, Options());
}

Status TryReopen(Options* options = NULL) {
Status TryReopen(Options* options = nullptr) {
delete db_;
db_ = NULL;
db_ = nullptr;
Options opt = (options ? *options : options_);
opt.env = &env_;
opt.block_cache = tiny_cache_;
return DB::Open(opt, dbname_, &db_);
}

void Reopen(Options* options = NULL) {
void Reopen(Options* options = nullptr) {
ASSERT_OK(TryReopen(options));
}

void RepairDB() {
delete db_;
db_ = NULL;
db_ = nullptr;
ASSERT_OK(::leveldb::RepairDB(dbname_, options_));
}

Expand Down Expand Up @@ -228,8 +228,8 @@ TEST(CorruptionTest, TableFile) {
Build(100);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, NULL, NULL);
dbi->TEST_CompactRange(1, NULL, NULL);
dbi->TEST_CompactRange(0, nullptr, nullptr);
dbi->TEST_CompactRange(1, nullptr, nullptr);

Corrupt(kTableFile, 100, 1);
Check(99, 99);
Expand Down Expand Up @@ -277,7 +277,7 @@ TEST(CorruptionTest, CorruptedDescriptor) {
ASSERT_OK(db_->Put(WriteOptions(), "foo", "hello"));
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, NULL, NULL);
dbi->TEST_CompactRange(0, nullptr, nullptr);

Corrupt(kDescriptorFile, 0, 1000);
Status s = TryReopen();
Expand Down
Loading

0 comments on commit c41f1e9

Please sign in to comment.