iosobjective-csentestingkit

SenTestCase isn't failing when an exception is thrown


I have the following test:

Header:

#import <SenTestingKit/SenTestingKit.h>

@interface MyTest : SenTestCase
- (void)testFoo;
@end

Implementation:

@implementation MyTest

- (void)testFoo {
    NSString* foo = nil;
    NSDictionary* bar = @{@"bar": foo};

    STFail(@"this is not failing");
}

@end

When I run testFoo, the test shows as being successful, even though it's actually crashing. (NSDictionary throws an exception because I'm trying to insert a nil value.)

If I enclose the NSDictionary line in a @try / @catch block, then the test fails as expected.

Anyone knows what to do?

(Using Xcode 5)


Solution

  • Never mind, this is a known issue from SenTestingKitAsync, not SenTestingKit:

    https://github.com/nxtbgthng/SenTestingKitAsync/issues/5