From 832271f6b156c270bd1dbf41cc4e82d6721d25a1 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Fri, 29 May 2015 14:51:21 -0700 Subject: [PATCH] Fixed a compile warning in db_stress in NDEBUG mode. Summary: Fixed a compile warning in db_stress in NDEBUG mode. Test Plan: make OPT=-DNDEBUG db_stress Reviewers: sdong, anthony Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D39213 --- tools/db_stress.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index 126149ca0..4c342c4b7 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -845,6 +845,7 @@ class DbStressListener : public EventListener { } void VerifyFileDir(const std::string& file_dir) { +#ifndef NDEBUG if (db_name_ == file_dir) { return; } @@ -854,17 +855,21 @@ class DbStressListener : public EventListener { } } assert(false); +#endif // !NDEBUG } void VerifyFileName(const std::string& file_name) { +#ifndef NDEBUG uint64_t file_number; FileType file_type; bool result = ParseFileName(file_name, &file_number, &file_type); assert(result); assert(file_type == kTableFile); +#endif // !NDEBUG } void VerifyFilePath(const std::string& file_path) { +#ifndef NDEBUG size_t pos = file_path.find_last_of("/"); if (pos == std::string::npos) { VerifyFileName(file_path); @@ -874,6 +879,7 @@ class DbStressListener : public EventListener { } VerifyFileName(file_path.substr(pos)); } +#endif // !NDEBUG } #endif // !ROCKSDB_LITE