From 327102efa5f2b321b6fb9bf1480f1f7c9fe2438b Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Mon, 14 Apr 2014 12:06:30 -0700 Subject: [PATCH] Fix merge_test failure due to incorrect assert behavior in the release mode. --- db/merge_test.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/db/merge_test.cc b/db/merge_test.cc index 71254f51a..8858977ea 100644 --- a/db/merge_test.cc +++ b/db/merge_test.cc @@ -203,12 +203,16 @@ class Counters { uint64_t assert_get(const string& key) { uint64_t value = default_; - assert(get(key, &value)); + int result = get(key, &value); + assert(result); + if (result == 0) exit(1); // Disable unused variable warning. return value; } void assert_add(const string& key, uint64_t value) { - assert(add(key, value)); + int result = add(key, value); + assert(result); + if (result == 0) exit(1); // Disable unused variable warning. } };