Initialize variable to avoid warning
Summary: RocksDB debug version failed to build under gcc-4.8.1 on sandcastle with the following error: ``` db/db_compaction_filter_test.cc:570:33: error: ‘snapshot’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ``` Test Plan: make db_compaction_filter_test && ./db_compaction_filter_test Reviewers: rven, anthony, yhchiang, aekmekji, igor, sdong Reviewed By: igor, sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D46725
This commit is contained in:
parent
aeb4612685
commit
34cedaff66
@ -548,7 +548,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
|
|||||||
DestroyAndReopen(options);
|
DestroyAndReopen(options);
|
||||||
|
|
||||||
// Put some data.
|
// Put some data.
|
||||||
const Snapshot* snapshot;
|
const Snapshot* snapshot = nullptr;
|
||||||
for (int table = 0; table < 4; ++table) {
|
for (int table = 0; table < 4; ++table) {
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
Put(ToString(table * 100 + i), "val");
|
Put(ToString(table * 100 + i), "val");
|
||||||
@ -559,6 +559,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
|
|||||||
snapshot = db_->GetSnapshot();
|
snapshot = db_->GetSnapshot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert(snapshot != nullptr);
|
||||||
|
|
||||||
cfilter_count = 0;
|
cfilter_count = 0;
|
||||||
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
|
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user