Skip to content

Commit

Permalink
gne
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Jan 17, 2024
1 parent 2361ad1 commit 732aadf
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 10 deletions.
7 changes: 6 additions & 1 deletion test/core/core_type_mat2x2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr");

constexpr glm::mat2x2 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat2x2(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat2x3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat2x3::length() == 2, "GLM: Failed constexpr");

constexpr glm::mat2x3 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat2x3(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat2x4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat2x4::length() == 2, "GLM: Failed constexpr");

constexpr glm::mat2x4 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat2x4(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat3x2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat3x2::length() == 3, "GLM: Failed constexpr");

constexpr glm::mat3x2 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat3x2(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 5 additions & 2 deletions test/core/core_type_mat3x3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr");

constexpr glm::mat3x3 const Z(0.0f);
constexpr glm::mat3x3 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat3x3(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat3x4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat3x4::length() == 3, "GLM: Failed constexpr");

constexpr glm::mat3x4 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat3x4(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat4x2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat4x2::length() == 4, "GLM: Failed constexpr");

constexpr glm::mat4x2 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat4x2(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat4x3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,16 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat4x3::length() == 4, "GLM: Failed constexpr");

constexpr glm::mat4x3 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat4x3(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down
7 changes: 6 additions & 1 deletion test/core/core_type_mat4x4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,20 @@ static int test_size()

static int test_constexpr()
{
int Error = 0;

#if GLM_HAS_CONSTEXPR
static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr");
constexpr glm::mat4 A(1.f);
constexpr glm::mat4 B(1.f);
constexpr glm::bvec4 C = glm::equal(A, B, 0.01f);
static_assert(glm::all(C), "GLM: Failed constexpr");

constexpr glm::mat4 const Z(1.0f);
Error += glm::all(glm::equal(Z, glm::mat4(1.0f), glm::epsilon<float>())) ? 0 : 1;
#endif

return 0;
return Error;
}

int main()
Expand Down

0 comments on commit 732aadf

Please sign in to comment.