@@ -13,45 +13,39 @@ * file. */ #import "ObjFW.h" -#define TEST(test, ...) \ - { \ - [self outputTesting: test \ - inModule: module]; \ - \ - if (__VA_ARGS__) \ - [self outputSuccess: test \ - inModule: module]; \ - else { \ - [self outputFailure: test \ - inModule: module]; \ - _fails++; \ - } \ - } -#define EXPECT_EXCEPTION(test, exception, code) \ - { \ - bool caught = false; \ - \ - [self outputTesting: test \ - inModule: module]; \ - \ - @try { \ - code; \ - } @catch (exception *e) { \ - caught = true; \ - } \ - \ - if (caught) \ - [self outputSuccess: test \ - inModule: module]; \ - else { \ - [self outputFailure: test \ - inModule: module]; \ - _fails++; \ - } \ +#define TEST(test, ...) \ + { \ + [self outputTesting: test inModule: module]; \ + \ + if (__VA_ARGS__) \ + [self outputSuccess: test inModule: module]; \ + else { \ + [self outputFailure: test inModule: module]; \ + _fails++; \ + } \ + } +#define EXPECT_EXCEPTION(test, exception, code) \ + { \ + bool caught = false; \ + \ + [self outputTesting: test inModule: module]; \ + \ + @try { \ + code; \ + } @catch (exception *e) { \ + caught = true; \ + } \ + \ + if (caught) \ + [self outputSuccess: test inModule: module]; \ + else { \ + [self outputFailure: test inModule: module]; \ + _fails++; \ + } \ } #define R(...) (__VA_ARGS__, 1) @class OFString; @@ -58,24 +52,13 @@ @interface TestsAppDelegate: OFObject { int _fails; } -- (void)outputTesting: (OFString *)test - inModule: (OFString *)module; -- (void)outputSuccess: (OFString *)test - inModule: (OFString *)module; -- (void)outputFailure: (OFString *)test - inModule: (OFString *)module; -@end - -@interface TestsAppDelegate (OFASN1DERParsingTests) -- (void)ASN1DERParsingTests; -@end - -@interface TestsAppDelegate (OFASN1DERRepresentationTests) -- (void)ASN1DERRepresentationTests; +- (void)outputTesting: (OFString *)test inModule: (OFString *)module; +- (void)outputSuccess: (OFString *)test inModule: (OFString *)module; +- (void)outputFailure: (OFString *)test inModule: (OFString *)module; @end @interface TestsAppDelegate (OFArrayTests) - (void)arrayTests; @end @@ -161,10 +144,14 @@ @end @interface TestsAppDelegate (OFObjectTests) - (void)objectTests; @end + +@interface TestsAppDelegate (OFPBKDF2Tests) +- (void)PBKDF2Tests; +@end @interface TestsAppDelegate (OFPropertyListTests) - (void)propertyListTests; @end @@ -182,11 +169,11 @@ @interface TestsAppDelegate (OFRIPEMD160HashTests) - (void)RIPEMD160HashTests; @end -@interface TestsAppDelegate (ScryptTests) +@interface TestsAppDelegate (OFScryptTests) - (void)scryptTests; @end @interface TestsAppDelegate (OFSHA1HashTests) - (void)SHA1HashTests; @@ -206,14 +193,10 @@ @interface TestsAppDelegate (OFSHA512HashTests) - (void)SHA512HashTests; @end -@interface TestsAppDelegate (OFSCTPSocketTests) -- (void)SCTPSocketTests; -@end - @interface TestsAppDelegate (OFSPXSocketTests) - (void)SPXSocketTests; @end @interface TestsAppDelegate (OFSPXStreamSocketTests) @@ -233,10 +216,14 @@ @end @interface TestsAppDelegate (OFHMACTests) - (void)HMACTests; @end + +@interface TestsAppDelegate (OFSocketTests) +- (void)socketTests; +@end @interface TestsAppDelegate (OFStreamTests) - (void)streamTests; @end @@ -278,13 +265,5 @@ @interface TestsAppDelegate (OFXMLParserTests) - (void)XMLParserTests; @end - -@interface TestsAppDelegate (PBKDF2Tests) -- (void)PBKDF2Tests; -@end - -@interface TestsAppDelegate (SocketTests) -- (void)socketTests; -@end