From e86fc9b2334e5d272e7053da9cf963fbc9b61f3d Mon Sep 17 00:00:00 2001 From: Sven Gestegard Robertz <sven.robertz@cs.lth.se> Date: Sat, 29 Mar 2014 21:13:07 +0100 Subject: [PATCH] fixed twoway example, added struct typedef test --- examples/twoway/client.c | 2 +- test/Makefile | 4 ++-- test/errors/correct/structtype.lc | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 test/errors/correct/structtype.lc diff --git a/examples/twoway/client.c b/examples/twoway/client.c index 484b20e..be82e9a 100644 --- a/examples/twoway/client.c +++ b/examples/twoway/client.c @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) } } printf("\n"); - labcomm_encode_types_Terminate(encoder, LABCOMM_VOID); + labcomm_encode_types_Terminate(encoder); out: return 0; diff --git a/test/Makefile b/test/Makefile index 491ba7c..376949f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -6,7 +6,7 @@ CFLAGS=-O3 -g -Wall -Werror all: -test: $(TESTS:%=test_%) +test: $(TESTS:%=test_%) compiler_errors # PYTHONPATH=../lib/python \ # ./test_encoder_decoder.py --labcomm="$(LABCOMM)" basic.lc @@ -14,7 +14,7 @@ test: $(TESTS:%=test_%) clean distclean: rm -rf gen -.PHONY: test_% testErrors +.PHONY: test_% test_%: gen/%/signatures.py \ gen/%/c_relay \ gen/%/cs_relay.exe \ diff --git a/test/errors/correct/structtype.lc b/test/errors/correct/structtype.lc new file mode 100644 index 0000000..9eef504 --- /dev/null +++ b/test/errors/correct/structtype.lc @@ -0,0 +1,9 @@ +typedef struct { + string topic; +} pubsub; + +sample pubsub subscribe; +sample pubsub unsubscribe; + +sample pubsub publish; +sample pubsub unpublish; -- GitLab