访问XCTestCase类中的app委托对象会导致misaligned_stack_error_ swift

时间:2014-08-12 04:50:17

标签: ios core-data swift appdelegate xctest

我正在尝试在swift中执行单元测试。

我定义了我的测试用例类:

import XCTest
import CoreData
import UIKit

class LazyLoadingCheckTests: XCTestCase {

    var appDelegate : AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate

    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }

    func testExample() {
        // This is an example of a functional test case.
        XCTAssert(true, "Pass")
    }
}

每当我尝试执行测试用例时,断点就会自动停在以下行:

enter image description here

它显示在堆栈跟踪下面:

enter image description here

当我尝试继续时,它会显示:

enter image description here

任何线索?

0 个答案:

没有答案