Removed all uses of C library from tests

This commit is contained in:
Pavel Kirienko
2017-03-17 13:38:48 +03:00
committed by James Goppert
parent 9ebf5f89db
commit e09cf12e2e
17 changed files with 87 additions and 126 deletions
+10 -11
View File
@@ -4,31 +4,30 @@
#include "test_macros.hpp"
using matrix::Matrix;
using matrix::Vector2f;
using namespace matrix;
int main()
{
Vector2f a(1, 0);
Vector2f b(0, 1);
TEST(fabsf(a % b - 1.0f) < 1e-5);
TEST(fabs(a % b - 1.0f) < 1e-5);
Vector2f c;
TEST(fabsf(c(0) - 0) < 1e-5);
TEST(fabsf(c(1) - 0) < 1e-5);
TEST(fabs(c(0) - 0) < 1e-5);
TEST(fabs(c(1) - 0) < 1e-5);
Matrix<float, 2, 1> d(a);
TEST(fabsf(d(0,0) - 1) < 1e-5);
TEST(fabsf(d(1,0) - 0) < 1e-5);
TEST(fabs(d(0,0) - 1) < 1e-5);
TEST(fabs(d(1,0) - 0) < 1e-5);
Vector2f e(d);
TEST(fabsf(e(0) - 1) < 1e-5);
TEST(fabsf(e(1) - 0) < 1e-5);
TEST(fabs(e(0) - 1) < 1e-5);
TEST(fabs(e(1) - 0) < 1e-5);
float data[] = {4,5};
Vector2f f(data);
TEST(fabsf(f(0) - 4) < 1e-5);
TEST(fabsf(f(1) - 5) < 1e-5);
TEST(fabs(f(0) - 4) < 1e-5);
TEST(fabs(f(1) - 5) < 1e-5);
return 0;
}