aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/immutable
diff options
context:
space:
mode:
authorGravatar rsgowman <rgowman@google.com>2018-03-12 16:35:40 -0400
committerGravatar GitHub <noreply@github.com>2018-03-12 16:35:40 -0400
commit3e41f2585cefaef1d37f76224cdd8e8908c529da (patch)
tree7c5e2e498d3a5c4062c7ae5d02fcf695fc2d263a /Firestore/core/src/firebase/firestore/immutable
parentf122cf7ce802972bd2fea45acac3deae2affcafa (diff)
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.
Diffstat (limited to 'Firestore/core/src/firebase/firestore/immutable')
-rw-r--r--Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h5
1 files changed, 3 insertions, 2 deletions
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 <utility>
#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<size_type>(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;