mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
Actually add the tests
This commit is contained in:
parent
56987b41eb
commit
49cb2bcda2
6 changed files with 66 additions and 0 deletions
14
tests/calls.qc
Normal file
14
tests/calls.qc
Normal file
|
@ -0,0 +1,14 @@
|
|||
void(string, ...) print = #1;
|
||||
string(float) ftos = #2;
|
||||
|
||||
float(float x, float y, float z) sum = {
|
||||
return x + y + z;
|
||||
};
|
||||
|
||||
void(float a, float b, float c) main = {
|
||||
local float f;
|
||||
f = sum(sum(a, sum(a, b, c), c),
|
||||
sum(sum(sum(a, b, c), b, sum(a, b, c)), b, sum(a, b, sum(a, b, c))),
|
||||
sum(sum(a, b, c), b, c));
|
||||
print(ftos(f), "\n");
|
||||
};
|
8
tests/calls.tmpl
Normal file
8
tests/calls.tmpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
I: calls.qc
|
||||
D: test calls
|
||||
T: -execute
|
||||
C: -std=gmqcc
|
||||
E: -float 100 -float 200 -float 300
|
||||
F: calls failed
|
||||
S: calls worked
|
||||
M: 4600
|
11
tests/equality.qc
Normal file
11
tests/equality.qc
Normal file
|
@ -0,0 +1,11 @@
|
|||
void(string, ...) print = #1;
|
||||
string(float) ftos = #2;
|
||||
|
||||
void(float a, float b) main = {
|
||||
if (a == b) print("eq,");
|
||||
if (a != b) print("ne,");
|
||||
if (a > b) print("gt,");
|
||||
if (a < b) print("lt,");
|
||||
if (a >= b) print("ge,");
|
||||
if (a <= b) print("le,");
|
||||
};
|
8
tests/equality.tmpl
Normal file
8
tests/equality.tmpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
I: equality.qc
|
||||
D: test equality
|
||||
T: -execute
|
||||
C: -std=gmqcc
|
||||
E: -float 100 -float 200
|
||||
F: equality failed
|
||||
S: equality worked
|
||||
M: ne,lt,le,
|
17
tests/fieldparms.qc
Normal file
17
tests/fieldparms.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);
|
||||
};
|
8
tests/fieldparms.tmpl
Normal file
8
tests/fieldparms.tmpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
I: fieldparams.qc
|
||||
D: test field paramaters
|
||||
T: -execute
|
||||
C: -std=qcc
|
||||
E: $null
|
||||
F: field paramaters fail
|
||||
S: field paramaters work
|
||||
M: bar
|
Loading…
Reference in a new issue