mirror of
https://github.com/pevans/erc-c.git
synced 2024-12-30 06:29:48 +00:00
00ff9f069d
Criterion's init and fini config options allow us to register setup and teardown functions. We now use this to register the common cpu variable for the mos6502 tests, albeit through the use of a global variable. Doing so necessitated that each of the different test files have their own suites, due to some implementation details in Criterion, but this is No Big Deal.
19 lines
184 B
C
19 lines
184 B
C
#ifndef _MOS6502_TESTS_H
|
|
#define _MOS6502_TESTS_H
|
|
|
|
static mos6502 *cpu;
|
|
|
|
static void
|
|
setup()
|
|
{
|
|
cpu = mos6502_create();
|
|
}
|
|
|
|
static void
|
|
teardown()
|
|
{
|
|
mos6502_free(cpu);
|
|
}
|
|
|
|
#endif
|