Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Fix reachability tests #3694

Merged
merged 5 commits into from
Oct 12, 2016
Merged

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Sep 22, 2016

Hopefully these changes will fix the domain reachability tests.

@codecov-io
Copy link

codecov-io commented Sep 23, 2016

Current coverage is 87.46% (diff: 100%)

Merging #3694 into master will decrease coverage by 0.02%

@@             master      #3694   diff @@
==========================================
  Files            45         45          
  Lines          6235       6229     -6   
  Methods        1101       1104     +3   
  Messages          0          0          
  Branches        415        416     +1   
==========================================
- Hits           5455       5448     -7   
- Misses          777        778     +1   
  Partials          3          3          

Powered by Codecov. Last update 9627d0f...fb5022c

@0xced 0xced force-pushed the fix-reachability-tests branch from fe5233f to d2becfd Compare September 23, 2016 13:08
@kcharwood kcharwood added this to the 3.2.0 milestone Oct 3, 2016
@kcharwood
Copy link
Contributor

Now that we have passing tests, I'm not sure we need this. Thoughts?

@0xced 0xced force-pushed the fix-reachability-tests branch from d2becfd to 7879b51 Compare October 5, 2016 18:30
0xced added 5 commits October 12, 2016 07:39
This pattern does not make sense at all because the assert can never fail.

if (condition) {
    XCTAssert(condition, @"comment");
}
Do not use XCTAssertEqual(reachable, ...) because it might transition to AFNetworkReachabilityStatusNotReachable before becoming reachable.
The status passed in callbacks (both block and notification) is captured before the callbacks are dispatched on the main thread. It is thus possible that the reachabilityManager status change in the meantime.

Users MUST use the status parameter for the block callback or the `AFNetworkingReachabilityNotificationStatusItem` user info key for the notification.
@0xced 0xced force-pushed the fix-reachability-tests branch from 7879b51 to fb5022c Compare October 12, 2016 06:13
@kcharwood kcharwood removed this from the 3.2.0 milestone Oct 12, 2016
@kcharwood kcharwood merged commit 5b6def1 into AFNetworking:master Oct 12, 2016
@0xced 0xced deleted the fix-reachability-tests branch October 12, 2016 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants