我正在尝试将 OCMock 添加到我的 iOS 4 项目中。为了测试它,我有一个Person
带有一种方法的类,-hello
. 当我运行这个测试时:
- (void) testMock {
id mock = [OCMockObject mockForClass:[Person class]];
[[mock expect] hello];
[mock hello];
[mock verify];
}
一切都很好,构建成功。如果我hello
接听电话,如下所示:
- (void) testMock {
id mock = [OCMockObject mockForClass:[Person class]];
[[mock expect] hello];
[mock verify];
}
我希望收到一条错误消息,告诉我在模拟上没有调用我的预期方法。相反,我收到一条关于测试台崩溃的神秘消息:
/Developer/Tools/RunPlatformUnitTests.include:451:0 Test rig '/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/Developer/usr/bin/otest' exited abnormally with code 134 (it may have crashed).
当未调用预期方法时,这种崩溃是否正常?我的配置不好?