From 12faf205f34042aa7fb6ff13c6980556dbb1ba39 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 12 Feb 2018 19:11:45 -0800 Subject: Cleaning up implicit retain for the RTDB and Storage --- Example/Database/Tests/Integration/FData.m | 6 +++++- Example/Database/Tests/Integration/FRealtime.m | 1 + Example/Database/Tests/Unit/FSyncPointTests.m | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'Example/Database') diff --git a/Example/Database/Tests/Integration/FData.m b/Example/Database/Tests/Integration/FData.m index aef15e1..d036f77 100644 --- a/Example/Database/Tests/Integration/FData.m +++ b/Example/Database/Tests/Integration/FData.m @@ -487,7 +487,7 @@ [[ref child:@"100003354884401"] setValue:@"alpha"]; __block BOOL ready = NO; - [ref observeEventType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot *snapshot) { + [ref observeSingleEventOfType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot *snapshot) { id val = [snapshot value]; XCTAssertTrue([val isKindOfClass:[NSDictionary class]], @"Expected a dictionary."); ready = YES; @@ -678,6 +678,8 @@ [self waitUntil:^BOOL{ return setDone && calls == 1; }]; + + [node removeAllObservers]; } - (void) testHasChildrenWorksCorrectly { @@ -878,6 +880,7 @@ [self waitUntil:^BOOL{ return calls == 1; }]; + [reader removeAllObservers]; } - (void) testSetPriorityOnNonexistentNodeFails { @@ -2208,6 +2211,7 @@ }]; WAIT_FOR(done); + [deleter removeAllObservers]; } - (void) testParentDeleteShadowsChildListenersWithNonDefaultQuery { diff --git a/Example/Database/Tests/Integration/FRealtime.m b/Example/Database/Tests/Integration/FRealtime.m index 5c7d186..5acda07 100644 --- a/Example/Database/Tests/Integration/FRealtime.m +++ b/Example/Database/Tests/Integration/FRealtime.m @@ -481,6 +481,7 @@ WAIT_FOR(count == 2); // cleanup + [reader removeAllObservers]; [FRepoManager disposeRepos:writerCfg]; } diff --git a/Example/Database/Tests/Unit/FSyncPointTests.m b/Example/Database/Tests/Unit/FSyncPointTests.m index 797a5aa..de4680f 100644 --- a/Example/Database/Tests/Unit/FSyncPointTests.m +++ b/Example/Database/Tests/Unit/FSyncPointTests.m @@ -86,15 +86,15 @@ typedef NSDictionary* (^fbt_nsdictionary_void)(void); } - (void) fireEvent:(id)event queue:(dispatch_queue_t)queue { - [NSException raise:@"NotImplementedError" format:@"Method not implemneted."]; + [NSException raise:@"NotImplementedError" format:@"Method not implemented."]; } - (FCancelEvent *) createCancelEventFromError:(NSError *)error path:(FPath *)path { - [NSException raise:@"NotImplementedError" format:@"Method not implemneted."]; + [NSException raise:@"NotImplementedError" format:@"Method not implemented."]; return nil; } - (FIRDatabaseHandle) handle { - [NSException raise:@"NotImplementedError" format:@"Method not implemneted."]; + [NSException raise:@"NotImplementedError" format:@"Method not implemented."]; return 0; } @end -- cgit v1.2.3