@@ -13,30 +13,25 @@ * file. */ #include "config.h" -#import "OFColor.h" -#import "OFStdIOStream.h" #import "OFString.h" #import "OTAssertionFailedException.h" void OTAssertImpl(id testCase, SEL test, bool condition, OFString *check, OFString *file, size_t line, ...) { - void *pool; va_list arguments; OFConstantString *format; OFString *message = nil; if (condition) return; - pool = objc_autoreleasePoolPush(); - va_start(arguments, line); format = va_arg(arguments, OFConstantString *); if (format != nil) message = [[[OFString alloc] @@ -43,16 +38,8 @@ initWithFormat: format arguments: arguments] autorelease]; va_end(arguments); - [OFStdErr setForegroundColor: [OFColor red]]; - [OFStdErr writeFormat: @"-[%@ %s]: Condition failed: %@%@%@\n", - [testCase className], sel_getName(test), - check, (message != nil ? @": " : @""), - (message != nil ? message : @"")]; - [OFStdErr reset]; - - objc_autoreleasePoolPop(pool); - - @throw [OTAssertionFailedException exception]; + @throw [OTAssertionFailedException exceptionWithCondition: check + message: message]; }