mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 22:31:36 +00:00
Test for entity-field-pointer function parameters
This commit is contained in:
parent
edd9ded23c
commit
70f9be0f59
3 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
|
|
1
testsuite/field-parameters/expected
Normal file
1
testsuite/field-parameters/expected
Normal file
|
@ -0,0 +1 @@
|
|||
bar
|
17
testsuite/field-parameters/main.qc
Normal file
17
testsuite/field-parameters/main.qc
Normal file
|
@ -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);
|
||||
};
|
Loading…
Reference in a new issue