]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/blob - libkmstest/test.h
kmstest: remove unused color_convert
[android/external-libkmsxx.git] / libkmstest / test.h
1 #pragma once
3 #include "color.h"
4 #include "kmstest.h"
6 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
8 #define unlikely(x) __builtin_expect(!!(x), 0)
10 #define ASSERT(x) \
11         if (unlikely(!(x))) { \
12                 fprintf(stderr, "%s:%d: %s: ASSERT(%s) failed\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, __STRING(x)); \
13                 abort(); \
14         }
16 #define FAIL(fmt, ...) \
17         do { \
18                 fprintf(stderr, "%s:%d: %s:\n" fmt "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
19                 abort(); \
20         } while(0)
22 #define FAIL_IF(x, fmt, ...) \
23         if (unlikely(x)) { \
24                 fprintf(stderr, "%s:%d: %s:\n" fmt "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
25                 abort(); \
26         }
28 #define EXIT(fmt, ...) \
29         do { \
30                 fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
31                 exit(-1); \
32         } while(0)