Fixed B /= B.y bug for all assignment operators of vector classes. #116

This commit is contained in:
Christophe Riccio
2013-09-17 21:37:40 +02:00
parent aa0b2a5e28
commit b258af3e67
9 changed files with 112 additions and 262 deletions

View File

@@ -153,6 +153,12 @@ int test_vec2_operators()
B /= 2.0f;
Error += B == glm::vec2(2, 1.25) ? 0 : 1;
}
{
glm::vec2 B(2.0f);
B /= B.y;
Error += B == glm::vec2(1.0f) ? 0 : 1;
}
{
glm::vec2 A(1.0f, 2.0f);

View File

@@ -135,6 +135,12 @@ int test_vec3_operators()
B /= 2.0f;
Error += B == glm::vec3(2, 1.25, 1) ? 0 : 1;
}
{
glm::vec3 B(2.0f);
B /= B.y;
Error += B == glm::vec3(1.0f) ? 0 : 1;
}
{
glm::vec3 A(1.0f, 2.0f, 3.0f);

View File

@@ -158,6 +158,12 @@ int test_vec4_operators()
B /= 2.0f;
Error += B == glm::vec4(2, 1.25, 1, 7.0f / 4.0f / 2.0f) ? 0 : 1;
}
{
glm::vec4 B(2.0f);
B /= B.y;
Error += B == glm::vec4(1.0f) ? 0 : 1;
}
{
glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f);