Unit Testing in XCode: Test rig '[...]/usr/bin/otest' exited abnormally with code 134 -
i have got problem when unit testing class. when running test, compiles without errors crashes (it not fail in sense of assertion not being met), displaying following error message:
/developer/tools/runplatformunittests.include:451:0 test rig '/developer/platforms /iphonesimulator.platform/developer/sdks/iphonesimulator4.2.sdk/developer/usr/bin/otest' exited abnormally code 134 (it may have crashed).
here's code:
the class' interface:
@interface abstractactionmodel : nsobject { nsstring* mname; actiontype mtype; // enum float mduration; float mrepeatcount; float mdelay; nsarray* mtriggerareas; }
the implementation:
- (void) dealloc { [mtriggerareas release]; [super dealloc]; } - (id) initwithconfigdata: (nsdictionary*) theconfigdata { nsassert(nil != theconfigdata, @"theconfigdata cannot nil"); self = [super init]; if (self) { self.name = [theconfigdata objectforkey:action_name]; self.type = [[theconfigdata objectforkey:action_type] intvalue]; self.duration = [[theconfigdata objectforkey:action_duration] floatvalue]; self.delay = [[theconfigdata objectforkey:action_delay] floatvalue]; self.repeatcount = [[theconfigdata objectforkey:action_repeat_count] floatvalue]; self.triggerareas = [theconfigdata objectforkey:action_trigger_areas]; } return self; }
here's test code:
- (void) testcreateaction { soundactionmodel* testsoundaction = (soundactionmodel*)[soundactionmodelfactory createactionmodel:self.actionconfig]; stassertnotnil(testsoundaction, @"returned object must not nil"); }
the factory's createactionmodel:
method:
+ (abstractactionmodel*) createactionmodel:(nsdictionary *)config { nsassert(config != nil, @"config must not nil"); soundactionmodel* retval = [[[soundactionmodel alloc] initwithconfigdata:config] autorelease]; return retval; }
as mentioned: code compiles, , runs when testcreateaction
commented out. problem not seem test (i.e. assertion).
telling these postings (similar problem 1, similar problem 2) seems bug in xcode, these links point problems arise when using core data (which don't) or ocmock (which don't, either - @ least not knowingly).
can tell me how solve kind of problem? if turns out bug, workaround appreciated.
i had problem when starting out ocunit. caused attempting execute test setup in logic test mode, rather application test mode. if code under test has dependency on cocoa or cocoa touch, code must run target set application test.
the fact test runner crashes looks xcode bug me appcode continue passed point.
a source setting these tests here
Comments
Post a Comment