From 0a437173379f2908585d4b3de54667dabab4b1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Mon, 16 Jan 2017 22:54:51 +0100 Subject: [PATCH] Add first test cases (for bus access). --- test/Kyuafile | 6 ++++++ test/Makefile | 11 +++++++++++ test/test_bus.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 test/Kyuafile create mode 100644 test/Makefile create mode 100644 test/test_bus.c diff --git a/test/Kyuafile b/test/Kyuafile new file mode 100644 index 0000000..3bcbdef --- /dev/null +++ b/test/Kyuafile @@ -0,0 +1,6 @@ +syntax(2) + +test_suite('rk65c02-tests') + +atf_test_program{name='test_bus'} + diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..7794178 --- /dev/null +++ b/test/Makefile @@ -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 $< + + diff --git a/test/test_bus.c b/test/test_bus.c new file mode 100644 index 0000000..e8333f7 --- /dev/null +++ b/test/test_bus.c @@ -0,0 +1,33 @@ +#include + +#include +#include + +#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()); +} +