From 3e41f2585cefaef1d37f76224cdd8e8908c529da Mon Sep 17 00:00:00 2001 From: rsgowman Date: Mon, 12 Mar 2018 16:35:40 -0400 Subject: Fix test failures that occur during prod build (#910) * Fix ArraySortedMap.ChecksSize test (when NDEBUG is enabled) assert() is a noop when NDEBUG is defined (i.e. during production builds) so the size assertion check doesn't occur. Assuming we want this check even during prod use, I've switched assert to FIREBASE_ASSERT. * s/FIREBASE_ASSERT/FIREBASE_DEV_ASSERT/g in ordered_code.cc This keeps the behaviour in line with the original (which purposely differs if NDEBUG is defined or not.) Discovered due to the test suite (correctly) breaking during a prod build. --- Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Firestore/core/src/firebase/firestore/immutable') diff --git a/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h b/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h index d0210a8..4b8acde 100644 --- a/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h +++ b/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h @@ -25,6 +25,7 @@ #include #include "Firestore/core/src/firebase/firestore/immutable/map_entry.h" +#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h" namespace firebase { namespace firestore { @@ -101,7 +102,7 @@ class FixedArray { void append(SourceIterator src_begin, SourceIterator src_end) { size_type appending = static_cast(src_end - src_begin); size_type new_size = size_ + appending; - assert(new_size <= fixed_size); + FIREBASE_ASSERT(new_size <= fixed_size); std::copy(src_begin, src_end, end()); size_ = new_size; @@ -112,7 +113,7 @@ class FixedArray { */ void append(T&& value) { size_type new_size = size_ + 1; - assert(new_size <= fixed_size); + FIREBASE_ASSERT(new_size <= fixed_size); *end() = std::move(value); size_ = new_size; -- cgit v1.2.3