Fix testing mechanism.

This commit is contained in:
James Goppert
2016-01-24 12:00:34 +11:00
parent 6009709986
commit 38211e1aff
17 changed files with 179 additions and 173 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
#include <assert.h>
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp"
using namespace matrix;
@@ -12,12 +12,12 @@ int main()
float data1[] = {1,2,3,4,5};
float data2[] = {6,7,8,9,10};
Vector<float, 5> v1(data1);
assert(fabs(v1.norm() - 7.416198487095663f) < 1e-5);
TEST(fabs(v1.norm() - 7.416198487095663f) < 1e-5);
Vector<float, 5> v2(data2);
assert(fabs(v1.dot(v2) - 130.0f) < 1e-5);
TEST(fabs(v1.dot(v2) - 130.0f) < 1e-5);
v2.normalize();
Vector<float, 5> v3(v2);
assert(v2 == v3);
TEST(v2 == v3);
return 0;
}