- Fixed ldexp implementation

- Increased assert coverage
- Increased static_assert coverage
- Replaced GLM traits by STL traits when possible
- Allowed including individual core feature
This commit is contained in:
Christophe Riccio
2013-09-16 03:03:49 +02:00
parent cd0519d24b
commit d37d3539ed
46 changed files with 506 additions and 259 deletions

View File

@@ -7,66 +7,66 @@
// File : test/core/func_matrix.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/func_matrix.hpp>
int test_matrixCompMult()
{
int Error(0);
{
glm::mat2 m(0, 1, 2, 3);
glm::mat2 n = glm::matrixCompMult(m, m);
Error += n == glm::mat2(0, 1, 4, 9) ? 0 : 1;
}
int Error(0);
{
glm::mat2 m(0, 1, 2, 3);
glm::mat2 n = glm::matrixCompMult(m, m);
Error += n == glm::mat2(0, 1, 4, 9) ? 0 : 1;
}
{
glm::mat2x3 m(0, 1, 2, 3, 4, 5);
glm::mat2x3 n = glm::matrixCompMult(m, m);
Error += n == glm::mat2x3(0, 1, 4, 9, 16, 25) ? 0 : 1;
}
{
glm::mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7);
glm::mat2x4 n = glm::matrixCompMult(m, m);
Error += n == glm::mat2x4(0, 1, 4, 9, 16, 25, 36, 49) ? 0 : 1;
}
{
glm::mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8);
glm::mat3 n = glm::matrixCompMult(m, m);
Error += n == glm::mat3(0, 1, 4, 9, 16, 25, 36, 49, 64) ? 0 : 1;
}
{
glm::mat3x2 m(0, 1, 2, 3, 4, 5);
glm::mat3x2 n = glm::matrixCompMult(m, m);
Error += n == glm::mat3x2(0, 1, 4, 9, 16, 25) ? 0 : 1;
}
{
glm::mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
glm::mat3x4 n = glm::matrixCompMult(m, m);
Error += n == glm::mat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121) ? 0 : 1;
}
{
glm::mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
glm::mat4 n = glm::matrixCompMult(m, m);
Error += n == glm::mat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225) ? 0 : 1;
}
{
glm::mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7);
glm::mat4x2 n = glm::matrixCompMult(m, m);
Error += n == glm::mat4x2(0, 1, 4, 9, 16, 25, 36, 49) ? 0 : 1;
}
{
glm::mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
glm::mat4x3 n = glm::matrixCompMult(m, m);
Error += n == glm::mat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121) ? 0 : 1;
}
{
glm::mat2x3 m(0, 1, 2, 3, 4, 5);
glm::mat2x3 n = glm::matrixCompMult(m, m);
Error += n == glm::mat2x3(0, 1, 4, 9, 16, 25) ? 0 : 1;
}
{
glm::mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7);
glm::mat2x4 n = glm::matrixCompMult(m, m);
Error += n == glm::mat2x4(0, 1, 4, 9, 16, 25, 36, 49) ? 0 : 1;
}
{
glm::mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8);
glm::mat3 n = glm::matrixCompMult(m, m);
Error += n == glm::mat3(0, 1, 4, 9, 16, 25, 36, 49, 64) ? 0 : 1;
}
{
glm::mat3x2 m(0, 1, 2, 3, 4, 5);
glm::mat3x2 n = glm::matrixCompMult(m, m);
Error += n == glm::mat3x2(0, 1, 4, 9, 16, 25) ? 0 : 1;
}
{
glm::mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
glm::mat3x4 n = glm::matrixCompMult(m, m);
Error += n == glm::mat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121) ? 0 : 1;
}
{
glm::mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
glm::mat4 n = glm::matrixCompMult(m, m);
Error += n == glm::mat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225) ? 0 : 1;
}
{
glm::mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7);
glm::mat4x2 n = glm::matrixCompMult(m, m);
Error += n == glm::mat4x2(0, 1, 4, 9, 16, 25, 36, 49) ? 0 : 1;
}
{
glm::mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
glm::mat4x3 n = glm::matrixCompMult(m, m);
Error += n == glm::mat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121) ? 0 : 1;
}
return Error;
}

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat2x2.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat2x2.hpp>
#include <glm/gtc/epsilon.hpp>
int test_operators()

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat2x3.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat2x3.hpp>
static int test_operators()
{

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat2x4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat2x4.hpp>
static int test_operators()
{

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat3x2.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat3x2.hpp>
static bool test_operators()
{

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat3x3.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat3x3.hpp>
#include <glm/gtc/epsilon.hpp>
#include <cstdio>

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat3x4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat3x4.hpp>
static bool test_operators()
{

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat4x2.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat4x2.hpp>
static int test_operators()
{

View File

@@ -7,7 +7,7 @@
// File : test/core/type_mat4x3.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_mat4x3.hpp>
static int test_operators()
{

View File

@@ -7,8 +7,7 @@
// File : test/core/type_mat4x4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
//#define GLM_PRECISION_HIGHP_FLOAT
#include <glm/glm.hpp>
#include <glm/core/type_mat4x4.hpp>
#include <glm/gtc/epsilon.hpp>
#include <cstdio>

View File

@@ -7,7 +7,8 @@
// File : test/core/type_vec2.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/func_vector_relational.hpp>
#include <glm/core/type_vec2.hpp>
int test_vec2_operators()
{

View File

@@ -8,7 +8,11 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_SWIZZLE
#include <glm/glm.hpp>
#include <glm/core/type_vec2.hpp>
#include <glm/core/type_vec3.hpp>
#include <glm/core/type_vec4.hpp>
#include <glm/core/func_vector_relational.hpp>
#include <glm/core/func_geometric.hpp>
#include <cstdio>
#include <vector>

View File

@@ -7,7 +7,10 @@
// File : test/core/type_vec4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#include <glm/core/type_vec2.hpp>
#include <glm/core/type_vec3.hpp>
#include <glm/core/type_vec4.hpp>
#include <glm/core/func_vector_relational.hpp>
#include <vector>
template <int Value>