summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-04-20 13:10:28 +0000
committerrandomdan <randomdan@localhost>2014-04-20 13:10:28 +0000
commit1c74b577650c2326d012b93099aabaf570cbcc06 (patch)
treef8607f46873df7e8668438a71d066e1aa66f616d
parentSupport optional parameters for ICE function calls (diff)
downloadproject2-1c74b577650c2326d012b93099aabaf570cbcc06.tar.bz2
project2-1c74b577650c2326d012b93099aabaf570cbcc06.tar.xz
project2-1c74b577650c2326d012b93099aabaf570cbcc06.zip
Add full range of scalar tests
-rw-r--r--project2/basics/tests/equals.cpp1
-rw-r--r--project2/basics/tests/greaterthan.cpp23
-rw-r--r--project2/basics/tests/greaterthanorequal.cpp23
-rw-r--r--project2/basics/tests/lessthan.cpp23
-rw-r--r--project2/basics/tests/lessthanorequal.cpp23
-rw-r--r--project2/basics/tests/notequals.cpp23
6 files changed, 115 insertions, 1 deletions
diff --git a/project2/basics/tests/equals.cpp b/project2/basics/tests/equals.cpp
index 6c7a74f..a83a42d 100644
--- a/project2/basics/tests/equals.cpp
+++ b/project2/basics/tests/equals.cpp
@@ -1,7 +1,6 @@
#include <pch.hpp>
#include <test.h>
#include <scriptLoader.h>
-#include <rowProcessor.h>
class Equals : public Test {
public:
diff --git a/project2/basics/tests/greaterthan.cpp b/project2/basics/tests/greaterthan.cpp
new file mode 100644
index 0000000..f029bfb
--- /dev/null
+++ b/project2/basics/tests/greaterthan.cpp
@@ -0,0 +1,23 @@
+#include <pch.hpp>
+#include <test.h>
+#include <scriptLoader.h>
+
+class GreaterThan : public Test {
+ public:
+ GreaterThan(ScriptNodePtr s) :
+ SourceObject(s),
+ Test(s),
+ a(s, "a"),
+ b(s, "b")
+ {
+ }
+
+ bool passes(ExecContext * ec) const {
+ return (a(ec) > b(ec));
+ }
+
+ private:
+ Variable a, b;
+};
+DECLARE_LOADER("greaterthan", GreaterThan);
+
diff --git a/project2/basics/tests/greaterthanorequal.cpp b/project2/basics/tests/greaterthanorequal.cpp
new file mode 100644
index 0000000..6da05f4
--- /dev/null
+++ b/project2/basics/tests/greaterthanorequal.cpp
@@ -0,0 +1,23 @@
+#include <pch.hpp>
+#include <test.h>
+#include <scriptLoader.h>
+
+class GreaterThanOrEqual : public Test {
+ public:
+ GreaterThanOrEqual(ScriptNodePtr s) :
+ SourceObject(s),
+ Test(s),
+ a(s, "a"),
+ b(s, "b")
+ {
+ }
+
+ bool passes(ExecContext * ec) const {
+ return (a(ec) >= b(ec));
+ }
+
+ private:
+ Variable a, b;
+};
+DECLARE_LOADER("greaterthanorequal", GreaterThanOrEqual);
+
diff --git a/project2/basics/tests/lessthan.cpp b/project2/basics/tests/lessthan.cpp
new file mode 100644
index 0000000..78b111f
--- /dev/null
+++ b/project2/basics/tests/lessthan.cpp
@@ -0,0 +1,23 @@
+#include <pch.hpp>
+#include <test.h>
+#include <scriptLoader.h>
+
+class LessThan : public Test {
+ public:
+ LessThan(ScriptNodePtr s) :
+ SourceObject(s),
+ Test(s),
+ a(s, "a"),
+ b(s, "b")
+ {
+ }
+
+ bool passes(ExecContext * ec) const {
+ return (a(ec) < b(ec));
+ }
+
+ private:
+ Variable a, b;
+};
+DECLARE_LOADER("lessthan", LessThan);
+
diff --git a/project2/basics/tests/lessthanorequal.cpp b/project2/basics/tests/lessthanorequal.cpp
new file mode 100644
index 0000000..2b2b511
--- /dev/null
+++ b/project2/basics/tests/lessthanorequal.cpp
@@ -0,0 +1,23 @@
+#include <pch.hpp>
+#include <test.h>
+#include <scriptLoader.h>
+
+class LessThanOrEqual : public Test {
+ public:
+ LessThanOrEqual(ScriptNodePtr s) :
+ SourceObject(s),
+ Test(s),
+ a(s, "a"),
+ b(s, "b")
+ {
+ }
+
+ bool passes(ExecContext * ec) const {
+ return (a(ec) <= b(ec));
+ }
+
+ private:
+ Variable a, b;
+};
+DECLARE_LOADER("lessthanorequal", LessThanOrEqual);
+
diff --git a/project2/basics/tests/notequals.cpp b/project2/basics/tests/notequals.cpp
new file mode 100644
index 0000000..499ce61
--- /dev/null
+++ b/project2/basics/tests/notequals.cpp
@@ -0,0 +1,23 @@
+#include <pch.hpp>
+#include <test.h>
+#include <scriptLoader.h>
+
+class NotEquals : public Test {
+ public:
+ NotEquals(ScriptNodePtr s) :
+ SourceObject(s),
+ Test(s),
+ a(s, "a"),
+ b(s, "b")
+ {
+ }
+
+ bool passes(ExecContext * ec) const {
+ return (a(ec) != b(ec));
+ }
+
+ private:
+ Variable a, b;
+};
+DECLARE_LOADER("notequals", NotEquals);
+