From 31b35c902eada80f056cd519f7dcb0c8397d5bd1 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 21 Jul 2015 18:04:28 -0700 Subject: [PATCH] Add missing tests, fix db_sanity Add heap_test, merge_helper_test Fix uninitialized pointers in db_sanity_test that cause SIGSEV when DB::Open fails in case compression is not linked. --- CMakeLists.txt | 2 ++ tools/db_sanity_test.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14f6aa525..1c5a31818 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,6 +273,7 @@ set(TESTS db/log_test.cc db/memtable_list_test.cc db/merge_test.cc + db/merge_helper_test.cc db/perf_context_test.cc db/plain_table_db_test.cc db/prefix_test.cc @@ -307,6 +308,7 @@ set(TESTS util/event_logger_test.cc util/filelock_test.cc util/file_reader_writer_test.cc + util/heap_test.cc util/histogram_test.cc util/manual_compaction_test.cc util/memenv_test.cc diff --git a/tools/db_sanity_test.cc b/tools/db_sanity_test.cc index 4c5a709c9..c2f9d04f3 100644 --- a/tools/db_sanity_test.cc +++ b/tools/db_sanity_test.cc @@ -38,7 +38,7 @@ class SanityTest { options.create_if_missing = true; std::string dbname = path_ + Name(); DestroyDB(dbname, options); - DB* db; + DB* db = nullptr; Status s = DB::Open(options, dbname, &db); std::unique_ptr db_guard(db); if (!s.ok()) { @@ -55,7 +55,7 @@ class SanityTest { return db->Flush(FlushOptions()); } Status Verify() { - DB* db; + DB* db = nullptr; std::string dbname = path_ + Name(); Status s = DB::Open(GetOptions(), dbname, &db); std::unique_ptr db_guard(db);