diff options
Diffstat (limited to 'testsuites/psxtests/psxmmap01/test_helper.h')
-rw-r--r-- | testsuites/psxtests/psxmmap01/test_helper.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxmmap01/test_helper.h b/testsuites/psxtests/psxmmap01/test_helper.h new file mode 100644 index 0000000000..65ca3c11bd --- /dev/null +++ b/testsuites/psxtests/psxmmap01/test_helper.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017 Kevin Kirspel. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include <string.h> + +#define mmap_test_assert(__exp, fmt, ...) \ + do { \ + if (!(__exp)) { \ + fail_check(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \ + rtems_test_exit(0); \ + } \ + } while (0) + +#define mmap_test_check(__exp, fmt, ...) \ + do { \ + if (!(__exp)) { \ + fail_check(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \ + } else { \ + rtems_test_assert(__exp); \ + }\ + } while (0) + +#define mmap_test_assert_equal(expected, actual, fmt, ...) \ + mmap_test_assert((expected) == (actual), "%s != %s: " fmt, \ + #expected, #actual, ##__VA_ARGS__) + +#define mmap_test_check_equal(expected, actual, fmt, ...) \ + mmap_test_check((expected) == (actual), "%s != %s: " fmt, \ + #expected, #actual, ##__VA_ARGS__) + +extern void fail_check( + const char *file, + const size_t line, + const char *fmt, + ... +); |