aboutsummaryrefslogtreecommitdiffstats
path: root/test/matrixtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/matrixtest.cpp')
-rw-r--r--test/matrixtest.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/test/matrixtest.cpp b/test/matrixtest.cpp
index 4150641f..fd9a0bb7 100644
--- a/test/matrixtest.cpp
+++ b/test/matrixtest.cpp
@@ -10,14 +10,38 @@
#include "testbench.hpp"
+void test(TestBench &tb, const std::string &test_name, bool result)
+{
+ tb.startTest(test_name);
+ tb.endTest(result);
+}
+
+bool matrixAssign()
+{
+ yage::Matrix<4, 5, int> m;
+ m[2][3]=5;
+
+ return m[2][3]==5;
+}
+
+bool matrixAddition()
+{
+ yage::Matrix<4, 4, int> m1, m2;
+ m1[1][1] = 293;
+ m2[1][1] = 583;
+
+ yage::Matrix<4, 4, int> m3 = m1 + m2;
+
+ return m3[1][1] == 876;
+}
+
int main()
{
TestBench tb;
- tb.startTest("Hello");
- tb.endTest(true);
- tb.startTest("Bye");
- tb.endTest(true);
+ test(tb, "Matrix Assign", matrixAssign());
+ test(tb, "Matrix Addition", matrixAddition());
+
tb.printResults();
return 0;
}