From: Wolfgang Bumiller Date: Thu, 10 Jan 2013 20:38:17 +0000 (+0100) Subject: enum testcase X-Git-Tag: before-library~314 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4a063d3518b1af9a0c6270d5603e01d88c36c453;p=xonotic%2Fgmqcc.git enum testcase --- diff --git a/tests/enum.qc b/tests/enum.qc new file mode 100644 index 0000000..39b4196 --- /dev/null +++ b/tests/enum.qc @@ -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"); +} diff --git a/tests/enum.tmpl b/tests/enum.tmpl new file mode 100644 index 0000000..11ef9e8 --- /dev/null +++ b/tests/enum.tmpl @@ -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