@@ -13,13 +13,15 @@ * file. */ #include "config.h" -#import "TestsAppDelegate.h" +#import "ObjFW.h" +#import "ObjFWTest.h" -static OFString *const module = @"OFThread"; +@interface OFThreadTests: OTTestCase +@end @interface TestThread: OFThread @end @implementation TestThread @@ -31,23 +33,16 @@ return @"success"; } @end -@implementation TestsAppDelegate (OFThreadTests) -- (void)threadTests -{ - void *pool = objc_autoreleasePoolPush(); - TestThread *thread; - - TEST(@"+[thread]", (thread = [TestThread thread])) - - TEST(@"-[start]", R([thread start])) - - TEST(@"-[join]", [[thread join] isEqual: @"success"]) - - TEST(@"-[threadDictionary]", - [[OFThread threadDictionary] objectForKey: @"foo"] == nil) - - objc_autoreleasePoolPop(pool); +@implementation OFThreadTests +- (void)testThread +{ + TestThread *thread = [TestThread thread]; + + [thread start]; + + OTAssertEqualObjects([thread join], @"success"); + OTAssertNil([[OFThread threadDictionary] objectForKey: @"foo"]); } @end