Please sign in to comment.
[ios-sdk] Fix unit tests, two other bugs
Summary: Apparently either the Lincoln Memorial moved, our place data changed, or our distance algorithm changed, since our queries that used to work with a 100m radius now require a 200m radius to return the expected results. FBRequestConnection was not properly nil-ing an NSError pointer prior to passing it by reference down the stack. This caused inconsistent behavior in error handling depending on what happened with previous requests. Always upper-case HTTPMethod names before setting them on NSURLRequest, as HTTP standard says they are case-sensitive and FB servers will reject requests with, e.g., lower-case methods. Made FBTestSession shouldExtendAccessToken faker be one-shot rather than always saying "yes", to avoid infinite (until the test session ends) loop if token extension failed. Removed two helpers from FBTests that caused more harm than good because they made it too easy to write tests that didn't wait for blockers, giving nondeterministic results as whether a test succeeded or failed depended on timing patterns. Test Plan: - Ran unit tests, all passed under 4.3, 5.0, 5.1 - Ran Scrumptious, worked correctly Revert Plan: Reviewers: jacl, mmarucheck, gregschechte, ayden Reviewed By: jacl CC: platform-diffs@lists Differential Revision: https://phabricator.fb.com/D495517 Task ID: 1125562, 1125563
- Loading branch information...
Showing with 71 additions and 36 deletions.
- +3 −2 src/FBRequestConnection.m
- +2 −1 src/FBTestSession+Internal.h
- +4 −1 src/FBTestSession.m
- +3 −3 src/tests/FBBatchRequestTests.m
- +2 −2 src/tests/FBCommonRequestTests.m
- +24 −0 src/tests/FBGraphObjectTests.m
- +33 −16 src/tests/FBRequestConnectionTests.m
- +0 −3 src/tests/FBTests.h
- +0 −8 src/tests/FBTests.m