]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/blob - libkmstest/test.h
move test utils to libkmstest library
[android/external-libkmsxx.git] / libkmstest / test.h
1 #pragma once
3 #include "color.h"
4 #include "conv.h"
5 #include "testpat.h"
7 #define unlikely(x) __builtin_expect(!!(x), 0)
9 static void ASSERT_FAIL(const char *cond, const char *file,
10                            unsigned int line, const char *func) __attribute__ ((__noreturn__));
12 static void ASSERT_FAIL(const char *cond, const char *file,
13                            unsigned int line, const char *func)
14 {
15         fprintf(stderr, "%s:%d: %s: ASSERT(%s) failed\n", file, line, func, cond);
16         abort();
17 }
19 #define ASSERT(x) if (unlikely(!(x))) { ASSERT_FAIL( __STRING(x), __FILE__, __LINE__, __PRETTY_FUNCTION__); }
21 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))