Test rig exited abnormally with code 134 with OCMock verify on iOS 4

前端 未结 4 748
梦如初夏
梦如初夏 2021-01-03 08:52

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:



        
4条回答
  •  醉酒成梦
    2021-01-03 08:57

    I have found that this bug is still around with Xcode 4/SDK 4.3 in April of 2011. For example, Test A passes, Test B crashes the test rig.

    Test A:

    - (void)testAcceptsAndVerifiesExpectedMethods
    {
    
        id mock = [OCMockObject mockForClass:[NSString class]];
    
        [[mock expect] lowercaseString];
        [mock lowercaseString];
    
        [mock verify];
    }
    

    Test B:

    - (void)testAcceptsAndVerifiesExpectedMethods
    {
    
        id mock = [OCMockObject mockForClass:[NSString class]];
    
        [[mock expect] lowercaseString];
        //[mock lowercaseString];
    
        [mock verify];
    }
    

提交回复
热议问题