tags:

views:

125

answers:

1

I'm trying to add OCMock to my iOS 4 project. To test it out, I have a class Person with one method, -hello. When I run this test:

- (void) testMock {
    id mock = [OCMockObject mockForClass:[Person class]];
    [[mock expect] hello];

    [mock hello];

    [mock verify];
}

Everything is fine, and the build succeeds. If I take away the hello call, like this:

- (void) testMock {
    id mock = [OCMockObject mockForClass:[Person class]];
    [[mock expect] hello];

    [mock verify];
}

I'd expect to get an error message telling me that my expected method wasn't called on the mock. Instead I get a cryptic message about the test rig crashing:

/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).

Is this crash normal when an expected method isn't called? Do I have a bad configuration?

A: 

I'd say it's a bug. Verify should report a useable result, even if it fails.

Did you ever resolve this? I'm running into the same thing currently.

BIT-101