/*----- Header files ------------------------------------------------------*/
#include "tvec.h"
+#include "tvec-types.h"
#include "example.h"
/*----- Addition test -----------------------------------------------------*/
-void test_add(const struct tvec_reg *in, struct tvec_reg *out, void *ctx)
- { out[RZ].v.i = add(in[RX].v.i, in[RY].v.i); }
-
static const struct tvec_regdef add_regs[] = {
{ "x", &tvty_int, RX, 0, { &tvrange_int } },
{ "y", &tvty_int, RY, 0, { &tvrange_int } },
TVEC_ENDREGS
};
-#define ADD_TEST \
- { "add", add_regs, 0, test_add }
+void test_add(const struct tvec_reg *in, struct tvec_reg *out, void *ctx)
+ { out[RZ].v.i = add(in[RX].v.i, in[RY].v.i); }
+
+static const struct tvec_test add_test =
+ { "add", add_regs, 0, test_add };
/*----- Greeting test -----------------------------------------------------*/
TVEC_ENDREGS
};
-#define GREET_TEST \
- { "greet", greet_regs, 0, test_greet }
+static const struct tvec_test greet_test =
+ { "greet", greet_regs, 0, test_greet };
/*----- Main program ------------------------------------------------------*/
-static const struct tvec_test tests[] = {
- ADD_TEST,
- GREET_TEST,
- TVEC_ENDTESTS
+static const struct tvec_test *const tests[] = {
+ &add_test,
+ &greet_test,
+ 0
};
static const struct tvec_config test_config =