Fixed tests to provide relevant output for CTest

master
Christophe Riccio ago%!(EXTRA string=14 years)
parent c3763826e8
commit 1c4abb3d73
  1. 11
      test/core/core_type_mat2x2.cpp
  2. 11
      test/core/core_type_mat2x3.cpp
  3. 12
      test/core/core_type_mat2x4.cpp
  4. 10
      test/core/core_type_mat3x2.cpp
  5. 17
      test/core/core_type_mat3x3.cpp
  6. 9
      test/core/core_type_mat3x4.cpp
  7. 11
      test/core/core_type_mat4x2.cpp
  8. 11
      test/core/core_type_mat4x3.cpp
  9. 15
      test/core/core_type_mat4x4.cpp
  10. 11
      test/core/core_type_vec1.cpp
  11. 15
      test/core/core_type_vec2.cpp
  12. 15
      test/core/core_type_vec3.cpp
  13. 23
      test/core/core_type_vec4.cpp
  14. 4
      test/gtc/gtc_quaternion.cpp
  15. 6
      test/gtx/gtx-bit.cpp
  16. 2
      test/gtx/gtx-simd-vec4.cpp

@ -9,7 +9,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::mat2x2 m(1.0f); glm::mat2x2 m(1.0f);
glm::vec2 u(1.0f); glm::vec2 u(1.0f);
@ -24,15 +24,14 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,7 +9,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::mat2x3 m(1.0f); glm::mat2x3 m(1.0f);
glm::vec2 u(1.0f); glm::vec2 u(1.0f);
@ -24,15 +24,14 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,7 +9,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::mat2x4 m(1.0f); glm::mat2x4 m(1.0f);
glm::vec2 u(1.0f); glm::vec2 u(1.0f);
@ -24,17 +24,17 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -24,16 +24,16 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -18,7 +18,7 @@ void print(glm::dmat3 const & Mat0)
printf("\tvec3(%2.3f, %2.3f, %2.3f))\n\n", Mat0[2][0], Mat0[2][1], Mat0[2][2]); printf("\tvec3(%2.3f, %2.3f, %2.3f))\n\n", Mat0[2][0], Mat0[2][1], Mat0[2][2]);
} }
bool test_mat3x3() int test_mat3x3()
{ {
glm::dmat3 Mat0( glm::dmat3 Mat0(
glm::dvec3(0.6f, 0.2f, 0.3f), glm::dvec3(0.6f, 0.2f, 0.3f),
@ -31,10 +31,10 @@ bool test_mat3x3()
print(Inv0); print(Inv0);
print(Res0); print(Res0);
return true; return 0;
} }
static bool test_operators() static int test_operators()
{ {
glm::mat3x3 m(1.0f); glm::mat3x3 m(1.0f);
glm::vec3 u(1.0f); glm::vec3 u(1.0f);
@ -49,17 +49,16 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_mat3x3(); Error += test_mat3x3();
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -24,16 +24,15 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,7 +9,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::mat4x2 m(1.0f); glm::mat4x2 m(1.0f);
glm::vec4 u(1.0f); glm::vec4 u(1.0f);
@ -24,16 +24,15 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,7 +9,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::mat4x3 m(1.0f); glm::mat4x3 m(1.0f);
glm::vec4 u(1.0f); glm::vec4 u(1.0f);
@ -24,17 +24,16 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -21,7 +21,7 @@ void print(glm::dmat4 const & Mat0)
printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]); printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]);
} }
bool test_mat4x4() int test_mat4x4()
{ {
glm::dmat4 Mat0( glm::dmat4 Mat0(
glm::dvec4(0.6f, 0.2f, 0.3f, 0.4f), glm::dvec4(0.6f, 0.2f, 0.3f, 0.4f),
@ -35,7 +35,7 @@ bool test_mat4x4()
print(Inv0); print(Inv0);
print(Res0); print(Res0);
return true; return 0;
} }
static bool test_operators() static bool test_operators()
@ -53,16 +53,15 @@ static bool test_operators()
bool R = m != q; bool R = m != q;
bool S = m == m; bool S = m == m;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_mat4x4(); Error += test_mat4x4();
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,22 +9,21 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::vec4 A(1.0f); glm::vec4 A(1.0f);
glm::vec4 B(1.0f); glm::vec4 B(1.0f);
bool R = A != B; bool R = A != B;
bool S = A == B; bool S = A == B;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,22 +9,21 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::vec4 A(1.0f); glm::vec2 A(1.0f);
glm::vec4 B(1.0f); glm::vec2 B(1.0f);
bool R = A != B; bool R = A != B;
bool S = A == B; bool S = A == B;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -9,22 +9,21 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
static bool test_operators() static int test_operators()
{ {
glm::vec4 A(1.0f); glm::vec3 A(1.0f);
glm::vec4 B(1.0f); glm::vec3 B(1.0f);
bool R = A != B; bool R = A != B;
bool S = A == B; bool S = A == B;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
bool Result = true; int Error = 0;
Result = Result && test_operators(); Error += test_operators();
assert(Result); return Error;
return Result;
} }

@ -31,41 +31,34 @@ enum comp
// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value); // return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value);
//} //}
bool test_hvec4() int test_hvec4()
{ {
glm::hvec4 const A = glm::hvec4(0, 1, 2, 3); glm::hvec4 const A = glm::hvec4(0, 1, 2, 3);
//glm::hvec4 B = glm::swizzle<glm::X, glm::Y, glm::Z, glm::W>(A); //glm::hvec4 B = glm::swizzle<glm::X, glm::Y, glm::Z, glm::W>(A);
//glm::vec4 B = glm::detail::tvec##(glm::vec4::_size)<float>(); //glm::vec4 B = glm::detail::tvec##(glm::vec4::_size)<float>();
return true; return 0;
} }
static bool test_operators() static int test_operators()
{ {
glm::vec4 A(1.0f); glm::vec4 A(1.0f);
glm::vec4 B(1.0f); glm::vec4 B(1.0f);
bool R = A != B; bool R = A != B;
bool S = A == B; bool S = A == B;
return true; return (S && !R) ? 0 : 1;
} }
int main() int main()
{ {
test_hvec4();
//__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); //__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
//__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); //__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
bool Result = true; int Error = 0;
Error += test_operators();
Result = Result && test_operators(); Error += test_hvec4();
Result = Result && test_hvec4(); return Error;
assert(Result);
return Result;
return 0;
} }

@ -13,7 +13,7 @@
int main() int main()
{ {
int Failed = 0; int Error = -1;
return Failed; return Error;
} }

@ -129,6 +129,8 @@ namespace bitRevert
int main() int main()
{ {
::extractField::test(); bool Error = 0;
::bitRevert::test(); Error += ::extractField::test();
Error += ::bitRevert::test();
return Error;
} }

@ -16,7 +16,7 @@ int main()
glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f); glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f); glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
glm::simdVec4 C1 = A1 + B1; glm::simdVec4 C1 = A1 + B1;
glm::simdVec4 D1 = A1.swizzle<glm::X, glm::Z, glm::Y, glm::W>(); //glm::simdVec4 D1 = A1.swizzle<glm::X, glm::Z, glm::Y, glm::W>();
glm::simdVec4 E1(glm::vec4(1.0f)); glm::simdVec4 E1(glm::vec4(1.0f));
glm::vec4 F1 = glm::vec4_cast(E1); glm::vec4 F1 = glm::vec4_cast(E1);
//glm::vec4 G1(E1); //glm::vec4 G1(E1);

Loading…
Cancel
Save