Skip to content
Browse files

Make the tests compile

  • Loading branch information...
1 parent 4cf8f0f commit 774ecadc0919cd89d1cadc539bf0e3c03c6e119d @Kazade committed Apr 27, 2012
Showing with 10 additions and 9 deletions.
  1. +8 −8 tests/test_mat3.cpp
  2. +2 −1 tests/test_ray2.cpp
View
16 tests/test_mat3.cpp
@@ -45,20 +45,20 @@ TEST(test_mat3_inverse) {
TEST(test_mat3_transpose) {
kmMat3 mat;
- float temp[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
- memcpy(mat.mat, temp, sizeof(float) * 9);
+ double temp[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+ memcpy(mat.mat, temp, sizeof(double) * 9);
kmMat3 transpose;
- float temp2[] = {0.0f, 3.0f, 6.0f, 1.0f, 4.0f, 7.0f, 2.0f, 5.0f, 8.0f };
- memcpy(transpose.mat, temp2, sizeof(float) * 9);
+ double temp2[] = {0.0f, 3.0f, 6.0f, 1.0f, 4.0f, 7.0f, 2.0f, 5.0f, 8.0f };
+ memcpy(transpose.mat, temp2, sizeof(double) * 9);
kmMat3 result;
CHECK(NULL != kmMat3Transpose(&result, &mat));
CHECK(kmMat3AreEqual(&transpose, &result));
}
TEST(test_mat3_fill) {
- float temp[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
+ double temp[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f };
kmMat3 orig, filled;
orig.mat[0] = 0.0f;
orig.mat[1] = 1.0f;
@@ -85,8 +85,8 @@ TEST(test_mat3_are_equal) {
}
TEST(test_mat3_axis_angle) {
- float radians = 1.0;
- float radiansOut;
+ double radians = 1.0;
+ double radiansOut;
kmMat3 a;
kmVec3 axisIn, axisOut;
kmVec3Fill(&axisIn, 1.0f, 0.0f, 0.0f);
@@ -104,7 +104,7 @@ TEST(test_mat3_axis_angle) {
}
TEST(test_mat3_identity) {
- float identity[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f };
+ double identity[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f };
kmMat3 expected, actual;
kmMat3Fill(&expected, identity);
kmMat3Identity(&actual);
View
3 tests/test_ray2.cpp
@@ -61,7 +61,8 @@ TEST(test_triangle_intersection) {
ray.dir.y = -0.5f;
kmVec2 intersect, normal;
- CHECK(kmRay2IntersectTriangle(&ray, &p1, &p2, &p3, &intersect, &normal));
+ kmScalar dist;
+ CHECK(kmRay2IntersectTriangle(&ray, &p1, &p2, &p3, &intersect, &normal, &dist));
CHECK_CLOSE(0.0f, intersect.x, 0.001f);
CHECK_CLOSE(0.0f, intersect.y, 0.001f);
CHECK_CLOSE(0.0f, normal.x, 0.001f);

0 comments on commit 774ecad

Please sign in to comment.
Something went wrong with that request. Please try again.