fix crash
This commit is contained in:
parent
1b08411ed4
commit
f0b4f077d4
@ -37,10 +37,11 @@
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
@ -62,15 +63,18 @@
|
||||
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
@ -85,10 +89,10 @@
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
import XCTest
|
||||
|
||||
class AbstractSocketTest: XCTestCase {
|
||||
static let TEST_TIMEOUT = 4.0
|
||||
static let TEST_TIMEOUT = 8.0
|
||||
var socket:SocketIOClient!
|
||||
var testKind:TestKind?
|
||||
|
||||
@ -25,7 +25,7 @@ class AbstractSocketTest: XCTestCase {
|
||||
}
|
||||
socket.connect()
|
||||
XCTAssertTrue(socket.connecting)
|
||||
waitForExpectationsWithTimeout(5, handler: nil)
|
||||
waitForExpectationsWithTimeout(AbstractSocketTest.TEST_TIMEOUT, handler: nil)
|
||||
}
|
||||
|
||||
func generateTestName(rawTestName:String) ->String {
|
||||
@ -42,11 +42,13 @@ class AbstractSocketTest: XCTestCase {
|
||||
|
||||
func socketMultipleEmit(testName:String, emitData:Array<AnyObject>, callback:NormalCallback){
|
||||
let finalTestname = generateTestName(testName)
|
||||
let expection = self.expectationWithDescription(finalTestname)
|
||||
weak var expection = self.expectationWithDescription(finalTestname)
|
||||
func didGetEmit(result:NSArray?, ack:AckEmitter?) {
|
||||
callback(result, ack)
|
||||
if let expection = expection {
|
||||
expection.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
socket.emit(finalTestname, withItems: emitData)
|
||||
socket.on(finalTestname + "Return", callback: didGetEmit)
|
||||
@ -56,12 +58,15 @@ class AbstractSocketTest: XCTestCase {
|
||||
|
||||
func socketEmit(testName:String, emitData:AnyObject?, callback:NormalCallback){
|
||||
let finalTestname = generateTestName(testName)
|
||||
let expection = self.expectationWithDescription(finalTestname)
|
||||
weak var expection = self.expectationWithDescription(finalTestname)
|
||||
func didGetEmit(result:NSArray?, ack:AckEmitter?) {
|
||||
callback(result, ack)
|
||||
if let expection = expection {
|
||||
expection.fulfill()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
socket.on(finalTestname + "Return", callback: didGetEmit)
|
||||
if let emitData = emitData {
|
||||
socket.emit(finalTestname, emitData)
|
||||
@ -74,11 +79,13 @@ class AbstractSocketTest: XCTestCase {
|
||||
|
||||
func socketAcknwoledgeMultiple(testName:String, Data:Array<AnyObject>, callback:NormalCallback){
|
||||
let finalTestname = generateTestName(testName)
|
||||
let expection = self.expectationWithDescription(finalTestname)
|
||||
weak var expection = self.expectationWithDescription(finalTestname)
|
||||
func didGetResult(result:NSArray?) {
|
||||
callback(result, nil)
|
||||
if let expection = expection {
|
||||
expection.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
socket.emitWithAck(finalTestname, withItems: Data)(timeoutAfter: 5, callback: didGetResult)
|
||||
waitForExpectationsWithTimeout(SocketEmitTest.TEST_TIMEOUT, handler: nil)
|
||||
@ -86,11 +93,13 @@ class AbstractSocketTest: XCTestCase {
|
||||
|
||||
func socketAcknwoledge(testName:String, Data:AnyObject?, callback:NormalCallback){
|
||||
let finalTestname = generateTestName(testName)
|
||||
let expection = self.expectationWithDescription(finalTestname)
|
||||
weak var expection = self.expectationWithDescription(finalTestname)
|
||||
func didGet(result:NSArray?) {
|
||||
callback(result, nil)
|
||||
if let expection = expection {
|
||||
expection.fulfill()
|
||||
}
|
||||
}
|
||||
var ack:OnAckCallback!
|
||||
if let Data = Data {
|
||||
ack = socket.emitWithAck(finalTestname, Data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user