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/Local/FSTLevelDB.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/Local/FSTLevelDB.mm')
-rw-r--r-- | Firestore/Source/Local/FSTLevelDB.mm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Firestore/Source/Local/FSTLevelDB.mm b/Firestore/Source/Local/FSTLevelDB.mm index 6d0f8af..321d47a 100644 --- a/Firestore/Source/Local/FSTLevelDB.mm +++ b/Firestore/Source/Local/FSTLevelDB.mm @@ -24,12 +24,12 @@ #import "Firestore/Source/Local/FSTLevelDBQueryCache.h" #import "Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h" #import "Firestore/Source/Remote/FSTSerializerBeta.h" -#import "Firestore/Source/Util/FSTAssert.h" #include "Firestore/core/src/firebase/firestore/auth/user.h" #include "Firestore/core/src/firebase/firestore/core/database_info.h" #include "Firestore/core/src/firebase/firestore/local/leveldb_transaction.h" #include "Firestore/core/src/firebase/firestore/model/database_id.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" #include "Firestore/core/src/firebase/firestore/util/string_apple.h" #include "absl/memory/memory.h" #include "leveldb/db.h" @@ -132,7 +132,7 @@ using leveldb::WriteOptions; #pragma mark - Startup - (BOOL)start:(NSError **)error { - FSTAssert(!self.isStarted, @"FSTLevelDB double-started!"); + HARD_ASSERT(!self.isStarted, "FSTLevelDB double-started!"); self.started = YES; NSString *directory = self.directory; if (![self ensureDirectory:directory error:error]) { @@ -207,7 +207,7 @@ using leveldb::WriteOptions; } - (LevelDbTransaction *)currentTransaction { - FSTAssert(_transaction != nullptr, @"Attempting to access transaction before one has started"); + HARD_ASSERT(_transaction != nullptr, "Attempting to access transaction before one has started"); return _transaction.get(); } @@ -226,18 +226,18 @@ using leveldb::WriteOptions; } - (void)startTransaction:(absl::string_view)label { - FSTAssert(_transaction == nullptr, @"Starting a transaction while one is already outstanding"); + HARD_ASSERT(_transaction == nullptr, "Starting a transaction while one is already outstanding"); _transaction = absl::make_unique<LevelDbTransaction>(_ptr.get(), label); } - (void)commitTransaction { - FSTAssert(_transaction != nullptr, @"Committing a transaction before one is started"); + HARD_ASSERT(_transaction != nullptr, "Committing a transaction before one is started"); _transaction->Commit(); _transaction.reset(); } - (void)shutdown { - FSTAssert(self.isStarted, @"FSTLevelDB shutdown without start!"); + HARD_ASSERT(self.isStarted, "FSTLevelDB shutdown without start!"); self.started = NO; _ptr.reset(); } |