diff --git a/tests/apple2.bank.c b/tests/apple2.bank.c index 78a62ee..99bfc6c 100644 --- a/tests/apple2.bank.c +++ b/tests/apple2.bank.c @@ -1,25 +1,10 @@ #include -#include "apple2.h" #include "apple2.bank.h" +#include "apple2.h" +#include "apple2.tests.h" #include "vm_segment.h" -static apple2 *mach = NULL; - -static void -setup() -{ - mach = apple2_create(100, 100); - vm_segment_set_map_machine(mach); -} - -static void -teardown() -{ - apple2_free(mach); - vm_segment_set_map_machine(NULL); -} - TestSuite(apple2_bank, .init = setup, .fini = teardown); Test(apple2_bank, map) diff --git a/tests/apple2.dbuf.c b/tests/apple2.dbuf.c index fe3e275..7ae6a61 100644 --- a/tests/apple2.dbuf.c +++ b/tests/apple2.dbuf.c @@ -1,25 +1,10 @@ #include -#include "apple2.h" #include "apple2.dbuf.h" +#include "apple2.h" +#include "apple2.tests.h" #include "vm_segment.h" -static apple2 *mach = NULL; - -static void -setup() -{ - mach = apple2_create(100, 100); - vm_segment_set_map_machine(mach); -} - -static void -teardown() -{ - apple2_free(mach); - vm_segment_set_map_machine(NULL); -} - TestSuite(apple2_dbuf, .init = setup, .fini = teardown); Test(apple2_dbuf, map) diff --git a/tests/apple2.draw.c b/tests/apple2.draw.c index d9a2ec7..dcf80b8 100644 --- a/tests/apple2.draw.c +++ b/tests/apple2.draw.c @@ -1,5 +1,7 @@ #include +#include "apple2.tests.h" + /* Test(apple2_draw, pixel) */ /* Test(apple2_draw, pixel_lores) */ /* Test(apple2_draw, text) */ diff --git a/tests/apple2.mem.c b/tests/apple2.mem.c index 256f2d7..d3d917d 100644 --- a/tests/apple2.mem.c +++ b/tests/apple2.mem.c @@ -1,24 +1,9 @@ #include +#include "apple2.bank.h" #include "apple2.h" #include "apple2.mem.h" -#include "apple2.bank.h" - -static apple2 *mach = NULL; - -static void -setup() -{ - mach = apple2_create(100, 100); - vm_segment_set_map_machine(mach); -} - -static void -teardown() -{ - apple2_free(mach); - vm_segment_set_map_machine(NULL); -} +#include "apple2.tests.h" TestSuite(apple2_mem, .init = setup, .fini = teardown); diff --git a/tests/apple2.pc.c b/tests/apple2.pc.c index 4c27db0..ca1bfb9 100644 --- a/tests/apple2.pc.c +++ b/tests/apple2.pc.c @@ -2,22 +2,7 @@ #include "apple2.h" #include "apple2.pc.h" - -static apple2 *mach = NULL; - -static void -setup() -{ - mach = apple2_create(100, 100); - vm_segment_set_map_machine(mach); -} - -static void -teardown() -{ - apple2_free(mach); - vm_segment_set_map_machine(NULL); -} +#include "apple2.tests.h" TestSuite(apple2_pc, .init = setup, .fini = teardown);