From 3a2c0552d63c196e997a35dbb0935f843c4999a7 Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Tue, 10 Feb 2009 06:17:28 +0000 Subject: [PATCH] Added struct test git-svn-id: http://picoc.googlecode.com/svn/trunk@68 21eae674-98b7-11dd-bd71-f92a316d2d60 --- test/03_struct.c | 13 +++++++++++++ test/03_struct.expect | 2 ++ test/Makefile | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/03_struct.c create mode 100644 test/03_struct.expect diff --git a/test/03_struct.c b/test/03_struct.c new file mode 100644 index 0000000..a8dd746 --- /dev/null +++ b/test/03_struct.c @@ -0,0 +1,13 @@ +struct fred +{ + int boris; + int natasha; +}; + +struct fred bloggs; + +bloggs.boris = 12; +bloggs.natasha = 34; + +printint(bloggs.boris); +printint(bloggs.natasha); diff --git a/test/03_struct.expect b/test/03_struct.expect new file mode 100644 index 0000000..8e994dd --- /dev/null +++ b/test/03_struct.expect @@ -0,0 +1,2 @@ +12 +34 diff --git a/test/Makefile b/test/Makefile index b897a13..4508a6f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,6 +1,7 @@ TESTS= 00_assignment.test \ 01_comment.test \ - 02_printf.test + 02_printf.test \ + 03_struct.test %.test: %.expect %.c ../picoc @echo Test: $*... @@ -9,6 +10,7 @@ TESTS= 00_assignment.test \ then \ echo "error in test $*"; \ diff -u $*.expect $*.output; \ + rm -f $*.output; \ exit 1; \ fi; \ rm -f $*.output