aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/third_party
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-05-24 11:00:23 -0700
committerGravatar GitHub <noreply@github.com>2018-05-24 11:00:23 -0700
commit8037a4bf79b8ae49162c2b6f099d62ec17a7f283 (patch)
tree5a15df8664abbcf3e63479fa3e7560fd8c2fbe9e /Firestore/third_party
parentde4fe203525072babcdec444a06e42e77f0aa714 (diff)
Replace Objective-C assertions with C++ assertions (#1327)
* Migrate FSTFail to HARD_FAIL * FSTCFail -> HARD_FAIL * FSTCAssert -> HARD_ASSERT * FSTAssert -> HARD_ASSERT * Replace FSTAssert with NSAssert in dead Objective-C code * Remove FSTAssert.h
Diffstat (limited to 'Firestore/third_party')
-rw-r--r--Firestore/third_party/Immutable/FSTArraySortedDictionary.m5
-rw-r--r--Firestore/third_party/Immutable/FSTLLRBValueNode.m3
-rw-r--r--Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m4
-rw-r--r--Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m3
4 files changed, 5 insertions, 10 deletions
diff --git a/Firestore/third_party/Immutable/FSTArraySortedDictionary.m b/Firestore/third_party/Immutable/FSTArraySortedDictionary.m
index e9325a7..985b514 100644
--- a/Firestore/third_party/Immutable/FSTArraySortedDictionary.m
+++ b/Firestore/third_party/Immutable/FSTArraySortedDictionary.m
@@ -1,7 +1,6 @@
#import "Firestore/third_party/Immutable/FSTArraySortedDictionary.h"
#import "Firestore/third_party/Immutable/FSTArraySortedDictionaryEnumerator.h"
-#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h"
NS_ASSUME_NONNULL_BEGIN
@@ -38,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
for (id key in keys) {
values[pos++] = dictionary[key];
}
- FSTAssert(values.count == keys.count, @"We added as many keys as values");
+ NSAssert(values.count == keys.count, @"We added as many keys as values");
return [[FSTArraySortedDictionary alloc] initWithComparator:comparator keys:keys values:values];
}
@@ -50,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
- (id)initWithComparator:(NSComparator)comparator keys:(NSArray *)keys values:(NSArray *)values {
self = [super init];
if (self != nil) {
- FSTAssert(keys.count == values.count, @"keys and values must have the same count");
+ NSAssert(keys.count == values.count, @"keys and values must have the same count");
_comparator = comparator;
_keys = keys;
_values = values;
diff --git a/Firestore/third_party/Immutable/FSTLLRBValueNode.m b/Firestore/third_party/Immutable/FSTLLRBValueNode.m
index 194a393..e2590a1 100644
--- a/Firestore/third_party/Immutable/FSTLLRBValueNode.m
+++ b/Firestore/third_party/Immutable/FSTLLRBValueNode.m
@@ -1,6 +1,5 @@
#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h"
-#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/third_party/Immutable/FSTLLRBEmptyNode.h"
NS_ASSUME_NONNULL_BEGIN
@@ -64,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setLeft:(nullable id<FSTLLRBNode>)left {
// Setting the left node should be only done by the builder, so doing it after someone has
// memoized count is an error.
- FSTAssert(_count == NSNotFound, @"Can't update left node after using count");
+ NSAssert(_count == NSNotFound, @"Can't update left node after using count");
_left = left;
}
diff --git a/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m b/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m
index bf17496..a220a3c 100644
--- a/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m
+++ b/Firestore/third_party/Immutable/Tests/FSTArraySortedDictionaryTests.m
@@ -2,8 +2,6 @@
#import <XCTest/XCTest.h>
-#import "Firestore/Source/Util/FSTAssert.h"
-
@interface FSTArraySortedDictionary (Test)
// Override methods to return subtype.
- (FSTArraySortedDictionary *)dictionaryBySettingObject:(id)aValue forKey:(id)aKey;
@@ -17,7 +15,7 @@
- (NSComparator)defaultComparator {
return ^(id obj1, id obj2) {
- FSTAssert([obj1 respondsToSelector:@selector(compare:)] &&
+ NSAssert([obj1 respondsToSelector:@selector(compare:)] &&
[obj2 respondsToSelector:@selector(compare:)],
@"Objects must support compare: %@ %@", obj1, obj2);
return [obj1 compare:obj2];
diff --git a/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m b/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m
index 3e06b30..c6e522c 100644
--- a/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m
+++ b/Firestore/third_party/Immutable/Tests/FSTTreeSortedDictionaryTests.m
@@ -4,7 +4,6 @@
#import "Firestore/third_party/Immutable/FSTLLRBNode.h"
#import "Firestore/third_party/Immutable/FSTLLRBValueNode.h"
#import "Firestore/third_party/Immutable/FSTTreeSortedDictionary.h"
-#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/third_party/Immutable/Tests/FSTLLRBValueNode+Test.h"
@@ -21,7 +20,7 @@
- (NSComparator)defaultComparator {
return ^(id obj1, id obj2) {
- FSTAssert([obj1 respondsToSelector:@selector(compare:)] &&
+ NSAssert([obj1 respondsToSelector:@selector(compare:)] &&
[obj2 respondsToSelector:@selector(compare:)],
@"Objects must support compare: %@ %@", obj1, obj2);
return [obj1 compare:obj2];