Created
November 20, 2010 19:20
-
-
Save pervognsen/708072 to your computer and use it in GitHub Desktop.
asdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define TEST_TOKENPASTE(x, y) x ## y | |
#define TEST_TOKENPASTE2(x, y) TEST_TOKENPASTE(x, y) | |
#define DO_TEST(name, phase) \ | |
static void test_##name##(); \ | |
struct TEST_TOKENPASTE2(test, __LINE__) \ | |
{ \ | |
TEST_TOKENPASTE2(test, __LINE__)() \ | |
{ \ | |
test_register(#name, test_##name, __FILE__, phase, __LINE__); \ | |
} \ | |
} TEST_TOKENPASTE2(test_, __LINE__); \ | |
void test_##name##() | |
// Porcelain | |
#define PRE_TEST DO_TEST(NULL, -1) | |
#define TEST(name) DO_TEST(name, 0) | |
#define POST_TEST DO_TEST(NULL, +1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment