1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-17 00:04:43 +00:00

Use apple2.tests.h for setup/teardown

This commit is contained in:
Peter Evans 2018-01-17 15:31:12 -06:00
parent 37df8db225
commit 96b8b77f37
5 changed files with 9 additions and 67 deletions

View File

@ -1,25 +1,10 @@
#include <criterion/criterion.h> #include <criterion/criterion.h>
#include "apple2.h"
#include "apple2.bank.h" #include "apple2.bank.h"
#include "apple2.h"
#include "apple2.tests.h"
#include "vm_segment.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); TestSuite(apple2_bank, .init = setup, .fini = teardown);
Test(apple2_bank, map) Test(apple2_bank, map)

View File

@ -1,25 +1,10 @@
#include <criterion/criterion.h> #include <criterion/criterion.h>
#include "apple2.h"
#include "apple2.dbuf.h" #include "apple2.dbuf.h"
#include "apple2.h"
#include "apple2.tests.h"
#include "vm_segment.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); TestSuite(apple2_dbuf, .init = setup, .fini = teardown);
Test(apple2_dbuf, map) Test(apple2_dbuf, map)

View File

@ -1,5 +1,7 @@
#include <criterion/criterion.h> #include <criterion/criterion.h>
#include "apple2.tests.h"
/* Test(apple2_draw, pixel) */ /* Test(apple2_draw, pixel) */
/* Test(apple2_draw, pixel_lores) */ /* Test(apple2_draw, pixel_lores) */
/* Test(apple2_draw, text) */ /* Test(apple2_draw, text) */

View File

@ -1,24 +1,9 @@
#include <criterion/criterion.h> #include <criterion/criterion.h>
#include "apple2.bank.h"
#include "apple2.h" #include "apple2.h"
#include "apple2.mem.h" #include "apple2.mem.h"
#include "apple2.bank.h" #include "apple2.tests.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_mem, .init = setup, .fini = teardown); TestSuite(apple2_mem, .init = setup, .fini = teardown);

View File

@ -2,22 +2,7 @@
#include "apple2.h" #include "apple2.h"
#include "apple2.pc.h" #include "apple2.pc.h"
#include "apple2.tests.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_pc, .init = setup, .fini = teardown); TestSuite(apple2_pc, .init = setup, .fini = teardown);