mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
enum testcase
This commit is contained in:
parent
0da4626417
commit
4a063d3518
2 changed files with 36 additions and 0 deletions
25
tests/enum.qc
Normal file
25
tests/enum.qc
Normal file
|
@ -0,0 +1,25 @@
|
|||
void(string, ...) print = #1;
|
||||
string(float) ftos = #2;
|
||||
|
||||
enum {
|
||||
FOO,
|
||||
BAR,
|
||||
BAZ,
|
||||
OMG = BAR,
|
||||
POO,
|
||||
LAST = OMG + POO
|
||||
};
|
||||
|
||||
enum {A};
|
||||
enum {B=A+1};
|
||||
enum {C=A};
|
||||
|
||||
void main() {
|
||||
print(ftos(FOO), "\n");
|
||||
print(ftos(BAR), "\n");
|
||||
print(ftos(BAZ), "\n");
|
||||
print(ftos(OMG), "\n");
|
||||
print(ftos(POO), "\n");
|
||||
print(ftos(LAST), "\n");
|
||||
print(ftos(C), "\n");
|
||||
}
|
11
tests/enum.tmpl
Normal file
11
tests/enum.tmpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
I: enum.qc
|
||||
D: enumerations
|
||||
T: -execute
|
||||
C: -std=fteqcc
|
||||
M: 0
|
||||
M: 1
|
||||
M: 2
|
||||
M: 1
|
||||
M: 2
|
||||
M: 3
|
||||
M: 0
|
Loading…
Reference in a new issue