mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 10:41:43 +00:00
vector initialization tests
This commit is contained in:
parent
a274f8ec07
commit
79f3f980e9
4 changed files with 37 additions and 0 deletions
25
tests/vector-init.qc
Normal file
25
tests/vector-init.qc
Normal file
|
@ -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");
|
||||
}
|
4
tests/vector-init.tmpl
Normal file
4
tests/vector-init.tmpl
Normal file
|
@ -0,0 +1,4 @@
|
|||
I: vector-init.qc
|
||||
D: vector init as a whole
|
||||
T: -compile
|
||||
C: -std=fteqcc -Wall -Werror -DINIT_BY_VECTOR
|
4
tests/vector-init2.tmpl
Normal file
4
tests/vector-init2.tmpl
Normal file
|
@ -0,0 +1,4 @@
|
|||
I: vector-init.qc
|
||||
D: vector init by components
|
||||
T: -compile
|
||||
C: -std=fteqcc -Wall -Werror -DINIT_BY_COMPONENTS
|
4
tests/vector-init3.tmpl
Normal file
4
tests/vector-init3.tmpl
Normal file
|
@ -0,0 +1,4 @@
|
|||
I: vector-init.qc
|
||||
D: only partial vector init
|
||||
T: -fail
|
||||
C: -std=fteqcc -Wall -Werror -DINIT_PARTS
|
Loading…
Reference in a new issue