ObjFW  Diff

Differences From Artifact [df50ba0832]:

To Artifact [c79591610e]:


11
12
13
14
15
16
17
18
19
20



21
22
23
24



25
26
27


28
29
30


31
32
33
34
35
36





37
38
39
40
41
42
43
44
45
46









47
48
49


50
51
52


53
54
55
56
57
58
59
60
61
62
63

64
65

66
67

68
69
70
71
72
73
74
75
11
12
13
14
15
16
17



18
19
20




21
22
23



24
25



26
27
28





29
30
31
32
33










34
35
36
37
38
39
40
41
42



43
44



45
46
47
48
49
50
51
52
53
54
55
56

57


58


59

60
61
62
63
64
65
66







-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
-
-
-
+
+

-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
+
+










-
+
-
-
+
-
-
+
-







 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "ObjFW.h"

#define TEST(test, ...)					\
	{						\
		[self outputTesting: test		\
#define TEST(test, ...)							\
	{								\
		[self outputTesting: test inModule: module];		\
			   inModule: module];		\
							\
		if (__VA_ARGS__)			\
			[self outputSuccess: test	\
									\
		if (__VA_ARGS__)					\
			[self outputSuccess: test inModule: module];	\
				   inModule: module];	\
		else {					\
			[self outputFailure: test	\
		else {							\
			[self outputFailure: test inModule: module];	\
				   inModule: module];	\
			_fails++;			\
		}					\
			_fails++;					\
		}							\
	}
#define EXPECT_EXCEPTION(test, exception, code)		\
	{						\
		bool caught = false;			\
							\
		[self outputTesting: test		\
#define EXPECT_EXCEPTION(test, exception, code)				\
	{								\
		bool caught = false;					\
									\
		[self outputTesting: test inModule: module];		\
			   inModule: module];		\
							\
		@try {					\
			code;				\
		} @catch (exception *e) {		\
			caught = true;			\
		}					\
							\
		if (caught)				\
			[self outputSuccess: test	\
									\
		@try {							\
			code;						\
		} @catch (exception *e) {				\
			caught = true;					\
		}							\
									\
		if (caught)						\
			[self outputSuccess: test inModule: module];	\
				   inModule: module];	\
		else {					\
			[self outputFailure: test	\
		else {							\
			[self outputFailure: test inModule: module];	\
				   inModule: module];	\
			_fails++;			\
		}					\
			_fails++;					\
		}							\
	}
#define R(...) (__VA_ARGS__, 1)

@class OFString;

@interface TestsAppDelegate: OFObject <OFApplicationDelegate>
{
	int _fails;
}

- (void)outputTesting: (OFString *)test
- (void)outputTesting: (OFString *)test inModule: (OFString *)module;
	     inModule: (OFString *)module;
- (void)outputSuccess: (OFString *)test
- (void)outputSuccess: (OFString *)test inModule: (OFString *)module;
	     inModule: (OFString *)module;
- (void)outputFailure: (OFString *)test
- (void)outputFailure: (OFString *)test inModule: (OFString *)module;
	     inModule: (OFString *)module;
@end

@interface TestsAppDelegate (OFASN1DERParsingTests)
- (void)ASN1DERParsingTests;
@end

@interface TestsAppDelegate (OFASN1DERRepresentationTests)