]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Collapsing the switch tests into 1
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 22 Nov 2012 18:28:45 +0000 (19:28 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 22 Nov 2012 18:28:45 +0000 (19:28 +0100)
tests/switch-1.tmpl [deleted file]
tests/switch-2.tmpl [deleted file]
tests/switch-3.tmpl [deleted file]
tests/switch-4.tmpl [deleted file]
tests/switch-5.tmpl [deleted file]
tests/switch-6.tmpl [deleted file]
tests/switch-7.tmpl [deleted file]
tests/switch-8.tmpl [deleted file]
tests/switch.qc
tests/switch.tmpl [new file with mode: 0644]

diff --git a/tests/switch-1.tmpl b/tests/switch-1.tmpl
deleted file mode 100644 (file)
index c44c0c9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 1
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 1 -float 0
-M: One
diff --git a/tests/switch-2.tmpl b/tests/switch-2.tmpl
deleted file mode 100644 (file)
index 4aa313b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 2
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 2 -float 0
-M: Two
diff --git a/tests/switch-3.tmpl b/tests/switch-3.tmpl
deleted file mode 100644 (file)
index a7dc4cc..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 3
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 3 -float 0
-M: Three, falling through to 2 - Two
diff --git a/tests/switch-4.tmpl b/tests/switch-4.tmpl
deleted file mode 100644 (file)
index 1c9f524..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 4
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 4 -float 0
-M: Four, falling through to default - Other
diff --git a/tests/switch-5.tmpl b/tests/switch-5.tmpl
deleted file mode 100644 (file)
index 1db84e6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 5
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 5 -float 0
-M: Other
diff --git a/tests/switch-6.tmpl b/tests/switch-6.tmpl
deleted file mode 100644 (file)
index ba65426..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 6
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 80 -float 0
-M: Enhanced 80
diff --git a/tests/switch-7.tmpl b/tests/switch-7.tmpl
deleted file mode 100644 (file)
index dac29bd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 7
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 99 -float 0
-M: 0 1 2 3 4 5
diff --git a/tests/switch-8.tmpl b/tests/switch-8.tmpl
deleted file mode 100644 (file)
index 343a3a5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-I: switch.qc
-D: test switches - case 8
-T: -execute
-C: -std=fteqcc -frelaxed-switch
-E: -float 99 -float 6
-M: early break
index c6396c5b117e0ac968aca825ab749c6a8f4fc9a1..1758c8af759ae002de99da948b970c1f44db8bd5 100644 (file)
@@ -1,7 +1,7 @@
 void print(...) = #1;
 string ftos(float) = #2;
 
-void main(float param, float p2) {
+void test(float param, float p2) {
     float i;
     float c80 = 80;
     switch(param) {
@@ -25,3 +25,14 @@ void main(float param, float p2) {
             print(ftos(i), "\n");
     }
 }
+
+void main() {
+    test(1,  0);
+    test(2,  0);
+    test(3,  0);
+    test(4,  0);
+    test(5,  0);
+    test(80, 0);
+    test(99, 0);
+    test(99, 6);
+}
diff --git a/tests/switch.tmpl b/tests/switch.tmpl
new file mode 100644 (file)
index 0000000..88cd2ea
--- /dev/null
@@ -0,0 +1,12 @@
+I: switch.qc
+D: test switches
+T: -execute
+C: -std=fteqcc -frelaxed-switch
+M: One
+M: Two
+M: Three, falling through to 2 - Two
+M: Four, falling through to default - Other
+M: Other
+M: Enhanced 80
+M: 0 1 2 3 4 5
+M: early break