Squashed 'external/toxcore/c-toxcore/' content from commit 67badf69
git-subtree-dir: external/toxcore/c-toxcore git-subtree-split: 67badf69416a74e74f6d7eb51dd96f37282b8455
This commit is contained in:
32
auto_tests/check_compat.h
Normal file
32
auto_tests/check_compat.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef C_TOXCORE_AUTO_TESTS_CHECK_COMPAT_H
|
||||
#define C_TOXCORE_AUTO_TESTS_CHECK_COMPAT_H
|
||||
|
||||
#include "../toxcore/ccompat.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ck_assert(ok) do { \
|
||||
if (!(ok)) { \
|
||||
fprintf(stderr, "%s:%d: failed `%s'\n", __FILE__, __LINE__, #ok); \
|
||||
abort(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ck_assert_msg(ok, ...) do { \
|
||||
if (!(ok)) { \
|
||||
fprintf(stderr, "%s:%d: failed `%s': ", __FILE__, __LINE__, #ok); \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
fprintf(stderr, "\n"); \
|
||||
abort(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ck_abort_msg(...) do { \
|
||||
fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
fprintf(stderr, "\n"); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
|
||||
#endif // C_TOXCORE_AUTO_TESTS_CHECK_COMPAT_H
|
Reference in New Issue
Block a user