From: Wolfgang Bumiller Date: Thu, 20 Dec 2012 13:12:22 +0000 (+0100) Subject: vector initialization tests X-Git-Tag: 0.1.9~16 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79f3f980e9477a51dacb040fd796a440b6a93bff;p=xonotic%2Fgmqcc.git vector initialization tests --- diff --git a/tests/vector-init.qc b/tests/vector-init.qc new file mode 100644 index 0000000..880bc39 --- /dev/null +++ b/tests/vector-init.qc @@ -0,0 +1,25 @@ +void print(...) = #1; +string ftos (float) = #2; +string vtos (vector) = #5; + +void main() { + vector v; + + //v_x = 0; + //v_y = 0; + //v_z = 0; +#ifdef INIT_BY_VECTOR + v = '3 4 5'; +#elifdef INIT_BY_COMPONENTS + v_x = 3; + v_y = 4; + v_z = 5; +#elifdef INIT_PARTS + v_z = 5; +#endif + + print(ftos(v_y), "\n"); + print(ftos(v_x), "\n"); + print(ftos(v_z), "\n"); + print(vtos(v), "\n"); +} diff --git a/tests/vector-init.tmpl b/tests/vector-init.tmpl new file mode 100644 index 0000000..2457d77 --- /dev/null +++ b/tests/vector-init.tmpl @@ -0,0 +1,4 @@ +I: vector-init.qc +D: vector init as a whole +T: -compile +C: -std=fteqcc -Wall -Werror -DINIT_BY_VECTOR diff --git a/tests/vector-init2.tmpl b/tests/vector-init2.tmpl new file mode 100644 index 0000000..4bb85df --- /dev/null +++ b/tests/vector-init2.tmpl @@ -0,0 +1,4 @@ +I: vector-init.qc +D: vector init by components +T: -compile +C: -std=fteqcc -Wall -Werror -DINIT_BY_COMPONENTS diff --git a/tests/vector-init3.tmpl b/tests/vector-init3.tmpl new file mode 100644 index 0000000..99936e1 --- /dev/null +++ b/tests/vector-init3.tmpl @@ -0,0 +1,4 @@ +I: vector-init.qc +D: only partial vector init +T: -fail +C: -std=fteqcc -Wall -Werror -DINIT_PARTS