20 lines
397 B
C++
20 lines
397 B
C++
#pragma once
|
|||
|
|
|
||
|
|
#include <iostream>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
typedef int (*TestFunc)(void);
|
||
|
|
|
||
|
|
extern std::vector<TestFunc> test_funcs;
|
||
|
|
|
||
|
|
#define CHECK(a) do { \
|
||
|
|
if (a) { \
|
||
|
|
std::cout << "Failed check in " << __func__ << ":" << __LINE__ << "\n" \
|
||
|
|
<< #a << " does not hold\n"; \
|
||
|
|
return 1; \
|
||
|
|
} \
|
||
|
|
} while (0)
|
||
|
|
|
||
|
|
#define TEST(name) static int name(void)
|
||
|
|
#define REGISTER(name) test_funcs.push_back(name)
|