diff --git a/src/gbasm/tests/test.c b/src/gbasm/tests/test.c index a55cd4a..70adbac 100644 --- a/src/gbasm/tests/test.c +++ b/src/gbasm/tests/test.c @@ -36,6 +36,10 @@ static void run_test(const void *test_data) int rc; size_t len; + if (test->init != NULL) { + test->init(); + } + src = strdup(test->asm_source); memset(program, 0, sizeof(program)); diff --git a/src/gbasm/tests/test.h b/src/gbasm/tests/test.h index 6c17da4..20a806a 100644 --- a/src/gbasm/tests/test.h +++ b/src/gbasm/tests/test.h @@ -4,10 +4,11 @@ #include struct gbasm_test { + void (*init)(void); const char *name; const char *asm_source; const uint8_t *expected_output; - const int expected_output_len; + int expected_output_len; }; struct gbasm_tests {