1
2
3
4
5
6#ifndef _SELFTESTS_POWERPC_UTILS_H
7#define _SELFTESTS_POWERPC_UTILS_H
8
9#include <stdint.h>
10#include <stdbool.h>
11
12
13typedef unsigned long long u64;
14typedef signed long long s64;
15
16
17typedef uint32_t u32;
18typedef uint8_t u8;
19
20extern void *get_auxv_entry(int type);
21
22int test_harness(int (test_function)(void), char *name);
23
24
25
26#define FAIL_IF(x) \
27do { \
28 if ((x)) { \
29 fprintf(stderr, \
30 "[FAIL] Test FAILED on line %d\n", __LINE__); \
31 return 1; \
32 } \
33} while (0)
34
35
36#define MAGIC_SKIP_RETURN_VALUE 99
37
38#define SKIP_IF(x) \
39do { \
40 if ((x)) { \
41 fprintf(stderr, \
42 "[SKIP] Test skipped on line %d\n", __LINE__); \
43 return MAGIC_SKIP_RETURN_VALUE; \
44 } \
45} while (0)
46
47#endif
48