]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Test for extended parameters
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 22 Nov 2012 18:36:45 +0000 (19:36 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 22 Nov 2012 18:36:45 +0000 (19:36 +0100)
tests/param8.qc [new file with mode: 0644]
tests/param8.tmpl [new file with mode: 0644]

diff --git a/tests/param8.qc b/tests/param8.qc
new file mode 100644 (file)
index 0000000..68e96f7
--- /dev/null
@@ -0,0 +1,25 @@
+void   print(...) = #1;
+string ftos(float) = #2;
+
+void p10(float a, float b, float c, float d, float e, float f, float g, float h,
+         float e1, float e2)
+{
+    print(ftos(a),  " ", ftos(b), " ", ftos(c), " ");
+    print(ftos(d),  " ", ftos(e), " ", ftos(f), " ");
+    print(ftos(g),  " ", ftos(h), " ");
+    print(ftos(e1), " ", ftos(e2), "\n");
+}
+
+void overwrite(float a, float b, float c, float d, float e, float f, float g, float h,
+               float e1, float e2)
+{
+    // call >8 param functions within a >8 param function and see if the locals
+    // are actual copies
+    p10(a, b, c, d, e, f, g, h, e1, e2);
+    p10(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+    p10(a, b, c, d, e, f, g, h, e1, e2);
+}
+
+void main() {
+    overwrite(10, 20, 30, 40, 50, 60, 70, 80, 90, 100);
+}
diff --git a/tests/param8.tmpl b/tests/param8.tmpl
new file mode 100644 (file)
index 0000000..9a02f65
--- /dev/null
@@ -0,0 +1,9 @@
+I: param8.qc
+D: test extended parameters
+T: -execute
+C: -std=fteqcc
+F: extended parameters failed
+S: extended parameters worked
+M: 10 20 30 40 50 60 70 80 90 100
+M: 1 1 1 1 1 1 1 1 1 1
+M: 10 20 30 40 50 60 70 80 90 100