]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Adding break/continue testcases
authorWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 19 Nov 2012 23:21:03 +0000 (00:21 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 19 Nov 2012 23:21:03 +0000 (00:21 +0100)
tests/break-1.tmpl [new file with mode: 0644]
tests/break-2.tmpl [new file with mode: 0644]
tests/break-3.tmpl [new file with mode: 0644]
tests/break-4.tmpl [new file with mode: 0644]
tests/break.qc [new file with mode: 0644]

diff --git a/tests/break-1.tmpl b/tests/break-1.tmpl
new file mode 100644 (file)
index 0000000..f67313e
--- /dev/null
@@ -0,0 +1,6 @@
+I: break.qc
+D: test break and continue - case 1
+T: -execute
+C: -std=fteqcc
+E: -float -1 -float -1
+M: 0 1 2 3 4 5 6 7 8 9 end
diff --git a/tests/break-2.tmpl b/tests/break-2.tmpl
new file mode 100644 (file)
index 0000000..5ba7a3a
--- /dev/null
@@ -0,0 +1,6 @@
+I: break.qc
+D: test break and continue - case 2
+T: -execute
+C: -std=fteqcc
+E: -float 3 -float -1
+M: 0 1 2 3 brk end
diff --git a/tests/break-3.tmpl b/tests/break-3.tmpl
new file mode 100644 (file)
index 0000000..bac76d1
--- /dev/null
@@ -0,0 +1,6 @@
+I: break.qc
+D: test break and continue - case 3
+T: -execute
+C: -std=fteqcc
+E: -float -1 -float 3
+M: 0 1 2 ct 4 5 6 7 8 9 end
diff --git a/tests/break-4.tmpl b/tests/break-4.tmpl
new file mode 100644 (file)
index 0000000..2d017b0
--- /dev/null
@@ -0,0 +1,6 @@
+I: break.qc
+D: test break and continue - case 4
+T: -execute
+C: -std=fteqcc
+E: -float 5 -float 2
+M: 0 1 ct 3 4 5 brk end
diff --git a/tests/break.qc b/tests/break.qc
new file mode 100644 (file)
index 0000000..6aa276b
--- /dev/null
@@ -0,0 +1,19 @@
+void   print(...)   = #1;
+string ftos (float) = #2;
+
+void main(float brkat, float contat) {
+    float i;
+
+    for (i = 0; i < 10; i += 1) {
+        if (i == contat) {
+            print("ct ");
+            continue;
+        }
+        print(ftos(i), " ");
+        if (i == brkat) {
+            print("brk ");
+            break;
+        }
+    }
+    print("end\n");
+}