Index: tests/OFKernelEventObserverTests.m ================================================================== --- tests/OFKernelEventObserverTests.m +++ tests/OFKernelEventObserverTests.m @@ -46,10 +46,11 @@ @public TestsAppDelegate *_testsAppDelegate; OFKernelEventObserver *_observer; OFTCPSocket *_server, *_client, *_accepted; size_t _events; + int _fails; } - (void)run; @end @@ -111,23 +112,27 @@ if (!deadlineExceeded) [_testsAppDelegate outputSuccess: @"-[observe] not exceeding deadline" inModule: module]; - else + else { [_testsAppDelegate outputFailure: @"-[observe] not exceeding deadline" inModule: module]; + _fails++; + } if (_events == EXPECTED_EVENTS) [_testsAppDelegate outputSuccess: @"-[observe] handling all events" inModule: module]; - else + else { [_testsAppDelegate outputFailure: @"-[observe] handling all events" inModule: module]; + _fails++; + } } - (void)objectIsReadyForReading: (id)object { char buf; @@ -136,14 +141,16 @@ case 0: if (object == _server) [_testsAppDelegate outputSuccess: @"-[observe] with listening socket" inModule: module]; - else + else { [_testsAppDelegate outputFailure: @"-[observe] with listening socket" inModule: module]; + _fails++; + } _accepted = [[object accept] retain]; [_observer addObjectForReading: _accepted]; [_testsAppDelegate @@ -156,14 +163,16 @@ [object readIntoBuffer: &buf length: 1] == 1 && buf == '0') [_testsAppDelegate outputSuccess: @"-[observe] with data ready to read" inModule: module]; - else + else { [_testsAppDelegate outputFailure: @"-[observe] with data ready to read" inModule: module]; + _fails++; + } [_client close]; [_testsAppDelegate outputTesting: @"-[observe] with closed connection" @@ -175,14 +184,16 @@ [object readIntoBuffer: &buf length: 1] == 0) [_testsAppDelegate outputSuccess: @"-[observe] with closed connection" inModule: module]; - else + else { [_testsAppDelegate outputFailure: @"-[observe] with closed connection" inModule: module]; + _fails++; + } break; default: OF_ENSURE(0); } @@ -204,10 +215,11 @@ TEST(@"-[addObjectForReading:]", R([test->_observer addObjectForReading: test->_server])) [test run]; + _fails += test->_fails; } - (void)kernelEventObserverTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];