enum testcase

This commit is contained in:
Wolfgang Bumiller 2013-01-10 21:38:17 +01:00
parent 0da4626417
commit 4a063d3518
2 changed files with 36 additions and 0 deletions

25
tests/enum.qc Normal file
View 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
View 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