Index: tests/OFDictionary/OFDictionary.m ================================================================== --- tests/OFDictionary/OFDictionary.m +++ tests/OFDictionary/OFDictionary.m @@ -9,11 +9,12 @@ * the packaging of this file. */ #import "config.h" -#import +#include +#include #import "OFAutoreleasePool.h" #import "OFDictionary.h" #import "OFConstString.h" #import "OFString.h" @@ -33,10 +34,18 @@ to: value1]; [dict set: key2 to: value2]; [pool release]; - puts([[dict get: @"key1"] cString]); - puts([[dict get: key2] cString]); + if (strcmp([[dict get: @"key1"] cString], "value1")) { + puts("\033[K\033[1;31mTest 1/2 failed!\033[m"); + return 1; + } + + if (strcmp([[dict get: key2] cString], "value2")) { + puts("\033[K\033[1;31mTest 2/2 failed!\033[m"); + return 1; + } + puts("\033[1;32mTests successful: 2/2\033[0m"); return 0; } Index: tests/OFPlugin/OFPlugin.m ================================================================== --- tests/OFPlugin/OFPlugin.m +++ tests/OFPlugin/OFPlugin.m @@ -8,10 +8,12 @@ * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #import "config.h" + +#include #import "OFPlugin.h" #import "TestPlugin/TestPlugin.h" int @@ -18,9 +20,13 @@ main() { TestPlugin *plugin; plugin = [OFPlugin pluginFromFile: "TestPlugin/TestPlugin"]; - [plugin test]; + if ([plugin test: 1234] != 2468) { + puts("\033[K\033[1;31mTest 1/1 failed!\033[m"); + return 1; + } + puts("\033[1;32mTests successful: 1/1\033[0m"); return 0; } Index: tests/OFPlugin/TestPlugin/TestPlugin.h ================================================================== --- tests/OFPlugin/TestPlugin/TestPlugin.h +++ tests/OFPlugin/TestPlugin/TestPlugin.h @@ -10,7 +10,7 @@ */ #import "OFPlugin.h" @interface TestPlugin: OFPlugin -- (void)test; +- (int)test: (int)num; @end Index: tests/OFPlugin/TestPlugin/TestPlugin.m ================================================================== --- tests/OFPlugin/TestPlugin/TestPlugin.m +++ tests/OFPlugin/TestPlugin/TestPlugin.m @@ -7,21 +7,19 @@ * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ -#include - #import "TestPlugin.h" @implementation TestPlugin -- (void)test +- (int)test: (int)num { - puts("Test successfull!"); + return num * 2; } @end id init_plugin() { return [TestPlugin new]; }