ObjFW  Check-in [ef40fca9fd]

Overview
Comment:ObjFWTest: Add OTAssert(Not)Nil
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ef40fca9fdabd14f234a3645e33d13eeb9497e1b37ba306636ef7c91a5086ac9
User & Date: js on 2024-02-11 11:56:41
Other Links: manifest | tags
Context
2024-02-11
12:06
ObjFWTest: Add OTAssertThrows(Specific) check-in: 9b42860950 user: js tags: trunk
11:56
ObjFWTest: Add OTAssert(Not)Nil check-in: ef40fca9fd user: js tags: trunk
2024-02-10
14:16
ObjFWTest: Make sure classes are initialized check-in: f4bb3f5a76 user: js tags: trunk
Changes

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

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
#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__)

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