diff options
author | rtk0c <[email protected]> | 2025-08-16 11:23:49 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-08-16 11:23:49 -0700 |
commit | 047f294de1b4d385b811ac9f5afc393d81cc4ae9 (patch) | |
tree | f96100a813a4ffb28dcd074455d3a2f8ee426430 /3rdparty/glm/source/test/gtx/gtx_string_cast.cpp | |
parent | 488fb8b4b9da7f99a5cc37e39fff9f1cb700f2a8 (diff) |
Copy changes from the no-history fork, generated back in 2023
Original commit message:
> commit f138311d2d2e0cc9ba0496d523bb46f2c1c9fb73
> Author: rtk0c <[email protected]>
> Date: Wed Sep 20 23:58:58 2023 -0700
>
> Copy from the PlasticSCM repo, replace vendored glm wtih conan
In reality, this also introduced a few uncommitted changes in the
original PlasticSCM repo. See the modified and new files in this patch.
Diffstat (limited to '3rdparty/glm/source/test/gtx/gtx_string_cast.cpp')
-rw-r--r-- | 3rdparty/glm/source/test/gtx/gtx_string_cast.cpp | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp b/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp deleted file mode 100644 index b04c870..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include <glm/glm.hpp> -#include <glm/gtx/string_cast.hpp> -#include <limits> - -int test_string_cast_vector() -{ - int Error = 0; - - { - glm::vec2 A1(1, 2); - std::string A2 = glm::to_string(A1); - Error += A2 != std::string("vec2(1.000000, 2.000000)") ? 1 : 0; - - glm::vec3 B1(1, 2, 3); - std::string B2 = glm::to_string(B1); - Error += B2 != std::string("vec3(1.000000, 2.000000, 3.000000)") ? 1 : 0; - - glm::vec4 C1(1, 2, 3, 4); - std::string C2 = glm::to_string(C1); - Error += C2 != std::string("vec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0; - - glm::dvec2 J1(1, 2); - std::string J2 = glm::to_string(J1); - Error += J2 != std::string("dvec2(1.000000, 2.000000)") ? 1 : 0; - - glm::dvec3 K1(1, 2, 3); - std::string K2 = glm::to_string(K1); - Error += K2 != std::string("dvec3(1.000000, 2.000000, 3.000000)") ? 1 : 0; - - glm::dvec4 L1(1, 2, 3, 4); - std::string L2 = glm::to_string(L1); - Error += L2 != std::string("dvec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0; - } - - { - glm::bvec2 M1(false, true); - std::string M2 = glm::to_string(M1); - Error += M2 != std::string("bvec2(false, true)") ? 1 : 0; - - glm::bvec3 O1(false, true, false); - std::string O2 = glm::to_string(O1); - Error += O2 != std::string("bvec3(false, true, false)") ? 1 : 0; - - glm::bvec4 P1(false, true, false, true); - std::string P2 = glm::to_string(P1); - Error += P2 != std::string("bvec4(false, true, false, true)") ? 1 : 0; - } - - { - glm::ivec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("ivec2(1, 2)") ? 1 : 0; - - glm::ivec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("ivec3(1, 2, 3)") ? 1 : 0; - - glm::ivec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("ivec4(1, 2, 3, 4)") ? 1 : 0; - } - - { - glm::i8vec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("i8vec2(1, 2)") ? 1 : 0; - - glm::i8vec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("i8vec3(1, 2, 3)") ? 1 : 0; - - glm::i8vec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("i8vec4(1, 2, 3, 4)") ? 1 : 0; - } - - { - glm::i16vec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("i16vec2(1, 2)") ? 1 : 0; - - glm::i16vec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("i16vec3(1, 2, 3)") ? 1 : 0; - - glm::i16vec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("i16vec4(1, 2, 3, 4)") ? 1 : 0; - } - - { - glm::i64vec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("i64vec2(1, 2)") ? 1 : 0; - - glm::i64vec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("i64vec3(1, 2, 3)") ? 1 : 0; - - glm::i64vec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("i64vec4(1, 2, 3, 4)") ? 1 : 0; - } - - return Error; -} - -int test_string_cast_matrix() -{ - int Error = 0; - - glm::mat2x2 A1(1.000000, 2.000000, 3.000000, 4.000000); - std::string A2 = glm::to_string(A1); - Error += A2 != std::string("mat2x2((1.000000, 2.000000), (3.000000, 4.000000))") ? 1 : 0; - - return Error; -} - -int test_string_cast_quaternion() -{ - int Error = 0; - - glm::quat Q0 = glm::quat(1.0f, 2.0f, 3.0f, 4.0f); - std::string S0 = glm::to_string(Q0); - Error += S0 != std::string("quat(1.000000, {2.000000, 3.000000, 4.000000})") ? 1 : 0; - - return Error; - -} - -int test_string_cast_dual_quaternion() -{ - int Error = 0; - - glm::dualquat Q0 = glm::dualquat(glm::quat(1.0f, 2.0f, 3.0f, 4.0f), glm::quat(5.0f, 6.0f, 7.0f, 8.0f)); - std::string S0 = glm::to_string(Q0); - Error += S0 != std::string("dualquat((1.000000, {2.000000, 3.000000, 4.000000}), (5.000000, {6.000000, 7.000000, 8.000000}))") ? 1 : 0; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_string_cast_vector(); - Error += test_string_cast_matrix(); - Error += test_string_cast_quaternion(); - Error += test_string_cast_dual_quaternion(); - - return Error; -} - - |