]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
add another test that we just didn't have anywhere else yet
authorWolfgang Bumiller <wry.git@bumiller.com>
Thu, 22 Jan 2015 10:45:23 +0000 (11:45 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sun, 25 Jan 2015 08:29:02 +0000 (09:29 +0100)
tests/fieldfuncs.qc [new file with mode: 0644]
tests/fieldfuncs.tmpl [new file with mode: 0644]

diff --git a/tests/fieldfuncs.qc b/tests/fieldfuncs.qc
new file mode 100644 (file)
index 0000000..4228f33
--- /dev/null
@@ -0,0 +1,13 @@
+.float field;
+
+.float getfield() {
+  return field;
+}
+
+void() main = {
+  entity e = spawn();
+  e.field = 42;
+  print(ftos(e.(getfield())), "\n");
+  .float memptr = getfield();
+  print(ftos(e.memptr), "\n");
+}
diff --git a/tests/fieldfuncs.tmpl b/tests/fieldfuncs.tmpl
new file mode 100644 (file)
index 0000000..1199b9b
--- /dev/null
@@ -0,0 +1,6 @@
+I: fieldfuncs.qc
+D: test fields with functions
+T: -compile
+C: -std=fte
+M: 42
+M: 42