From 79f3f980e9477a51dacb040fd796a440b6a93bff Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <blub@speed.at>
Date: Thu, 20 Dec 2012 14:12:22 +0100
Subject: [PATCH] vector initialization tests

---
 tests/vector-init.qc    | 25 +++++++++++++++++++++++++
 tests/vector-init.tmpl  |  4 ++++
 tests/vector-init2.tmpl |  4 ++++
 tests/vector-init3.tmpl |  4 ++++
 4 files changed, 37 insertions(+)
 create mode 100644 tests/vector-init.qc
 create mode 100644 tests/vector-init.tmpl
 create mode 100644 tests/vector-init2.tmpl
 create mode 100644 tests/vector-init3.tmpl

diff --git a/tests/vector-init.qc b/tests/vector-init.qc
new file mode 100644
index 0000000..880bc39
--- /dev/null
+++ b/tests/vector-init.qc
@@ -0,0 +1,25 @@
+void   print(...)    = #1;
+string ftos (float)  = #2;
+string vtos (vector) = #5;
+
+void main() {
+    vector v;
+
+    //v_x = 0;
+    //v_y = 0;
+    //v_z = 0;
+#ifdef INIT_BY_VECTOR
+    v = '3 4 5';
+#elifdef INIT_BY_COMPONENTS
+    v_x = 3;
+    v_y = 4;
+    v_z = 5;
+#elifdef INIT_PARTS
+    v_z = 5;
+#endif
+
+    print(ftos(v_y), "\n");
+    print(ftos(v_x), "\n");
+    print(ftos(v_z), "\n");
+    print(vtos(v), "\n");
+}
diff --git a/tests/vector-init.tmpl b/tests/vector-init.tmpl
new file mode 100644
index 0000000..2457d77
--- /dev/null
+++ b/tests/vector-init.tmpl
@@ -0,0 +1,4 @@
+I: vector-init.qc
+D: vector init as a whole
+T: -compile
+C: -std=fteqcc -Wall -Werror -DINIT_BY_VECTOR
diff --git a/tests/vector-init2.tmpl b/tests/vector-init2.tmpl
new file mode 100644
index 0000000..4bb85df
--- /dev/null
+++ b/tests/vector-init2.tmpl
@@ -0,0 +1,4 @@
+I: vector-init.qc
+D: vector init by components
+T: -compile
+C: -std=fteqcc -Wall -Werror -DINIT_BY_COMPONENTS
diff --git a/tests/vector-init3.tmpl b/tests/vector-init3.tmpl
new file mode 100644
index 0000000..99936e1
--- /dev/null
+++ b/tests/vector-init3.tmpl
@@ -0,0 +1,4 @@
+I: vector-init.qc
+D: only partial vector init
+T: -fail
+C: -std=fteqcc -Wall -Werror -DINIT_PARTS
-- 
2.39.5