Unit Tests Failure At Xcode 3.2.4, iOS 4.1 SDK Using Hamcrest Assertion

0

We upgraded to Xcode 3.2.4 with iOS 4.1 SDK, now our tests are failing.

First because of this An internal error occurred when handling command output: -[XCBuildLogCommandInvocationSectionRecorder endMarker]: unrecognized selector sent to instance 0x201aa7200 then we used the patch suggested by apple forums (http://gist.github.com/586296) and now the test fail on the first Hamcrest assertion.

NSNumber * c1 = ...
NSNumber * c2 = ...
assertThat(c1, is(c2))

Here's the log:

-[NSCFNumber conformsToProtocol:]: unrecognized selector sent to instance 0x2116890
2010-09-30 22:10:23.153 otest[21063:903] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFNumber conformsToProtocol:]: unrecognized selector sent to instance 0x2116890'
*** Call stack at first throw:
(
 0   CoreFoundation                      0x004e3b99 __exceptionPreprocess + 185
 1   libobjc.A.dylib                     0x002d840e objc_exception_throw + 47
 2   CoreFoundation                      0x004e56ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
 3   CoreFoundation                      0x004552b6 ___forwarding___ + 966
 4   CoreFoundation                      0x00454e72 _CF_forwarding_prep_0 + 50
 5   OCHamcrest                          0x00ccd17b HC_wrapInMatcher + 52
 6   OCHamcrest                          0x00ccb4e1 HC_is + 41
 7   UnitTests                           0x030870c9 -[MyTest testMethod] + 141
 8   CoreFoundation                      0x004545cd __invoking___ + 29
 9   CoreFoundation                      0x004544a1 -[NSInvocation invoke] + 145
 10  SenTestingKit                       0x2010464a -[SenTestCase invokeTest] + 69
 11  SenTestingKit                       0x20104d1f -[SenTestCase performTest:] + 192
 12  SenTestingKit                       0x2010444b -[SenTest run] + 88
 13  SenTestingKit                       0x20106fa7 -[SenTestSuite performTest:] + 115
 14  SenTestingKit                       0x2010444b -[SenTest run] + 88
 15  SenTestingKit                       0x20106fa7 -[SenTestSuite performTest:] + 115
 16  SenTestingKit                       0x2010444b -[SenTest run] + 88
 17  SenTestingKit                       0x20106871 +[SenTestProbe runTests:] + 174
 18  otest                               0x000023b3 0x0 + 9139
 19  otest                               0x000025de 0x0 + 9694
 20  otest                               0x00002086 0x0 + 8326
 21  otest                               0x00002035 0x0 + 8245
 22  ???                                 0x00000003 0x0 + 3
)
terminate called after throwing an instance of 'NSException'
/Developer/Xcode3.2.4/Tools/RunPlatformUnitTests.include: line 415: 21063 Abort trap              "${THIN_TEST_RIG}" "${OTHER_TEST_FLAGS}" "${TEST_BUNDLE_PATH}"
/Developer/Xcode3.2.4/Tools/RunPlatformUnitTests.include:451: error: Test rig '/Developer/Xcode3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/Developer/usr/bin/otest' exited abnormally with code 134 (it may have crashed).

Any one see that before? it was working perfectly on 3.1.3 SDK.

iphone
xcode
hamcrest
asked on Stack Overflow Sep 30, 2010 by Noura

1 Answer

1

This is fixed, by using the latest OCHamcrest as a static library instead of a framework and add -lstdc++ to other linker flags.

Hope that save someone time.

answered on Stack Overflow Oct 7, 2010 by Noura

User contributions licensed under CC BY-SA 3.0