2018-10-30 22:08:32 +11:00
|
|
|
#include "tap.hpp"
|
|
|
|
|
2019-06-19 17:28:01 +10:00
|
|
|
#include "preprocessor.hpp"
|
2017-09-12 14:17:30 +10:00
|
|
|
|
|
|
|
|
|
|
|
#define PLUS(X,Y) ((X)+(Y))
|
|
|
|
#define SIX(...) 6
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::TAP::logger tap;
|
2017-09-12 14:17:30 +10:00
|
|
|
|
|
|
|
int foo = 1, bar = 2, foobar = 3;
|
|
|
|
tap.expect_eq (foo + bar, PASTE(foo,bar), "PASTE");
|
|
|
|
tap.expect_eq (REDUCE1(PLUS, 1, 2, 3, 4), 10, "REDUCE0");
|
|
|
|
tap.expect_eq (MAP0(SIX, 9), 6, "MAP0");
|
|
|
|
tap.expect_eq (MAP1(PLUS, 6, 9), 15, "MAP1");
|
|
|
|
tap.expect_eq (VA_ARGS_COUNT (1, 2, 3, 4, 5, , 7, 8, 9), 9, "VA_ARGS_COUNT");
|
|
|
|
|
|
|
|
return tap.status ();
|
|
|
|
}
|