Added test for == operators

This commit is contained in:
Christophe Riccio 2011-01-19 12:48:04 +00:00
parent c9bc025081
commit 4cb312773e
13 changed files with 87 additions and 4 deletions

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat2x2 o = m / x; glm::mat2x2 o = m / x;
glm::mat2x2 p = x * m; glm::mat2x2 p = x * m;
glm::mat2x2 q = m * x; glm::mat2x2 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat2x3 o = m / x; glm::mat2x3 o = m / x;
glm::mat2x3 p = x * m; glm::mat2x3 p = x * m;
glm::mat2x3 q = m * x; glm::mat2x3 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat2x4 o = m / x; glm::mat2x4 o = m / x;
glm::mat2x4 p = x * m; glm::mat2x4 p = x * m;
glm::mat2x4 q = m * x; glm::mat2x4 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat3x2 o = m / x; glm::mat3x2 o = m / x;
glm::mat3x2 p = x * m; glm::mat3x2 p = x * m;
glm::mat3x2 q = m * x; glm::mat3x2 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -46,6 +46,8 @@ static bool test_operators()
glm::mat3x3 o = m / x; glm::mat3x3 o = m / x;
glm::mat3x3 p = x * m; glm::mat3x3 p = x * m;
glm::mat3x3 q = m * x; glm::mat3x3 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat3x4 o = m / x; glm::mat3x4 o = m / x;
glm::mat3x4 p = x * m; glm::mat3x4 p = x * m;
glm::mat3x4 q = m * x; glm::mat3x4 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat4x2 o = m / x; glm::mat4x2 o = m / x;
glm::mat4x2 p = x * m; glm::mat4x2 p = x * m;
glm::mat4x2 q = m * x; glm::mat4x2 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -21,6 +21,8 @@ static bool test_operators()
glm::mat4x3 o = m / x; glm::mat4x3 o = m / x;
glm::mat4x3 p = x * m; glm::mat4x3 p = x * m;
glm::mat4x3 q = m * x; glm::mat4x3 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

@ -48,6 +48,8 @@ static bool test_operators()
glm::mat4x4 o = m / x; glm::mat4x4 o = m / x;
glm::mat4x4 p = x * m; glm::mat4x4 p = x * m;
glm::mat4x4 q = m * x; glm::mat4x4 q = m * x;
bool R = m != q;
bool S = m == m;
return true; return true;
} }

View File

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

View File

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

View File

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

View File

@ -33,12 +33,24 @@ __m128 swizzle(glm::vec4 const & v)
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);
} }
void test_hvec4() bool 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;
}
static bool test_operators()
{
glm::vec4 A(1.0f);
glm::vec4 B(1.0f);
bool R = A != B;
bool S = A == B;
return true;
} }
int main() int main()
@ -48,6 +60,14 @@ int main()
__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;
Result = Result && test_operators();
Result = Result && test_hvec4();
assert(Result);
return Result;
return 0; return 0;
} }