mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-13 01:29:57 +00:00
Add first test cases (for bus access).
This commit is contained in:
parent
26384ce27d
commit
0a43717337
6
test/Kyuafile
Normal file
6
test/Kyuafile
Normal file
@ -0,0 +1,6 @@
|
||||
syntax(2)
|
||||
|
||||
test_suite('rk65c02-tests')
|
||||
|
||||
atf_test_program{name='test_bus'}
|
||||
|
11
test/Makefile
Normal file
11
test/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
CFLAGS=-Wall -I../src
|
||||
LDFLAGS=-L../src/ -latf-c -lrk65c02
|
||||
#-Wl,-R../src/
|
||||
|
||||
test_bus : test_bus.o
|
||||
$(CC) -o test_bus $(LDFLAGS) $<
|
||||
|
||||
%.o : %.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
|
33
test/test_bus.c
Normal file
33
test/test_bus.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include <atf-c.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bus.h"
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(bus__init);
|
||||
ATF_TC_BODY(bus__init, tc)
|
||||
{
|
||||
bus_t b;
|
||||
|
||||
b = bus_init();
|
||||
|
||||
ATF_CHECK(b.space != NULL);
|
||||
|
||||
bus_finish(&b);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(bus__foo);
|
||||
ATF_TC_BODY(bus__foo, tc)
|
||||
{
|
||||
bus_t b;
|
||||
}
|
||||
|
||||
ATF_TP_ADD_TCS(tp)
|
||||
{
|
||||
ATF_TP_ADD_TC(tp, bus__init);
|
||||
ATF_TP_ADD_TC(tp, bus__foo);
|
||||
|
||||
return (atf_no_error());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user