From 70f9be0f59bdb7853ca1e9a6b6224c8c68105bf2 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 1 Nov 2012 18:21:53 +0100 Subject: [PATCH] Test for entity-field-pointer function parameters --- testsuite/Makefile | 8 +++++++- testsuite/field-parameters/expected | 1 + testsuite/field-parameters/main.qc | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 testsuite/field-parameters/expected create mode 100644 testsuite/field-parameters/main.qc diff --git a/testsuite/Makefile b/testsuite/Makefile index d238455..b132393 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -15,7 +15,8 @@ TESTLIST = \ fields1 \ invalid-types \ ngraphs \ - invalid-assign + invalid-assign \ + field-parameters .PHONY: clean test @@ -156,6 +157,11 @@ invalid-assign-ok: obj invalid-assign/main.qc invalid-assign: invalid-assign-ok +$(eval $(call maketest,field-parameters,qcc)) +field-parameters: + @$(VM) $< > $@/output + @diff $@/output $@/expected + ####################################################################### obj: mkdir obj diff --git a/testsuite/field-parameters/expected b/testsuite/field-parameters/expected new file mode 100644 index 0000000..5716ca5 --- /dev/null +++ b/testsuite/field-parameters/expected @@ -0,0 +1 @@ +bar diff --git a/testsuite/field-parameters/main.qc b/testsuite/field-parameters/main.qc new file mode 100644 index 0000000..86a31c6 --- /dev/null +++ b/testsuite/field-parameters/main.qc @@ -0,0 +1,17 @@ +void(string, string) print = #1; +entity() spawn = #3; + +.string a; +.string b; + +void(entity e, .string s) callout = { + print(e.s, "\n"); +}; + +void() main = { + local entity e; + e = spawn(); + e.a = "foo"; + e.b = "bar"; + callout(e, b); +}; -- 2.39.2