diff options
author | Gil <mcg@google.com> | 2018-05-24 11:00:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 11:00:23 -0700 |
commit | 8037a4bf79b8ae49162c2b6f099d62ec17a7f283 (patch) | |
tree | 5a15df8664abbcf3e63479fa3e7560fd8c2fbe9e /Firestore/Source/Core/FSTView.mm | |
parent | de4fe203525072babcdec444a06e42e77f0aa714 (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/Source/Core/FSTView.mm')
-rw-r--r-- | Firestore/Source/Core/FSTView.mm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Firestore/Source/Core/FSTView.mm b/Firestore/Source/Core/FSTView.mm index d254a82..63efd4e 100644 --- a/Firestore/Source/Core/FSTView.mm +++ b/Firestore/Source/Core/FSTView.mm @@ -24,9 +24,9 @@ #import "Firestore/Source/Model/FSTDocumentSet.h" #import "Firestore/Source/Model/FSTFieldValue.h" #import "Firestore/Source/Remote/FSTRemoteEvent.h" -#import "Firestore/Source/Util/FSTAssert.h" #include "Firestore/core/src/firebase/firestore/model/document_key.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" using firebase::firestore::model::DocumentKey; using firebase::firestore::model::DocumentKeySet; @@ -235,8 +235,8 @@ static NSComparisonResult FSTCompareDocumentViewChangeTypes(FSTDocumentViewChang newDoc = (FSTDocument *)maybeNewDoc; } if (newDoc) { - FSTAssert([key isEqual:newDoc.key], @"Mismatching key in document changes: %@ != %s", key, - newDoc.key.ToString().c_str()); + HARD_ASSERT([key isEqual:newDoc.key], "Mismatching key in document changes: %s != %s", key, + newDoc.key.ToString()); if (![self.query matchesDocument:newDoc]) { newDoc = nil; } @@ -300,8 +300,8 @@ static NSComparisonResult FSTCompareDocumentViewChangeTypes(FSTDocumentViewChang } } - FSTAssert(!needsRefill || !previousChanges, - @"View was refilled using docs that themselves needed refilling."); + HARD_ASSERT(!needsRefill || !previousChanges, + "View was refilled using docs that themselves needed refilling."); return [[FSTViewDocumentChanges alloc] initWithDocumentSet:newDocumentSet changeSet:changeSet @@ -315,7 +315,7 @@ static NSComparisonResult FSTCompareDocumentViewChangeTypes(FSTDocumentViewChang - (FSTViewChange *)applyChangesToDocuments:(FSTViewDocumentChanges *)docChanges targetChange:(nullable FSTTargetChange *)targetChange { - FSTAssert(!docChanges.needsRefill, @"Cannot apply changes that need a refill"); + HARD_ASSERT(!docChanges.needsRefill, "Cannot apply changes that need a refill"); FSTDocumentSet *oldDocuments = self.documentSet; self.documentSet = docChanges.documentSet; @@ -476,7 +476,7 @@ static inline int DocumentViewChangeTypePosition(FSTDocumentViewChangeType chang // equivalently. return 2; default: - FSTCFail(@"Unknown FSTDocumentViewChangeType %lu", (unsigned long)changeType); + HARD_FAIL("Unknown FSTDocumentViewChangeType %s", changeType); } } |