rtc: rtc-ab-b5ze-s3: add sub-minute alarm support
[linux/fpc-iii.git] / tools / testing / selftests / powerpc / utils.h
bloba93777ae06846a4df47e5fbb5241af92cb6d6928
1 /*
2 * Copyright 2013, Michael Ellerman, IBM Corp.
3 * Licensed under GPLv2.
4 */
6 #ifndef _SELFTESTS_POWERPC_UTILS_H
7 #define _SELFTESTS_POWERPC_UTILS_H
9 #include <stdint.h>
10 #include <stdbool.h>
12 /* Avoid headaches with PRI?64 - just use %ll? always */
13 typedef unsigned long long u64;
14 typedef signed long long s64;
16 /* Just for familiarity */
17 typedef uint32_t u32;
18 typedef uint8_t u8;
21 int test_harness(int (test_function)(void), char *name);
24 /* Yes, this is evil */
25 #define FAIL_IF(x) \
26 do { \
27 if ((x)) { \
28 fprintf(stderr, \
29 "[FAIL] Test FAILED on line %d\n", __LINE__); \
30 return 1; \
31 } \
32 } while (0)
34 /* The test harness uses this, yes it's gross */
35 #define MAGIC_SKIP_RETURN_VALUE 99
37 #define SKIP_IF(x) \
38 do { \
39 if ((x)) { \
40 fprintf(stderr, \
41 "[SKIP] Test skipped on line %d\n", __LINE__); \
42 return MAGIC_SKIP_RETURN_VALUE; \
43 } \
44 } while (0)
46 #define _str(s) #s
47 #define str(s) _str(s)
49 #endif /* _SELFTESTS_POWERPC_UTILS_H */