ObjFW  Check-in [4b635088b6]

Overview
Comment:Merge trunk into branch "objfwtest"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | objfwtest
Files: files | file ages | folders
SHA3-256: 4b635088b6be1934321b14ccc2b1215a100856c89ec0843b0a6f3bc1f6ff6df1
User & Date: js on 2024-02-11 12:06:50
Other Links: branch diff | manifest | tags
Context
2024-02-11
12:17
OFPropertyListTests: Use OTAssertThrowsSpecific check-in: 3b440aa16a user: js tags: objfwtest
12:06
Merge trunk into branch "objfwtest" check-in: 4b635088b6 user: js tags: objfwtest
12:06
ObjFWTest: Add OTAssertThrows(Specific) check-in: 9b42860950 user: js tags: trunk
09:33
Fix linking tests for Wii U check-in: 7c33f33d80 user: js tags: objfwtest
Changes

Modified src/test/OTAssert.h from [42d7fc43e9] to [4079f8ef1f].

25
26
27
28
29
30
31






















32
33
34
35
36
37
38
39
40
#define OTAssertTrue(cond, ...) OTAssert(cond == true, ## __VA_ARGS__)
#define OTAssertFalse(cond, ...) OTAssert(cond == false, ## __VA_ARGS__)
#define OTAssertEqual(a, b, ...) OTAssert(a == b, ## __VA_ARGS__)
#define OTAssertNotEqual(a, b, ...) OTAssert(a != b, ## __VA_ARGS__)
#define OTAssertEqualObjects(a, b, ...) OTAssert([a isEqual: b], ## __VA_ARGS__)
#define OTAssertNotEqualObjects(a, b, ...) \
	OTAssert(![a isEqual: b], ## __VA_ARGS__)























#ifdef __cplusplus
extern "C" {
#endif
extern void OTAssertImpl(id testCase, SEL test, bool condition, OFString *check,
    OFString *file, size_t line, ...);
#ifdef __cplusplus
}
#endif







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









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
#define OTAssertTrue(cond, ...) OTAssert(cond == true, ## __VA_ARGS__)
#define OTAssertFalse(cond, ...) OTAssert(cond == false, ## __VA_ARGS__)
#define OTAssertEqual(a, b, ...) OTAssert(a == b, ## __VA_ARGS__)
#define OTAssertNotEqual(a, b, ...) OTAssert(a != b, ## __VA_ARGS__)
#define OTAssertEqualObjects(a, b, ...) OTAssert([a isEqual: b], ## __VA_ARGS__)
#define OTAssertNotEqualObjects(a, b, ...) \
	OTAssert(![a isEqual: b], ## __VA_ARGS__)
#define OTAssertNil(object, ...) OTAssert(object == nil, ## __VA_ARGS__)
#define OTAssertNotNil(object, ...) OTAssert(object != nil, ## __VA_ARGS__)
#define OTAssertThrows(expression, ...)				\
	{							\
		bool OTThrown = false;				\
		@try {						\
			expression;				\
		} @catch (id e) {				\
			OTThrown = true;			\
		}						\
		OTAssert(OTThrown, ## __VA_ARGS__);		\
	}
#define OTAssertThrowsSpecific(expression, exception, ...)	\
	{							\
		bool OTThrown = false;				\
		@try {						\
			expression;				\
		} @catch (exception *e) {			\
			OTThrown = true;			\
		}						\
		OTAssert(OTThrown, ## __VA_ARGS__);		\
	}

#ifdef __cplusplus
extern "C" {
#endif
extern void OTAssertImpl(id testCase, SEL test, bool condition, OFString *check,
    OFString *file, size_t line, ...);
#ifdef __cplusplus
}
#endif