ObjFW  Diff

Differences From Artifact [1a59e2e7e2]:

To Artifact [e49868a57b]:


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
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







+









+
+







-
+
+
+
+

extern void testing(OFString*, OFString*);
extern void success(OFString*, OFString*);
extern void failed(OFString*, OFString*);

#define TEST(test, cond)			\
	{					\
		testing(module, test);		\
						\
		if (cond)			\
			success(module, test);	\
		else				\
			failed(module, test);	\
	}
#define EXPECT_EXCEPTION(test, exception, code)	\
	{					\
		BOOL caught = NO;		\
						\
		testing(module, test);		\
						\
		@try {				\
			code;			\
		} @catch (exception *e) {	\
			caught = YES;		\
			[e dealloc];		\
		}				\
						\
		TEST(test, caught)		\
		if (caught)			\
			success(module, test);	\
		else				\
			failed(module, test);	\
	}