From 7705732e864fa5ae39d7e538e43b5e71c1ab34d4 Mon Sep 17 00:00:00 2001 From: Ricardo Pereira Date: Fri, 20 Nov 2015 07:21:20 +0000 Subject: [PATCH] Fixed: TimeForwards and TimeBackwards --- ably-iosTests/ARTRealtimeChannelHistoryTest.m | 7 +++---- ably-iosTests/ARTRestChannelHistoryTest.m | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ably-iosTests/ARTRealtimeChannelHistoryTest.m b/ably-iosTests/ARTRealtimeChannelHistoryTest.m index d62cd9f9f..01921c00a 100644 --- a/ably-iosTests/ARTRealtimeChannelHistoryTest.m +++ b/ably-iosTests/ARTRealtimeChannelHistoryTest.m @@ -310,8 +310,8 @@ -(void) testTimeBackwards { long long serverNow= [time timeIntervalSince1970]*1000; long long appNow =[ARTTestUtil nowMilli]; timeOffset = serverNow - appNow; + [e fulfill]; }]; - [e fulfill]; }]; [self waitForExpectationsWithTimeout:[ARTTestUtil timeout] handler:nil]; @@ -389,10 +389,9 @@ -(void) testTimeForwards { XCTAssert(!error); long long serverNow= [time timeIntervalSince1970]*1000; long long appNow =[ARTTestUtil nowMilli]; - timeOffset = serverNow - appNow; - + timeOffset = serverNow - appNow; + [e fulfill]; }]; - [e fulfill]; }]; diff --git a/ably-iosTests/ARTRestChannelHistoryTest.m b/ably-iosTests/ARTRestChannelHistoryTest.m index 4f84af1d8..13ccb6004 100644 --- a/ably-iosTests/ARTRestChannelHistoryTest.m +++ b/ably-iosTests/ARTRestChannelHistoryTest.m @@ -48,8 +48,8 @@ -(void) testTimeBackwards { long long serverNow = [time timeIntervalSince1970]*1000; long long appNow =[ARTTestUtil nowMilli]; timeOffset = serverNow - appNow; + [e fulfill]; }]; - [e fulfill]; }]; @@ -127,12 +127,12 @@ -(void) testTimeForwards [ARTTestUtil testRest:^(ARTRest *rest) { _rest = rest; [rest time:^(NSDate *time, NSError *error) { - XCTAssert(!error); - long long serverNow = [time timeIntervalSince1970]*1000; - long long appNow =[ARTTestUtil nowMilli]; - timeOffset = serverNow - appNow; + XCTAssert(!error); + long long serverNow = [time timeIntervalSince1970]*1000; + long long appNow =[ARTTestUtil nowMilli]; + timeOffset = serverNow - appNow; + [e fulfill]; }]; - [e fulfill]; }]; [self waitForExpectationsWithTimeout:[ARTTestUtil timeout] handler:nil];