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
@@ -2,8 +2,7 @@
#include "test_macros.hpp"
using matrix::SquareMatrix;
using matrix::Vector3f;
using namespace matrix;
int main()
{
@@ -14,20 +13,20 @@ int main()
static const float eps = 1e-7f;
TEST(fabsf(v(0) - 1) < eps);
TEST(fabsf(v(1) - 2) < eps);
TEST(fabsf(v(2) - 3) < eps);
TEST(fabs(v(0) - 1) < eps);
TEST(fabs(v(1) - 2) < eps);
TEST(fabs(v(2) - 3) < eps);
Vector3f v2(4, 5, 6);
TEST(fabsf(v2(0) - 4) < eps);
TEST(fabsf(v2(1) - 5) < eps);
TEST(fabsf(v2(2) - 6) < eps);
TEST(fabs(v2(0) - 4) < eps);
TEST(fabs(v2(1) - 5) < eps);
TEST(fabs(v2(2) - 6) < eps);
SquareMatrix<float, 3> m = diag(Vector3f(1,2,3));
TEST(fabsf(m(0, 0) - 1) < eps);
TEST(fabsf(m(1, 1) - 2) < eps);
TEST(fabsf(m(2, 2) - 3) < eps);
TEST(fabs(m(0, 0) - 1) < eps);
TEST(fabs(m(1, 1) - 2) < eps);
TEST(fabs(m(2, 2) - 3) < eps);
return 0;
}