mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 00:47:28 +01:00
Add "do ... while(0)" around CHECK_ETC test macros
This commit is contained in:
1 parent
4323a16707
commit
eeae6098b6
1 file changed
+4
-4
@@ -66,20 +66,20 @@ char fail_msg[65536] = {0};
|
|||||||
msg += snprintf(msg, sizeof(fail_msg) - (msg - fail_msg), ##__VA_ARGS__)
|
msg += snprintf(msg, sizeof(fail_msg) - (msg - fail_msg), ##__VA_ARGS__)
|
||||||
|
|
||||||
#define CHECK_STATUS(prefix, status) \
|
#define CHECK_STATUS(prefix, status) \
|
||||||
{ \
|
do { \
|
||||||
wuffs_base__status z = status; \
|
wuffs_base__status z = status; \
|
||||||
if (z.repr) { \
|
if (z.repr) { \
|
||||||
RETURN_FAIL("%s: \"%s\"", prefix, z.repr); \
|
RETURN_FAIL("%s: \"%s\"", prefix, z.repr); \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define CHECK_STRING(string) \
|
#define CHECK_STRING(string) \
|
||||||
{ \
|
do { \
|
||||||
const char* z = string; \
|
const char* z = string; \
|
||||||
if (z) { \
|
if (z) { \
|
||||||
return z; \
|
return z; \
|
||||||
} \
|
} \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
int tests_run = 0;
|
int tests_run = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user