diff options
Diffstat (limited to 'Firestore/Example')
-rw-r--r-- | Firestore/Example/Firestore.xcodeproj/project.pbxproj | 288 | ||||
-rw-r--r-- | Firestore/Example/LibFuzzer.podspec | 45 | ||||
-rw-r--r-- | Firestore/Example/Tests/Integration/FSTDatastoreTests.mm | 6 | ||||
-rw-r--r-- | Firestore/Example/Tests/Integration/FSTStreamTests.mm | 4 | ||||
-rw-r--r-- | Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm | 26 | ||||
-rw-r--r-- | Firestore/Example/Tests/SpecTests/FSTSpecTests.mm | 24 | ||||
-rw-r--r-- | Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.mm | 28 | ||||
-rw-r--r-- | Firestore/Example/Tests/Util/FSTAssertTests.mm | 105 | ||||
-rw-r--r-- | Firestore/Example/Tests/Util/FSTEventAccumulator.mm | 8 | ||||
-rw-r--r-- | Firestore/Example/Tests/Util/FSTHelpers.mm | 15 |
10 files changed, 242 insertions, 307 deletions
diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index fd6d9ba..ca8b598 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -43,7 +43,6 @@ 5492E03420213FFC00B64F25 /* FSTMemorySpecTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E02F20213FFC00B64F25 /* FSTMemorySpecTests.mm */; }; 5492E03520213FFC00B64F25 /* FSTSpecTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E03020213FFC00B64F25 /* FSTSpecTests.mm */; }; 5492E03C2021401F00B64F25 /* XCTestCase+Await.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E0372021401E00B64F25 /* XCTestCase+Await.mm */; }; - 5492E03D2021401F00B64F25 /* FSTAssertTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E0382021401E00B64F25 /* FSTAssertTests.mm */; }; 5492E03E2021401F00B64F25 /* FSTEventAccumulator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E0392021401F00B64F25 /* FSTEventAccumulator.mm */; }; 5492E03F2021401F00B64F25 /* FSTHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E03A2021401F00B64F25 /* FSTHelpers.mm */; }; 5492E041202143E700B64F25 /* FSTEventAccumulator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E0392021401F00B64F25 /* FSTEventAccumulator.mm */; }; @@ -148,6 +147,7 @@ 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 7346E61D20325C6900FD6CEF /* FSTDispatchQueueTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7346E61C20325C6900FD6CEF /* FSTDispatchQueueTests.mm */; }; 73866AA12082B0A5009BB4FF /* FIRArrayTransformTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 73866A9F2082B069009BB4FF /* FIRArrayTransformTests.mm */; }; + 73FE5066020EF9B2892C86BF /* hard_assert_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */; }; 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 8C82D4D3F9AB63E79CC52DC8 /* Pods_Firestore_IntegrationTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECEBABC7E7B693BE808A1052 /* Pods_Firestore_IntegrationTests_iOS.framework */; }; AB356EF7200EA5EB0089B766 /* field_value_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB356EF6200EA5EB0089B766 /* field_value_test.cc */; }; @@ -256,6 +256,7 @@ 3B843E4A1F3930A400548890 /* remote_store_spec_test.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = remote_store_spec_test.json; sourceTree = "<group>"; }; 3C81DE3772628FE297055662 /* Pods-Firestore_Example_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_iOS/Pods-Firestore_Example_iOS.debug.xcconfig"; sourceTree = "<group>"; }; 3F0992A4B83C60841C52E960 /* Pods-Firestore_Example_iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_iOS/Pods-Firestore_Example_iOS.release.xcconfig"; sourceTree = "<group>"; }; + 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = hard_assert_test.cc; sourceTree = "<group>"; }; 54131E9620ADE678001DF3FF /* string_format_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string_format_test.cc; sourceTree = "<group>"; }; 54511E8D209805F8005BD28F /* hashing_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hashing_test.cc; sourceTree = "<group>"; }; 5467FAFF203E56F8009C9584 /* FIRFirestoreTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRFirestoreTests.mm; sourceTree = "<group>"; }; @@ -273,7 +274,6 @@ 5492E02F20213FFC00B64F25 /* FSTMemorySpecTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTMemorySpecTests.mm; sourceTree = "<group>"; }; 5492E03020213FFC00B64F25 /* FSTSpecTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTSpecTests.mm; sourceTree = "<group>"; }; 5492E0372021401E00B64F25 /* XCTestCase+Await.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "XCTestCase+Await.mm"; sourceTree = "<group>"; }; - 5492E0382021401E00B64F25 /* FSTAssertTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTAssertTests.mm; sourceTree = "<group>"; }; 5492E0392021401F00B64F25 /* FSTEventAccumulator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTEventAccumulator.mm; sourceTree = "<group>"; }; 5492E03A2021401F00B64F25 /* FSTHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTHelpers.mm; sourceTree = "<group>"; }; 5492E045202154AA00B64F25 /* FIRCollectionReferenceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRCollectionReferenceTests.mm; sourceTree = "<group>"; }; @@ -468,9 +468,9 @@ buildActionMask = 2147483647; files = ( 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, - 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, C8D3CE2343E53223E6487F2C /* Pods_Firestore_Example_iOS.framework in Frameworks */, + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -478,10 +478,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, - 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 5D405BE298CE4692CB00790A /* Pods_Firestore_Tests_iOS.framework in Frameworks */, + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -489,10 +489,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DE03B2D41F2149D600A30B9C /* XCTest.framework in Frameworks */, - DE03B2D51F2149D600A30B9C /* UIKit.framework in Frameworks */, DE03B2D61F2149D600A30B9C /* Foundation.framework in Frameworks */, 8C82D4D3F9AB63E79CC52DC8 /* Pods_Firestore_IntegrationTests_iOS.framework in Frameworks */, + DE03B2D51F2149D600A30B9C /* UIKit.framework in Frameworks */, + DE03B2D41F2149D600A30B9C /* XCTest.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -549,14 +549,14 @@ B6FB4687208F9B9100554BA2 /* executor_std_test.cc */, B6FB4688208F9B9100554BA2 /* executor_test.cc */, B6FB468A208F9B9100554BA2 /* executor_test.h */, - 54131E9820AE076C001DF3FF /* hard_assert_test.cc */, + 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */, 54511E8D209805F8005BD28F /* hashing_test.cc */, 54A0353420A3D8CB003E0143 /* iterator_adaptors_test.cc */, 54C2294E1FECABAE007D065B /* log_test.cc */, AB380D03201BC6E400D97691 /* ordered_code_test.cc */, 54740A531FC913E500713A1A /* secure_random_test.cc */, - 54A0352B20A3B3D7003E0143 /* status_test_util.h */, 54A0352C20A3B3D7003E0143 /* status_test.cc */, + 54A0352B20A3B3D7003E0143 /* status_test_util.h */, 54A0352D20A3B3D7003E0143 /* statusor_test.cc */, 54131E9620ADE678001DF3FF /* string_format_test.cc */, AB380CFC201A2EE200D97691 /* string_util_test.cc */, @@ -640,10 +640,10 @@ isa = PBXGroup; children = ( 6003F58A195388D20070C39A /* Firestore_Example_iOS.app */, - 6003F5AE195388D20070C39A /* Firestore_Tests_iOS.xctest */, DE03B2E91F2149D600A30B9C /* Firestore_IntegrationTests_iOS.xctest */, - DE0761E41F2FE611003233AF /* SwiftBuildTest.app */, 54C9EDF12040E16300A969CD /* Firestore_SwiftTests_iOS.xctest */, + 6003F5AE195388D20070C39A /* Firestore_Tests_iOS.xctest */, + DE0761E41F2FE611003233AF /* SwiftBuildTest.app */, ); name = Products; sourceTree = "<group>"; @@ -651,15 +651,15 @@ 6003F58C195388D20070C39A /* Frameworks */ = { isa = PBXGroup; children = ( - 6003F58D195388D20070C39A /* Foundation.framework */, 6003F58F195388D20070C39A /* CoreGraphics.framework */, - 6003F591195388D20070C39A /* UIKit.framework */, - 6003F5AF195388D20070C39A /* XCTest.framework */, + 6003F58D195388D20070C39A /* Foundation.framework */, 5918805E993304321A05E82B /* Pods_Firestore_Example_iOS.framework */, BB92EB03E3F92485023F64ED /* Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework */, 379B34A1536045869826D82A /* Pods_Firestore_Example_iOS_SwiftBuildTest.framework */, ECEBABC7E7B693BE808A1052 /* Pods_Firestore_IntegrationTests_iOS.framework */, 2B50B3A0DF77100EEE887891 /* Pods_Firestore_Tests_iOS.framework */, + 6003F591195388D20070C39A /* UIKit.framework */, + 6003F5AF195388D20070C39A /* XCTest.framework */, ); name = Frameworks; sourceTree = "<group>"; @@ -667,14 +667,14 @@ 6003F593195388D20070C39A /* iOS */ = { isa = PBXGroup; children = ( + 6003F594195388D20070C39A /* Supporting Files */, 6003F59C195388D20070C39A /* FIRAppDelegate.h */, 6003F59D195388D20070C39A /* FIRAppDelegate.m */, - 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 6003F5A5195388D20070C39A /* FIRViewController.h */, 6003F5A6195388D20070C39A /* FIRViewController.m */, - 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 6003F5A8195388D20070C39A /* Images.xcassets */, - 6003F594195388D20070C39A /* Supporting Files */, + 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, + 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, ); path = iOS; sourceTree = "<group>"; @@ -700,8 +700,8 @@ DE51B17B1F0D48AC0013853F /* Model */, DE51B1B21F0D48AC0013853F /* Remote */, DE51B1931F0D48AC0013853F /* SpecTests */, - DE51B1851F0D48AC0013853F /* Util */, 6003F5B6195388D20070C39A /* Supporting Files */, + DE51B1851F0D48AC0013853F /* Util */, ); path = Tests; sourceTree = "<group>"; @@ -709,8 +709,8 @@ 6003F5B6195388D20070C39A /* Supporting Files */ = { isa = PBXGroup; children = ( - 6003F5B7195388D20070C39A /* Tests-Info.plist */, 6003F5B8195388D20070C39A /* InfoPlist.strings */, + 6003F5B7195388D20070C39A /* Tests-Info.plist */, ); name = "Supporting Files"; sourceTree = "<group>"; @@ -719,8 +719,8 @@ isa = PBXGroup; children = ( 8E002F4AD5D9B6197C940847 /* Firestore.podspec */, - D3CC3DC5338DCAF43A211155 /* README.md */, 12F4357299652983A615F886 /* LICENSE */, + D3CC3DC5338DCAF43A211155 /* README.md */, ); name = "Podspec Metadata"; sourceTree = "<group>"; @@ -728,12 +728,12 @@ AAEA2A72CFD1FA5AD34462F7 /* Pods */ = { isa = PBXGroup; children = ( - 3C81DE3772628FE297055662 /* Pods-Firestore_Example_iOS.debug.xcconfig */, - 3F0992A4B83C60841C52E960 /* Pods-Firestore_Example_iOS.release.xcconfig */, 69E6C311558EC77729A16CF1 /* Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig */, 11984BA0A99D7A7ABA5B0D90 /* Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.release.xcconfig */, 05C3D82261C3BE976889FF09 /* Pods-Firestore_Example_iOS-SwiftBuildTest.debug.xcconfig */, 74ACEC3603BE58B57A7E8D4C /* Pods-Firestore_Example_iOS-SwiftBuildTest.release.xcconfig */, + 3C81DE3772628FE297055662 /* Pods-Firestore_Example_iOS.debug.xcconfig */, + 3F0992A4B83C60841C52E960 /* Pods-Firestore_Example_iOS.release.xcconfig */, 1277F98C20D2DF0867496976 /* Pods-Firestore_IntegrationTests_iOS.debug.xcconfig */, F354C0FE92645B56A6C6FD44 /* Pods-Firestore_IntegrationTests_iOS.release.xcconfig */, E592181BFD7C53C305123739 /* Pods-Firestore_Tests_iOS.debug.xcconfig */, @@ -813,6 +813,7 @@ 5492E0872021552A00B64F25 /* FSTLevelDBMutationQueueTests.mm */, 5492E0982021552C00B64F25 /* FSTLevelDBQueryCacheTests.mm */, 5492E0922021552B00B64F25 /* FSTLevelDBRemoteDocumentCacheTests.mm */, + 132E36BB104830BD806351AC /* FSTLevelDBTransactionTests.mm */, 5492E08A2021552A00B64F25 /* FSTLocalSerializerTests.mm */, 5492E0912021552B00B64F25 /* FSTLocalStoreTests.h */, 5492E0832021552A00B64F25 /* FSTLocalStoreTests.mm */, @@ -830,7 +831,6 @@ 5492E0852021552A00B64F25 /* FSTRemoteDocumentCacheTests.h */, 5492E09C2021552D00B64F25 /* FSTRemoteDocumentCacheTests.mm */, 5492E0932021552B00B64F25 /* StringViewTests.mm */, - 132E36BB104830BD806351AC /* FSTLevelDBTransactionTests.mm */, ); path = Local; sourceTree = "<group>"; @@ -838,12 +838,12 @@ DE51B17B1F0D48AC0013853F /* Model */ = { isa = PBXGroup; children = ( - 54A0352320A3AEC3003E0143 /* field_transform_test.mm */, 5492E0B22021555000B64F25 /* FSTDocumentKeyTests.mm */, 5492E0B32021555100B64F25 /* FSTDocumentSetTests.mm */, 5492E0B62021555100B64F25 /* FSTDocumentTests.mm */, 5492E0B82021555100B64F25 /* FSTFieldValueTests.mm */, 5492E0B72021555100B64F25 /* FSTMutationTests.mm */, + 54A0352320A3AEC3003E0143 /* field_transform_test.mm */, 54A0352220A3AEC3003E0143 /* transform_operations_test.mm */, ); path = Model; @@ -872,7 +872,7 @@ DE51B1851F0D48AC0013853F /* Util */ = { isa = PBXGroup; children = ( - 5492E0382021401E00B64F25 /* FSTAssertTests.mm */, + 7346E61C20325C6900FD6CEF /* FSTDispatchQueueTests.mm */, 54E9281C1F33950B00C1953E /* FSTEventAccumulator.h */, 5492E0392021401F00B64F25 /* FSTEventAccumulator.mm */, DE51B1881F0D48AC0013853F /* FSTHelpers.h */, @@ -881,7 +881,6 @@ 5491BC711FB44593008B3588 /* FSTIntegrationTestCase.mm */, 54E9282A1F339CAD00C1953E /* XCTestCase+Await.h */, 5492E0372021401E00B64F25 /* XCTestCase+Await.mm */, - 7346E61C20325C6900FD6CEF /* FSTDispatchQueueTests.mm */, ); path = Util; sourceTree = "<group>"; @@ -889,6 +888,7 @@ DE51B1931F0D48AC0013853F /* SpecTests */ = { isa = PBXGroup; children = ( + DE51B19C1F0D48AC0013853F /* json */, 5492E02C20213FFB00B64F25 /* FSTLevelDBSpecTests.mm */, 5492E02F20213FFC00B64F25 /* FSTMemorySpecTests.mm */, DE51B1961F0D48AC0013853F /* FSTMockDatastore.h */, @@ -897,7 +897,6 @@ 5492E03020213FFC00B64F25 /* FSTSpecTests.mm */, DE51B19A1F0D48AC0013853F /* FSTSyncEngineTestDriver.h */, 5492E02E20213FFC00B64F25 /* FSTSyncEngineTestDriver.mm */, - DE51B19C1F0D48AC0013853F /* json */, ); path = SpecTests; sourceTree = "<group>"; @@ -905,7 +904,7 @@ DE51B19C1F0D48AC0013853F /* json */ = { isa = PBXGroup; children = ( - 3B843E4A1F3930A400548890 /* remote_store_spec_test.json */, + DE51B1A71F0D48AC0013853F /* README.md */, 54DA129C1F315EE100DD57A1 /* collection_spec_test.json */, 54DA129D1F315EE100DD57A1 /* existence_filter_spec_test.json */, 54DA129E1F315EE100DD57A1 /* limbo_spec_test.json */, @@ -914,9 +913,9 @@ 54DA12A11F315EE100DD57A1 /* offline_spec_test.json */, 54DA12A21F315EE100DD57A1 /* orderby_spec_test.json */, 54DA12A31F315EE100DD57A1 /* persistence_spec_test.json */, + 3B843E4A1F3930A400548890 /* remote_store_spec_test.json */, 54DA12A41F315EE100DD57A1 /* resume_token_spec_test.json */, 54DA12A51F315EE100DD57A1 /* write_spec_test.json */, - DE51B1A71F0D48AC0013853F /* README.md */, ); path = json; sourceTree = "<group>"; @@ -964,10 +963,10 @@ isa = PBXGroup; children = ( 73866A9F2082B069009BB4FF /* FIRArrayTransformTests.mm */, - 6161B5012047140400A99DBB /* FIRFirestoreSourceTests.mm */, 5492E070202154D600B64F25 /* FIRCursorTests.mm */, 5492E06C202154D500B64F25 /* FIRDatabaseTests.mm */, 5492E06A202154D500B64F25 /* FIRFieldsTests.mm */, + 6161B5012047140400A99DBB /* FIRFirestoreSourceTests.mm */, 5492E06B202154D500B64F25 /* FIRListenerRegistrationTests.mm */, 5492E069202154D500B64F25 /* FIRQueryTests.mm */, 5492E06E202154D600B64F25 /* FIRServerTimestampTests.mm */, @@ -1148,9 +1147,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, - 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1159,18 +1158,18 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3B843E4C1F3A182900548890 /* remote_store_spec_test.json in Resources */, + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, + 54DA12A61F315EE100DD57A1 /* collection_spec_test.json in Resources */, + 54DA12A71F315EE100DD57A1 /* existence_filter_spec_test.json in Resources */, 54DA12A81F315EE100DD57A1 /* limbo_spec_test.json in Resources */, + 54DA12A91F315EE100DD57A1 /* limit_spec_test.json in Resources */, 54DA12AA1F315EE100DD57A1 /* listen_spec_test.json in Resources */, - 54DA12A61F315EE100DD57A1 /* collection_spec_test.json in Resources */, - 54DA12AE1F315EE100DD57A1 /* resume_token_spec_test.json in Resources */, - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, - 54DA12AF1F315EE100DD57A1 /* write_spec_test.json in Resources */, - 54DA12AD1F315EE100DD57A1 /* persistence_spec_test.json in Resources */, 54DA12AB1F315EE100DD57A1 /* offline_spec_test.json in Resources */, - 54DA12A71F315EE100DD57A1 /* existence_filter_spec_test.json in Resources */, 54DA12AC1F315EE100DD57A1 /* orderby_spec_test.json in Resources */, - 54DA12A91F315EE100DD57A1 /* limit_spec_test.json in Resources */, + 54DA12AD1F315EE100DD57A1 /* persistence_spec_test.json in Resources */, + 3B843E4C1F3A182900548890 /* remote_store_spec_test.json in Resources */, + 54DA12AE1F315EE100DD57A1 /* resume_token_spec_test.json in Resources */, + 54DA12AF1F315EE100DD57A1 /* write_spec_test.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1178,8 +1177,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - DE03B2DD1F2149D600A30B9C /* InfoPlist.strings in Resources */, DE03B3631F215E1A00A30B9C /* CAcert.pem in Resources */, + DE03B2DD1F2149D600A30B9C /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1456,118 +1455,117 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7346E61D20325C6900FD6CEF /* FSTDispatchQueueTests.mm in Sources */, - DE2EF0881F3D0B6E003D0CDC /* FSTTreeSortedDictionaryTests.m in Sources */, - ABE6637A201FA81900ED349A /* database_id_test.cc in Sources */, - 5492E0AF2021552D00B64F25 /* FSTReferenceSetTests.mm in Sources */, - 549CCA5120A36DBC00BCEB75 /* tree_sorted_map_test.cc in Sources */, - 5492E09E2021552D00B64F25 /* FSTEagerGarbageCollectorTests.mm in Sources */, - 5492E0C62021557E00B64F25 /* FSTWatchChange+Testing.mm in Sources */, - 5492E064202154B900B64F25 /* FSTQueryListenerTests.mm in Sources */, + 5492E050202154AA00B64F25 /* FIRCollectionReferenceTests.mm in Sources */, + 5492E053202154AB00B64F25 /* FIRDocumentReferenceTests.mm in Sources */, + 5492E055202154AB00B64F25 /* FIRDocumentSnapshotTests.mm in Sources */, + 5492E056202154AB00B64F25 /* FIRFieldPathTests.mm in Sources */, + 5492E054202154AB00B64F25 /* FIRFieldValueTests.mm in Sources */, + 5467FB01203E5717009C9584 /* FIRFirestoreTests.mm in Sources */, + 5492E052202154AB00B64F25 /* FIRGeoPointTests.mm in Sources */, + 5492E059202154AB00B64F25 /* FIRQuerySnapshotTests.mm in Sources */, + 5492E051202154AA00B64F25 /* FIRQueryTests.mm in Sources */, + 5492E057202154AB00B64F25 /* FIRSnapshotMetadataTests.mm in Sources */, B65D34A9203C995B0076A5E1 /* FIRTimestampTest.m in Sources */, - 5492E03320213FFC00B64F25 /* FSTSyncEngineTestDriver.mm in Sources */, - AB380CFE201A2F4500D97691 /* string_util_test.cc in Sources */, - 5492E0A42021552D00B64F25 /* FSTMemoryQueryCacheTests.mm in Sources */, - 54C2294F1FECABAE007D065B /* log_test.cc in Sources */, - B686F2B22025000D0028D6BE /* resource_path_test.cc in Sources */, - 5492E0CA2021557E00B64F25 /* FSTWatchChangeTests.mm in Sources */, - 5492E063202154B900B64F25 /* FSTViewSnapshotTest.mm in Sources */, - 54131E9720ADE679001DF3FF /* string_format_test.cc in Sources */, 5492E058202154AB00B64F25 /* FSTAPIHelpers.mm in Sources */, - AB380CFB2019388600D97691 /* target_id_generator_test.cc in Sources */, - 5492E0A82021552D00B64F25 /* FSTLevelDBLocalStoreTests.mm in Sources */, - 549CCA5920A36E1F00BCEB75 /* precondition_test.cc in Sources */, - ABC1D7DE2023A05300BA84F0 /* user_test.cc in Sources */, - 5491BC721FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */, - ABC1D7DD2023A04F00BA84F0 /* empty_credentials_provider_test.cc in Sources */, - DE2EF0861F3D0B6E003D0CDC /* FSTImmutableSortedDictionary+Testing.m in Sources */, - B686F2AF2023DDEE0028D6BE /* field_path_test.cc in Sources */, - 54A0352A20A3B3BD003E0143 /* testutil.cc in Sources */, - 5492E03120213FFC00B64F25 /* FSTLevelDBSpecTests.mm in Sources */, - B6FB468F208F9BAE00554BA2 /* executor_std_test.cc in Sources */, - 5492E0B12021552D00B64F25 /* FSTRemoteDocumentCacheTests.mm in Sources */, + DE2EF0851F3D0B6E003D0CDC /* FSTArraySortedDictionaryTests.m in Sources */, + 5492E0C82021557E00B64F25 /* FSTDatastoreTests.mm in Sources */, + 7346E61D20325C6900FD6CEF /* FSTDispatchQueueTests.mm in Sources */, + 5492E0B92021555100B64F25 /* FSTDocumentKeyTests.mm in Sources */, 5492E0BA2021555100B64F25 /* FSTDocumentSetTests.mm in Sources */, - 54740A581FC914F000713A1A /* autoid_test.cc in Sources */, - 5492E0A62021552D00B64F25 /* FSTPersistenceTestHelpers.mm in Sources */, - B6FB468E208F9BAB00554BA2 /* executor_libdispatch_test.mm in Sources */, - 5467FB01203E5717009C9584 /* FIRFirestoreTests.mm in Sources */, - B6FB4684208EA0EC00554BA2 /* async_queue_libdispatch_test.mm in Sources */, - 5492E0A12021552D00B64F25 /* FSTMemoryLocalStoreTests.mm in Sources */, + 5492E0BD2021555100B64F25 /* FSTDocumentTests.mm in Sources */, + 5492E09E2021552D00B64F25 /* FSTEagerGarbageCollectorTests.mm in Sources */, + 5492E03E2021401F00B64F25 /* FSTEventAccumulator.mm in Sources */, 5492E067202154B900B64F25 /* FSTEventManagerTests.mm in Sources */, - 54A0353020A3B3D8003E0143 /* statusor_test.cc in Sources */, 5492E0BF2021555100B64F25 /* FSTFieldValueTests.mm in Sources */, - 54A0352620A3AED0003E0143 /* field_transform_test.mm in Sources */, - 5492E055202154AB00B64F25 /* FIRDocumentSnapshotTests.mm in Sources */, - 5492E03E2021401F00B64F25 /* FSTEventAccumulator.mm in Sources */, - 54A0352720A3AED0003E0143 /* transform_operations_test.mm in Sources */, - DE2EF0851F3D0B6E003D0CDC /* FSTArraySortedDictionaryTests.m in Sources */, - 5492E0AA2021552D00B64F25 /* FSTLevelDBRemoteDocumentCacheTests.mm in Sources */, - 5492E0AC2021552D00B64F25 /* FSTMutationQueueTests.mm in Sources */, - 5492E056202154AB00B64F25 /* FIRFieldPathTests.mm in Sources */, - 5492E03220213FFC00B64F25 /* FSTMockDatastore.mm in Sources */, - ABC1D7E12023A40C00BA84F0 /* token_test.cc in Sources */, - 54A0353520A3D8CB003E0143 /* iterator_adaptors_test.cc in Sources */, - AB356EF7200EA5EB0089B766 /* field_value_test.cc in Sources */, - AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */, - 5492E0AD2021552D00B64F25 /* FSTMemoryMutationQueueTests.mm in Sources */, - 5492E051202154AA00B64F25 /* FIRQueryTests.mm in Sources */, - 5492E054202154AB00B64F25 /* FIRFieldValueTests.mm in Sources */, - AB6B908620322E6D00CC290A /* maybe_document_test.cc in Sources */, + 54764FAF1FAA21B90085E60A /* FSTGoogleTestTests.mm in Sources */, + 5492E03F2021401F00B64F25 /* FSTHelpers.mm in Sources */, + DE2EF0861F3D0B6E003D0CDC /* FSTImmutableSortedDictionary+Testing.m in Sources */, + DE2EF0871F3D0B6E003D0CDC /* FSTImmutableSortedSet+Testing.m in Sources */, + 5491BC721FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */, + 5492E0A72021552D00B64F25 /* FSTLevelDBKeyTests.mm in Sources */, + 5492E0A82021552D00B64F25 /* FSTLevelDBLocalStoreTests.mm in Sources */, 5492E09F2021552D00B64F25 /* FSTLevelDBMigrationsTests.mm in Sources */, - 546854AA20A36867004BDBD5 /* datastore_test.cc in Sources */, - 5492E053202154AB00B64F25 /* FIRDocumentReferenceTests.mm in Sources */, - 5492E09D2021552D00B64F25 /* FSTLocalStoreTests.mm in Sources */, + 5492E0A02021552D00B64F25 /* FSTLevelDBMutationQueueTests.mm in Sources */, + 5492E0AE2021552D00B64F25 /* FSTLevelDBQueryCacheTests.mm in Sources */, + 5492E0AA2021552D00B64F25 /* FSTLevelDBRemoteDocumentCacheTests.mm in Sources */, + 5492E03120213FFC00B64F25 /* FSTLevelDBSpecTests.mm in Sources */, + 132E3E53179DE287D875F3F2 /* FSTLevelDBTransactionTests.mm in Sources */, 5492E0A32021552D00B64F25 /* FSTLocalSerializerTests.mm in Sources */, - 5492E0A72021552D00B64F25 /* FSTLevelDBKeyTests.mm in Sources */, - B6FB4685208EA0F000554BA2 /* async_queue_std_test.cc in Sources */, - 5492E0A22021552D00B64F25 /* FSTQueryCacheTests.mm in Sources */, + 5492E09D2021552D00B64F25 /* FSTLocalStoreTests.mm in Sources */, + 5492E0A12021552D00B64F25 /* FSTMemoryLocalStoreTests.mm in Sources */, + 5492E0AD2021552D00B64F25 /* FSTMemoryMutationQueueTests.mm in Sources */, + 5492E0A42021552D00B64F25 /* FSTMemoryQueryCacheTests.mm in Sources */, 5492E0A52021552D00B64F25 /* FSTMemoryRemoteDocumentCacheTests.mm in Sources */, - AB6B908820322E8800CC290A /* no_document_test.cc in Sources */, - 5492E0BD2021555100B64F25 /* FSTDocumentTests.mm in Sources */, - 5492E0B92021555100B64F25 /* FSTDocumentKeyTests.mm in Sources */, - DE2EF0871F3D0B6E003D0CDC /* FSTImmutableSortedSet+Testing.m in Sources */, - 5492E0C82021557E00B64F25 /* FSTDatastoreTests.mm in Sources */, - 54995F6F205B6E12004EFFA0 /* leveldb_key_test.cc in Sources */, + 5492E03420213FFC00B64F25 /* FSTMemorySpecTests.mm in Sources */, + 5492E03220213FFC00B64F25 /* FSTMockDatastore.mm in Sources */, + 5492E0AC2021552D00B64F25 /* FSTMutationQueueTests.mm in Sources */, + 5492E0BE2021555100B64F25 /* FSTMutationTests.mm in Sources */, + 5492E0A62021552D00B64F25 /* FSTPersistenceTestHelpers.mm in Sources */, + 5492E0A22021552D00B64F25 /* FSTQueryCacheTests.mm in Sources */, + 5492E064202154B900B64F25 /* FSTQueryListenerTests.mm in Sources */, + 5492E068202154B900B64F25 /* FSTQueryTests.mm in Sources */, + 5492E0AF2021552D00B64F25 /* FSTReferenceSetTests.mm in Sources */, + 5492E0B12021552D00B64F25 /* FSTRemoteDocumentCacheTests.mm in Sources */, + 5492E0C92021557E00B64F25 /* FSTRemoteEventTests.mm in Sources */, + 5492E0C72021557E00B64F25 /* FSTSerializerBetaTests.mm in Sources */, + 5492E03520213FFC00B64F25 /* FSTSpecTests.mm in Sources */, + 5492E03320213FFC00B64F25 /* FSTSyncEngineTestDriver.mm in Sources */, + DE2EF0881F3D0B6E003D0CDC /* FSTTreeSortedDictionaryTests.m in Sources */, + 5492E063202154B900B64F25 /* FSTViewSnapshotTest.mm in Sources */, 5492E065202154B900B64F25 /* FSTViewTests.mm in Sources */, - B6FB467D208E9D3C00554BA2 /* async_queue_test.cc in Sources */, - 54A0352F20A3B3D8003E0143 /* status_test.cc in Sources */, + 5492E0C62021557E00B64F25 /* FSTWatchChange+Testing.mm in Sources */, + 5492E0CA2021557E00B64F25 /* FSTWatchChangeTests.mm in Sources */, + 5492E0AB2021552D00B64F25 /* StringViewTests.mm in Sources */, 5492E03C2021401F00B64F25 /* XCTestCase+Await.mm in Sources */, - B6152AD7202A53CB000E5744 /* document_key_test.cc in Sources */, 5467FB08203E6A44009C9584 /* app_testing.mm in Sources */, - 54764FAF1FAA21B90085E60A /* FSTGoogleTestTests.mm in Sources */, - AB380D04201BC6E400D97691 /* ordered_code_test.cc in Sources */, - 5492E03F2021401F00B64F25 /* FSTHelpers.mm in Sources */, - 549CCA5220A36DBC00BCEB75 /* sorted_map_test.cc in Sources */, - 5492E068202154B900B64F25 /* FSTQueryTests.mm in Sources */, - 5492E0AB2021552D00B64F25 /* StringViewTests.mm in Sources */, - 5492E0C92021557E00B64F25 /* FSTRemoteEventTests.mm in Sources */, - ABC1D7E42024AFDE00BA84F0 /* firebase_credentials_provider_test.mm in Sources */, - AB6B908420322E4D00CC290A /* document_test.cc in Sources */, - ABF6506C201131F8005F2C74 /* timestamp_test.cc in Sources */, - 5492E0AE2021552D00B64F25 /* FSTLevelDBQueryCacheTests.mm in Sources */, - ABC1D7DC2023A04B00BA84F0 /* credentials_provider_test.cc in Sources */, - 54511E8E209805F8005BD28F /* hashing_test.cc in Sources */, - 5492E059202154AB00B64F25 /* FIRQuerySnapshotTests.mm in Sources */, - 5492E050202154AA00B64F25 /* FIRCollectionReferenceTests.mm in Sources */, - ABA495BB202B7E80008A7851 /* snapshot_version_test.cc in Sources */, - 5492E0A02021552D00B64F25 /* FSTLevelDBMutationQueueTests.mm in Sources */, 54EB764D202277B30088B8F3 /* array_sorted_map_test.cc in Sources */, - 54131E9920AE076D001DF3FF /* hard_assert_test.cc in Sources */, - 5492E03420213FFC00B64F25 /* FSTMemorySpecTests.mm in Sources */, + B6FB4684208EA0EC00554BA2 /* async_queue_libdispatch_test.mm in Sources */, + B6FB4685208EA0F000554BA2 /* async_queue_std_test.cc in Sources */, + B6FB467D208E9D3C00554BA2 /* async_queue_test.cc in Sources */, + 54740A581FC914F000713A1A /* autoid_test.cc in Sources */, AB380D02201BC69F00D97691 /* bits_test.cc in Sources */, 548DB929200D59F600E00ABC /* comparison_test.cc in Sources */, - 549CCA5720A36E1F00BCEB75 /* field_mask_test.cc in Sources */, - 5492E03D2021401F00B64F25 /* FSTAssertTests.mm in Sources */, + ABC1D7DC2023A04B00BA84F0 /* credentials_provider_test.cc in Sources */, + ABE6637A201FA81900ED349A /* database_id_test.cc in Sources */, AB38D93020236E21000A432D /* database_info_test.cc in Sources */, - 5492E052202154AB00B64F25 /* FIRGeoPointTests.mm in Sources */, - 5492E0C72021557E00B64F25 /* FSTSerializerBetaTests.mm in Sources */, + 546854AA20A36867004BDBD5 /* datastore_test.cc in Sources */, + B6152AD7202A53CB000E5744 /* document_key_test.cc in Sources */, + AB6B908420322E4D00CC290A /* document_test.cc in Sources */, + ABC1D7DD2023A04F00BA84F0 /* empty_credentials_provider_test.cc in Sources */, + B6FB468E208F9BAB00554BA2 /* executor_libdispatch_test.mm in Sources */, + B6FB468F208F9BAE00554BA2 /* executor_std_test.cc in Sources */, B6FB4690208F9BB300554BA2 /* executor_test.cc in Sources */, - 5492E03520213FFC00B64F25 /* FSTSpecTests.mm in Sources */, - 5492E057202154AB00B64F25 /* FIRSnapshotMetadataTests.mm in Sources */, + 549CCA5720A36E1F00BCEB75 /* field_mask_test.cc in Sources */, + B686F2AF2023DDEE0028D6BE /* field_path_test.cc in Sources */, + 54A0352620A3AED0003E0143 /* field_transform_test.mm in Sources */, + AB356EF7200EA5EB0089B766 /* field_value_test.cc in Sources */, + ABC1D7E42024AFDE00BA84F0 /* firebase_credentials_provider_test.mm in Sources */, + AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */, + 73FE5066020EF9B2892C86BF /* hard_assert_test.cc in Sources */, + 54511E8E209805F8005BD28F /* hashing_test.cc in Sources */, + 54A0353520A3D8CB003E0143 /* iterator_adaptors_test.cc in Sources */, + 54995F6F205B6E12004EFFA0 /* leveldb_key_test.cc in Sources */, + 54C2294F1FECABAE007D065B /* log_test.cc in Sources */, + AB6B908620322E6D00CC290A /* maybe_document_test.cc in Sources */, + AB6B908820322E8800CC290A /* no_document_test.cc in Sources */, + AB380D04201BC6E400D97691 /* ordered_code_test.cc in Sources */, + 549CCA5920A36E1F00BCEB75 /* precondition_test.cc in Sources */, + B686F2B22025000D0028D6BE /* resource_path_test.cc in Sources */, 54740A571FC914BA00713A1A /* secure_random_test.cc in Sources */, + ABA495BB202B7E80008A7851 /* snapshot_version_test.cc in Sources */, + 549CCA5220A36DBC00BCEB75 /* sorted_map_test.cc in Sources */, 549CCA5020A36DBC00BCEB75 /* sorted_set_test.cc in Sources */, - 5492E0BE2021555100B64F25 /* FSTMutationTests.mm in Sources */, - 132E3E53179DE287D875F3F2 /* FSTLevelDBTransactionTests.mm in Sources */, + 54A0352F20A3B3D8003E0143 /* status_test.cc in Sources */, + 54A0353020A3B3D8003E0143 /* statusor_test.cc in Sources */, + 54131E9720ADE679001DF3FF /* string_format_test.cc in Sources */, + AB380CFE201A2F4500D97691 /* string_util_test.cc in Sources */, + AB380CFB2019388600D97691 /* target_id_generator_test.cc in Sources */, + 54A0352A20A3B3BD003E0143 /* testutil.cc in Sources */, + ABF6506C201131F8005F2C74 /* timestamp_test.cc in Sources */, + ABC1D7E12023A40C00BA84F0 /* token_test.cc in Sources */, + 54A0352720A3AED0003E0143 /* transform_operations_test.mm in Sources */, + 549CCA5120A36DBC00BCEB75 /* tree_sorted_map_test.cc in Sources */, + ABC1D7DE2023A05300BA84F0 /* user_test.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1576,24 +1574,24 @@ buildActionMask = 2147483647; files = ( 73866AA12082B0A5009BB4FF /* FIRArrayTransformTests.mm in Sources */, + 5492E079202154D600B64F25 /* FIRCursorTests.mm in Sources */, + 5492E075202154D600B64F25 /* FIRDatabaseTests.mm in Sources */, + 5492E073202154D600B64F25 /* FIRFieldsTests.mm in Sources */, 6161B5032047140C00A99DBB /* FIRFirestoreSourceTests.mm in Sources */, - 5492E076202154D600B64F25 /* FIRValidationTests.mm in Sources */, + 5492E074202154D600B64F25 /* FIRListenerRegistrationTests.mm in Sources */, 5492E072202154D600B64F25 /* FIRQueryTests.mm in Sources */, - 5491BC731FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */, - 5492E0442021457E00B64F25 /* XCTestCase+Await.mm in Sources */, + 5492E077202154D600B64F25 /* FIRServerTimestampTests.mm in Sources */, 5492E07A202154D600B64F25 /* FIRTypeTests.mm in Sources */, - 5492E0422021440500B64F25 /* FSTHelpers.mm in Sources */, + 5492E076202154D600B64F25 /* FIRValidationTests.mm in Sources */, + 5492E078202154D600B64F25 /* FIRWriteBatchTests.mm in Sources */, + 5492E082202154EC00B64F25 /* FSTDatastoreTests.mm in Sources */, 5492E041202143E700B64F25 /* FSTEventAccumulator.mm in Sources */, + 5492E0422021440500B64F25 /* FSTHelpers.mm in Sources */, + 5491BC731FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */, 5492E080202154EC00B64F25 /* FSTSmokeTests.mm in Sources */, - 5492E077202154D600B64F25 /* FIRServerTimestampTests.mm in Sources */, 5492E081202154EC00B64F25 /* FSTStreamTests.mm in Sources */, - 5492E074202154D600B64F25 /* FIRListenerRegistrationTests.mm in Sources */, - 5492E082202154EC00B64F25 /* FSTDatastoreTests.mm in Sources */, - 5492E079202154D600B64F25 /* FIRCursorTests.mm in Sources */, - 5492E073202154D600B64F25 /* FIRFieldsTests.mm in Sources */, 5492E07F202154EC00B64F25 /* FSTTransactionTests.mm in Sources */, - 5492E075202154D600B64F25 /* FIRDatabaseTests.mm in Sources */, - 5492E078202154D600B64F25 /* FIRWriteBatchTests.mm in Sources */, + 5492E0442021457E00B64F25 /* XCTestCase+Await.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Firestore/Example/LibFuzzer.podspec b/Firestore/Example/LibFuzzer.podspec new file mode 100644 index 0000000..0f677f5 --- /dev/null +++ b/Firestore/Example/LibFuzzer.podspec @@ -0,0 +1,45 @@ +# Copyright 2018 Google +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A podspec for libFuzzer. Excludes the 'FuzzerMain.cpp' because the pod +# installation would require the 'LLVMFuzzerTestOneInput' function to be +# linked when the pod is being created, but it will be available in +# the fuzzing application. Hence, users of this Pod are required to +# provide their main function similar to 'FuzzerMain.cpp'. +# See the build script of libFuzzer for more details: +# https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer/build.sh + +Pod::Spec.new do |s| + s.name = 'LibFuzzer' + s.version = '1.0' + s.summary = 'libFuzzer for fuzz testing' + s.homepage = 'https://llvm.org/docs/LibFuzzer.html' + s.license = { :type => 'BSD-Like' } + s.authors = 'LLVM Team' + + # Check out only libFuzzer folder. + s.source = { + :svn => 'https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer' + } + + # Add all source files, except for the FuzzerMain.cpp. + s.source_files = '*.{h,cpp,def}' + s.exclude_files = 'FuzzerMain.cpp' + + s.library = 'c++' + + s.pod_target_xcconfig = { + 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11' + } +end diff --git a/Firestore/Example/Tests/Integration/FSTDatastoreTests.mm b/Firestore/Example/Tests/Integration/FSTDatastoreTests.mm index 920e3c5..e6e1a19 100644 --- a/Firestore/Example/Tests/Integration/FSTDatastoreTests.mm +++ b/Firestore/Example/Tests/Integration/FSTDatastoreTests.mm @@ -33,7 +33,6 @@ #import "Firestore/Source/Remote/FSTDatastore.h" #import "Firestore/Source/Remote/FSTRemoteEvent.h" #import "Firestore/Source/Remote/FSTRemoteStore.h" -#import "Firestore/Source/Util/FSTAssert.h" #import "Firestore/Source/Util/FSTDispatchQueue.h" #import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" @@ -42,6 +41,7 @@ #include "Firestore/core/src/firebase/firestore/core/database_info.h" #include "Firestore/core/src/firebase/firestore/model/database_id.h" #include "Firestore/core/src/firebase/firestore/model/precondition.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" #include "Firestore/core/src/firebase/firestore/util/string_apple.h" namespace util = firebase::firestore::util; @@ -118,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)rejectFailedWriteWithBatchID:(FSTBatchID)batchID error:(NSError *)error { - FSTFail(@"Not implemented"); + HARD_FAIL("Not implemented"); } - (void)applyRemoteEvent:(FSTRemoteEvent *)remoteEvent { @@ -129,7 +129,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)rejectListenWithTargetID:(const TargetId)targetID error:(NSError *)error { - FSTFail(@"Not implemented"); + HARD_FAIL("Not implemented"); } @end diff --git a/Firestore/Example/Tests/Integration/FSTStreamTests.mm b/Firestore/Example/Tests/Integration/FSTStreamTests.mm index 2e5c9b6..b944a93 100644 --- a/Firestore/Example/Tests/Integration/FSTStreamTests.mm +++ b/Firestore/Example/Tests/Integration/FSTStreamTests.mm @@ -24,12 +24,12 @@ #import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" #import "Firestore/Source/Remote/FSTDatastore.h" #import "Firestore/Source/Remote/FSTStream.h" -#import "Firestore/Source/Util/FSTAssert.h" #include "Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h" #include "Firestore/core/src/firebase/firestore/core/database_info.h" #include "Firestore/core/src/firebase/firestore/model/database_id.h" #include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" #include "Firestore/core/src/firebase/firestore/util/string_apple.h" namespace util = firebase::firestore::util; @@ -121,7 +121,7 @@ using firebase::firestore::model::SnapshotVersion; * to be called. */ - (void)awaitNotificationFromBlock:(void (^)(void))block { - FSTAssert(_expectation == nil, @"Previous expectation still active"); + HARD_ASSERT(_expectation == nil, "Previous expectation still active"); XCTestExpectation *expectation = [self.testCase expectationWithDescription:@"awaitCallbackInBlock"]; _expectation = expectation; diff --git a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm index dd34556..63c3d72 100644 --- a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm +++ b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm @@ -16,12 +16,11 @@ #import "Firestore/Example/Tests/SpecTests/FSTMockDatastore.h" +#import "Firestore/Source/Core/FSTQuery.h" #import "Firestore/Source/Local/FSTQueryData.h" #import "Firestore/Source/Model/FSTMutation.h" #import "Firestore/Source/Remote/FSTSerializerBeta.h" #import "Firestore/Source/Remote/FSTStream.h" -#import "Firestore/Source/Util/FSTAssert.h" -#import "Firestore/Source/Util/FSTLogger.h" #import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" @@ -29,6 +28,7 @@ #include "Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h" #include "Firestore/core/src/firebase/firestore/core/database_info.h" #include "Firestore/core/src/firebase/firestore/model/database_id.h" +#include "Firestore/core/src/firebase/firestore/util/log.h" #include "Firestore/core/src/firebase/firestore/util/string_apple.h" using firebase::firestore::auth::CredentialsProvider; @@ -79,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN credentials:credentials serializer:serializer]; if (self) { - FSTAssert(datastore, @"Datastore must not be nil"); + HARD_ASSERT(datastore, "Datastore must not be nil"); _datastore = datastore; _activeTargets = [NSMutableDictionary dictionary]; } @@ -89,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Overridden FSTWatchStream methods. - (void)startWithDelegate:(id<FSTWatchStreamDelegate>)delegate { - FSTAssert(!self.open, @"Trying to start already started watch stream"); + HARD_ASSERT(!self.open, "Trying to start already started watch stream"); self.open = YES; self.delegate = delegate; [self notifyStreamOpen]; @@ -117,7 +117,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)watchQuery:(FSTQueryData *)query { - FSTLog(@"watchQuery: %d: %@", query.targetID, query.query); + LOG_DEBUG("watchQuery: %s: %s", query.targetID, query.query); self.datastore.watchStreamRequestCount += 1; // Snapshot version is ignored on the wire FSTQueryData *sentQueryData = [query queryDataByReplacingSnapshotVersion:SnapshotVersion::None() @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)unwatchTargetID:(FSTTargetID)targetID { - FSTLog(@"unwatchTargetID: %d", targetID); + LOG_DEBUG("unwatchTargetID: %s", targetID); [self.activeTargets removeObjectForKey:@(targetID)]; } @@ -147,7 +147,7 @@ NS_ASSUME_NONNULL_BEGIN // Technically removing an unknown target is valid (e.g. it could race with a // server-side removal), but we want to pay extra careful attention in tests // that we only remove targets we listened too. - FSTFail(@"Removing a non-active target"); + HARD_FAIL("Removing a non-active target"); } [self.activeTargets removeObjectForKey:targetID]; } @@ -203,7 +203,7 @@ NS_ASSUME_NONNULL_BEGIN credentials:credentials serializer:serializer]; if (self) { - FSTAssert(datastore, @"Datastore must not be nil"); + HARD_ASSERT(datastore, "Datastore must not be nil"); _datastore = datastore; _sentMutations = [NSMutableArray array]; } @@ -213,7 +213,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Overridden FSTWriteStream methods. - (void)startWithDelegate:(id<FSTWriteStreamDelegate>)delegate { - FSTAssert(!self.open, @"Trying to start already started write stream"); + HARD_ASSERT(!self.open, "Trying to start already started write stream"); self.open = YES; [self.sentMutations removeAllObjects]; self.delegate = delegate; @@ -257,8 +257,8 @@ NS_ASSUME_NONNULL_BEGIN * Returns the next write that was "sent to the backend", failing if there are no queued sent */ - (NSArray<FSTMutation *> *)nextSentWrite { - FSTAssert(self.sentMutations.count > 0, - @"Writes need to happen before you can call nextSentWrite."); + HARD_ASSERT(self.sentMutations.count > 0, + "Writes need to happen before you can call nextSentWrite."); NSArray<FSTMutation *> *result = [self.sentMutations objectAtIndex:0]; [self.sentMutations removeObjectAtIndex:0]; return result; @@ -291,7 +291,6 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Overridden FSTDatastore methods. - (FSTWatchStream *)createWatchStream { - // FSTAssert(self.databaseInfo, @"DatabaseInfo must not be nil"); self.watchStream = [[FSTMockWatchStream alloc] initWithDatastore:self workerDispatchQueue:self.workerDispatchQueue @@ -302,7 +301,6 @@ NS_ASSUME_NONNULL_BEGIN } - (FSTWriteStream *)createWriteStream { - // FSTAssert(self.databaseInfo, @"DatabaseInfo must not be nil"); self.writeStream = [[FSTMockWriteStream alloc] initWithDatastore:self workerDispatchQueue:self.workerDispatchQueue @@ -313,7 +311,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)authorizeAndStartRPC:(GRPCProtoCall *)rpc completion:(FSTVoidErrorBlock)completion { - FSTFail(@"FSTMockDatastore shouldn't be starting any RPCs."); + HARD_FAIL("FSTMockDatastore shouldn't be starting any RPCs."); } #pragma mark - Method exposed for tests to call. diff --git a/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm b/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm index 5a7cb72..77010e5 100644 --- a/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm +++ b/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm @@ -34,10 +34,8 @@ #import "Firestore/Source/Model/FSTMutation.h" #import "Firestore/Source/Remote/FSTExistenceFilter.h" #import "Firestore/Source/Remote/FSTWatchChange.h" -#import "Firestore/Source/Util/FSTAssert.h" #import "Firestore/Source/Util/FSTClasses.h" #import "Firestore/Source/Util/FSTDispatchQueue.h" -#import "Firestore/Source/Util/FSTLogger.h" #import "Firestore/Example/Tests/Remote/FSTWatchChange+Testing.h" #import "Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h" @@ -46,6 +44,8 @@ #include "Firestore/core/src/firebase/firestore/auth/user.h" #include "Firestore/core/src/firebase/firestore/model/document_key.h" #include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/firebase/firestore/util/log.h" #include "Firestore/core/src/firebase/firestore/util/string_apple.h" #include "Firestore/core/test/firebase/firestore/testutil/testutil.h" @@ -233,7 +233,7 @@ static NSString *const kNoIOSTag = @"no-ios"; - (void)doWatchEntity:(NSDictionary *)watchEntity snapshot:(NSNumber *_Nullable)watchSnapshot { if (watchEntity[@"docs"]) { - FSTAssert(!watchEntity[@"doc"], @"Exactly one of |doc| or |docs| needs to be set."); + HARD_ASSERT(!watchEntity[@"doc"], "Exactly one of |doc| or |docs| needs to be set."); int count = 0; NSArray *docs = watchEntity[@"docs"]; for (NSDictionary *doc in docs) { @@ -277,13 +277,13 @@ static NSString *const kNoIOSTag = @"no-ios"; document:nil]; [self.driver receiveWatchChange:change snapshotVersion:[self parseVersion:watchSnapshot]]; } else { - FSTFail(@"Either key, doc or docs must be set."); + HARD_FAIL("Either key, doc or docs must be set."); } } - (void)doWatchFilter:(NSArray *)watchFilter snapshot:(NSNumber *_Nullable)watchSnapshot { NSArray<NSNumber *> *targets = watchFilter[0]; - FSTAssert(targets.count == 1, @"ExistenceFilters currently support exactly one target only."); + HARD_ASSERT(targets.count == 1, "ExistenceFilters currently support exactly one target only."); int keyCount = watchFilter.count == 0 ? 0 : (int)watchFilter.count - 1; @@ -308,7 +308,7 @@ static NSString *const kNoIOSTag = @"no-ios"; NSNumber *runBackoffTimer = closeSpec[@"runBackoffTimer"]; // TODO(b/72313632): Incorporate backoff in iOS Spec Tests. - FSTAssert(runBackoffTimer.boolValue, @"iOS Spec Tests don't support backoff."); + HARD_ASSERT(runBackoffTimer.boolValue, "iOS Spec Tests don't support backoff."); [self.driver receiveWatchStreamError:code userInfo:errorSpec]; } @@ -323,8 +323,8 @@ static NSString *const kNoIOSTag = @"no-ios"; [self.driver receiveWriteAckWithVersion:version mutationResults:@[ mutationResult ]]; if (expectUserCallback.boolValue) { - FSTAssert(write.done, @"Write should be done"); - FSTAssert(!write.error, @"Ack should not fail"); + HARD_ASSERT(write.done, "Write should be done"); + HARD_ASSERT(!write.error, "Ack should not fail"); } } @@ -336,7 +336,7 @@ static NSString *const kNoIOSTag = @"no-ios"; FSTOutstandingWrite *write = [self.driver receiveWriteError:code userInfo:errorSpec]; if (expectUserCallback.boolValue) { - FSTAssert(write.done, @"Write should be done"); + HARD_ASSERT(write.done, "Write should be done"); XCTAssertNotNil(write.error, @"Write should have failed"); XCTAssertEqualObjects(write.error.domain, FIRFirestoreErrorDomain); XCTAssertEqual(write.error.code, code); @@ -358,7 +358,7 @@ static NSString *const kNoIOSTag = @"no-ios"; } else if ([timer isEqualToString:@"online_state_timeout"]) { timerID = FSTTimerIDOnlineStateTimeout; } else { - FSTFail(@"runTimer spec step specified unknown timer: %@", timer); + HARD_FAIL("runTimer spec step specified unknown timer: %s", timer); } [self.driver runTimer:timerID]; @@ -427,7 +427,7 @@ static NSString *const kNoIOSTag = @"no-ios"; [self doWatchStreamClose:step[@"watchStreamClose"]]; } else if (step[@"watchProto"]) { // watchProto isn't yet used, and it's unclear how to create arbitrary protos from JSON. - FSTFail(@"watchProto is not yet supported."); + HARD_FAIL("watchProto is not yet supported."); } else if (step[@"writeAck"]) { [self doWriteAck:step[@"writeAck"]]; } else if (step[@"failWrite"]) { @@ -620,7 +620,7 @@ static NSString *const kNoIOSTag = @"no-ios"; @try { [self setUpForSpecWithConfig:config]; for (NSDictionary *step in steps) { - FSTLog(@"Doing step %@", step); + LOG_DEBUG("Doing step %s", step); [self doStep:step]; [self validateStepExpectations:step[@"expect"]]; [self validateStateExpectations:step[@"stateExpect"]]; diff --git a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.mm b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.mm index 2aa0e30..d346197 100644 --- a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.mm +++ b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.mm @@ -30,8 +30,6 @@ #import "Firestore/Source/Model/FSTMutation.h" #import "Firestore/Source/Remote/FSTDatastore.h" #import "Firestore/Source/Remote/FSTWatchChange.h" -#import "Firestore/Source/Util/FSTAssert.h" -#import "Firestore/Source/Util/FSTLogger.h" #import "Firestore/Example/Tests/Core/FSTSyncEngine+Testing.h" #import "Firestore/Example/Tests/SpecTests/FSTMockDatastore.h" @@ -41,6 +39,8 @@ #include "Firestore/core/src/firebase/firestore/core/database_info.h" #include "Firestore/core/src/firebase/firestore/model/database_id.h" #include "Firestore/core/src/firebase/firestore/model/document_key.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/firebase/firestore/util/log.h" using firebase::firestore::auth::EmptyCredentialsProvider; using firebase::firestore::auth::HashUser; @@ -183,9 +183,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)validateUsage { // We could relax this if we found a reason to. - FSTAssert(self.events.count == 0, - @"You must clear all pending events by calling" - " capturedEventsSinceLastCall before calling shutdown."); + HARD_ASSERT(self.events.count == 0, + "You must clear all pending events by calling" + " capturedEventsSinceLastCall before calling shutdown."); } - (void)shutdown { @@ -197,12 +197,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)validateNextWriteSent:(FSTMutation *)expectedWrite { NSArray<FSTMutation *> *request = [self.datastore nextSentWrite]; // Make sure the write went through the pipe like we expected it to. - FSTAssert(request.count == 1, @"Only single mutation requests are supported at the moment"); + HARD_ASSERT(request.count == 1, "Only single mutation requests are supported at the moment"); FSTMutation *actualWrite = request[0]; - FSTAssert([actualWrite isEqual:expectedWrite], - @"Mock datastore received write %@ but first outstanding mutation was %@", actualWrite, - expectedWrite); - FSTLog(@"A write was sent: %@", actualWrite); + HARD_ASSERT([actualWrite isEqual:expectedWrite], + "Mock datastore received write %s but first outstanding mutation was %s", actualWrite, + expectedWrite); + LOG_DEBUG("A write was sent: %s", actualWrite); } - (int)sentWritesCount { @@ -271,7 +271,7 @@ NS_ASSUME_NONNULL_BEGIN [[self currentOutstandingWrites] removeObjectAtIndex:0]; } - FSTLog(@"Failing a write."); + LOG_DEBUG("Failing a write."); [self.dispatchQueue dispatchSync:^{ [self.datastore failWriteWithError:error]; }]; @@ -321,11 +321,11 @@ NS_ASSUME_NONNULL_BEGIN FSTOutstandingWrite *write = [[FSTOutstandingWrite alloc] init]; write.write = mutation; [[self currentOutstandingWrites] addObject:write]; - FSTLog(@"sending a user write."); + LOG_DEBUG("sending a user write."); [self.dispatchQueue dispatchSync:^{ [self.syncEngine writeMutations:@[ mutation ] completion:^(NSError *_Nullable error) { - FSTLog(@"A callback was called with error: %@", error); + LOG_DEBUG("A callback was called with error: %s", error); write.done = YES; write.error = error; }]; @@ -347,7 +347,7 @@ NS_ASSUME_NONNULL_BEGIN [self.datastore failWatchStreamWithError:error]; // Unlike web, stream should re-open synchronously (if we have any listeners) if (self.queryListeners.count > 0) { - FSTAssert(self.datastore.isWatchStreamOpen, @"Watch stream is open"); + HARD_ASSERT(self.datastore.isWatchStreamOpen, "Watch stream is open"); } }]; } diff --git a/Firestore/Example/Tests/Util/FSTAssertTests.mm b/Firestore/Example/Tests/Util/FSTAssertTests.mm deleted file mode 100644 index 0cba03f..0000000 --- a/Firestore/Example/Tests/Util/FSTAssertTests.mm +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "Firestore/Source/Util/FSTAssert.h" - -#import <XCTest/XCTest.h> - -@interface FSTAssertTests : XCTestCase -@end - -@implementation FSTAssertTests - -- (void)testFail { - @try { - [self failingMethod]; - XCTFail("Should not have succeeded"); - } @catch (NSException *ex) { - XCTAssertEqualObjects(ex.name, NSInternalInconsistencyException); - XCTAssertEqualObjects(ex.reason, @"FIRESTORE INTERNAL ASSERTION FAILED: 0:foo:bar"); - } -} - -// A method guaranteed to fail. Note that the return type is intentionally something that is -// not actually returned in the body to ensure that the function attribute declarations in the -// macro properly mark this macro invocation as never returning. -- (int)failingMethod { - FSTFail(@"%d:%s:%@", 0, "foo", @"bar"); -} - -- (void)testCFail { - @try { - failingFunction(); - XCTFail("Should not have succeeded"); - } @catch (NSException *ex) { - XCTAssertEqualObjects(ex.name, NSInternalInconsistencyException); - XCTAssertEqualObjects(ex.reason, @"FIRESTORE INTERNAL ASSERTION FAILED: 0:foo:bar"); - } -} - -// A function guaranteed to fail. Note that the return type is intentionally something that is -// not actually returned in the body to ensure that the function attribute declarations in the -// macro properly mark this macro invocation as never returning. -int failingFunction() { - FSTCFail(@"%d:%s:%@", 0, "foo", @"bar"); -} - -- (void)testAssertNonFailing { - @try { - FSTAssert(YES, @"shouldn't fail"); - } @catch (NSException *ex) { - XCTFail("Should not have failed, but got %@", ex); - } -} - -- (void)testAssertFailing { - @try { - FSTAssert(NO, @"should fail"); - XCTFail("Should not have succeeded"); - } @catch (NSException *ex) { - XCTAssertEqualObjects(ex.name, NSInternalInconsistencyException); - XCTAssertEqualObjects(ex.reason, @"FIRESTORE INTERNAL ASSERTION FAILED: should fail"); - } -} - -- (void)testCAssertNonFailing { - @try { - nonAssertingFunction(); - } @catch (NSException *ex) { - XCTFail("Should not have failed, but got %@", ex); - } -} - -int nonAssertingFunction() { - FSTCAssert(YES, @"shouldn't fail"); - return 0; -} - -- (void)testCAssertFailing { - @try { - assertingFunction(); - XCTFail("Should not have succeeded"); - } @catch (NSException *ex) { - XCTAssertEqualObjects(ex.name, NSInternalInconsistencyException); - XCTAssertEqualObjects(ex.reason, @"FIRESTORE INTERNAL ASSERTION FAILED: should fail"); - } -} - -int assertingFunction() { - FSTCAssert(NO, @"should fail"); -} - -@end diff --git a/Firestore/Example/Tests/Util/FSTEventAccumulator.mm b/Firestore/Example/Tests/Util/FSTEventAccumulator.mm index 3ab6035..835dc68 100644 --- a/Firestore/Example/Tests/Util/FSTEventAccumulator.mm +++ b/Firestore/Example/Tests/Util/FSTEventAccumulator.mm @@ -18,12 +18,12 @@ #import <XCTest/XCTest.h> +#import "Firestore/Example/Tests/Util/XCTestCase+Await.h" #import "Firestore/Source/Public/FIRDocumentSnapshot.h" #import "Firestore/Source/Public/FIRQuerySnapshot.h" #import "Firestore/Source/Public/FIRSnapshotMetadata.h" -#import "Firestore/Source/Util/FSTAssert.h" -#import "Firestore/Example/Tests/Util/XCTestCase+Await.h" +#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" NS_ASSUME_NONNULL_BEGIN @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN - (NSArray<id> *)awaitEvents:(NSUInteger)events name:(NSString *)name { @synchronized(self) { - FSTAssert(!self.expectation, @"Existing expectation still pending?"); + HARD_ASSERT(!self.expectation, "Existing expectation still pending?"); self.expectation = [self.testCase expectationWithDescription:name]; self.maxEvents = self.maxEvents + events; [self checkFulfilled]; @@ -91,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN if ([event isKindOfClass:[FIRDocumentSnapshot class]]) { return ((FIRDocumentSnapshot *)event).metadata.hasPendingWrites; } else { - FSTAssert([event isKindOfClass:[FIRQuerySnapshot class]], @"Unexpected event: %@", event); + HARD_ASSERT([event isKindOfClass:[FIRQuerySnapshot class]], "Unexpected event: %s", event); return ((FIRQuerySnapshot *)event).metadata.hasPendingWrites; } } diff --git a/Firestore/Example/Tests/Util/FSTHelpers.mm b/Firestore/Example/Tests/Util/FSTHelpers.mm index bc2f005..5ed4fd5 100644 --- a/Firestore/Example/Tests/Util/FSTHelpers.mm +++ b/Firestore/Example/Tests/Util/FSTHelpers.mm @@ -40,7 +40,6 @@ #import "Firestore/Source/Model/FSTMutation.h" #import "Firestore/Source/Remote/FSTRemoteEvent.h" #import "Firestore/Source/Remote/FSTWatchChange.h" -#import "Firestore/Source/Util/FSTAssert.h" #include "Firestore/core/src/firebase/firestore/model/database_id.h" #include "Firestore/core/src/firebase/firestore/model/document_key.h" @@ -140,7 +139,7 @@ FSTFieldValue *FSTTestFieldValue(id _Nullable value) { FSTObjectValue *FSTTestObjectValue(NSDictionary<NSString *, id> *data) { FSTFieldValue *wrapped = FSTTestFieldValue(data); - FSTCAssert([wrapped isKindOfClass:[FSTObjectValue class]], @"Unsupported value: %@", data); + HARD_ASSERT([wrapped isKindOfClass:[FSTObjectValue class]], "Unsupported value: %s", data); return (FSTObjectValue *)wrapped; } @@ -195,15 +194,15 @@ id<FSTFilter> FSTTestFilter(const absl::string_view field, NSString *opString, i } else if ([opString isEqualToString:@"array_contains"]) { op = FSTRelationFilterOperatorArrayContains; } else { - FSTCFail(@"Unsupported operator type: %@", opString); + HARD_FAIL("Unsupported operator type: %s", opString); } FSTFieldValue *data = FSTTestFieldValue(value); if ([data isEqual:[FSTDoubleValue nanValue]]) { - FSTCAssert(op == FSTRelationFilterOperatorEqual, @"Must use == with NAN."); + HARD_ASSERT(op == FSTRelationFilterOperatorEqual, "Must use == with NAN."); return [[FSTNanFilter alloc] initWithField:path]; } else if ([data isEqual:[FSTNullValue nullValue]]) { - FSTCAssert(op == FSTRelationFilterOperatorEqual, @"Must use == with Null."); + HARD_ASSERT(op == FSTRelationFilterOperatorEqual, "Must use == with Null."); return [[FSTNullFilter alloc] initWithField:path]; } else { return [FSTRelationFilter filterWithField:path filterOperator:op value:data]; @@ -218,7 +217,7 @@ FSTSortOrder *FSTTestOrderBy(const absl::string_view field, NSString *direction) } else if ([direction isEqualToString:@"desc"]) { ascending = NO; } else { - FSTCFail(@"Unsupported direction: %@", direction); + HARD_FAIL("Unsupported direction: %s", direction); } return [FSTSortOrder sortOrderWithFieldPath:path ascending:ascending]; } @@ -272,8 +271,8 @@ FSTTransformMutation *FSTTestTransformMutation(NSString *path, NSDictionary<NSSt FSTDocumentKey *key = [FSTDocumentKey keyWithPath:testutil::Resource(util::MakeStringView(path))]; FSTUserDataConverter *converter = FSTTestUserDataConverter(); FSTParsedUpdateData *result = [converter parsedUpdateData:data]; - FSTCAssert(result.data.value.count == 0, - @"FSTTestTransformMutation() only expects transforms; no other data"); + HARD_ASSERT(result.data.value.count == 0, + "FSTTestTransformMutation() only expects transforms; no other data"); return [[FSTTransformMutation alloc] initWithKey:key fieldTransforms:std::move(result.fieldTransforms)]; } |