Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite #609

Merged
merged 3 commits into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Ably.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
3721DD0426946FEE30506043 /* [CP] Embed Pods Frameworks */ = {
Expand Down Expand Up @@ -1086,7 +1086,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
960F84BD638CCB7D20786C8C /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -1101,7 +1101,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
A08ED191533D7C05CF3B1358 /* [CP] Embed Pods Frameworks */ = {
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 160cf53ef13d4ed09e5e81c2f2840457b07e012a

COCOAPODS: 1.2.0
COCOAPODS: 1.2.1
3 changes: 3 additions & 0 deletions Source/ARTRest.m
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ BOOL ARTstartHandlingUncaughtExceptions(ARTRest *self) {
}

void ARTstopHandlingUncaughtExceptions(ARTRest *self) {
if (!self) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self should never be null here. When is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcard Sorry, I can't recall when it was null but it wasn't in a normal state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcard Another thing. I was facing a deadlock as well. I spent some time at my lunch time to figure it out but the time wasn't enough. I will open a new PR.

return;
}
self->_handlingUncaughtExceptions = false;
[ARTSentry setUserInfo:@"reportToAbly" value:[NSNumber numberWithBool:false]];
}
Expand Down
11 changes: 3 additions & 8 deletions Spec/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1446,16 +1446,11 @@ class Auth : QuickSpec {
let rest = ARTRest(options: AblyTests.commonAppSetup())

var createTokenRequestMethodWasCalled = false

let block: @convention(block) (AspectInfo, tokenParams: ARTTokenParams?) -> Void = { _, _ in
// Adds a block of code after `createTokenRequest` is triggered
let token = rest.auth.testSuite_injectIntoMethodAfter(NSSelectorFromString("_createTokenRequest:options:callback:")) {
createTokenRequestMethodWasCalled = true
}

let hook = ARTAuth.aspect_hookSelector(rest.auth)
// Adds a block of code after `createTokenRequest` is triggered
let token = try? hook(#selector(ARTAuth.createTokenRequest(_:options:callback:)), withOptions: .PositionAfter, usingBlock: unsafeBitCast(block, ARTAuth.self))

expect(token).toNot(beNil())
defer { token.remove() }

waitUntil(timeout: testTimeout) { done in
rest.auth.requestToken(nil, withOptions: nil, callback: { tokenDetails, error in
Expand Down