From bfd4d811e8e41a270996a7d24b03832bff8c0f3d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 1 May 2022 14:04:27 +0100 Subject: [PATCH] tests: Fix conversion warnings --- tests/tests_quatexpmap.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/tests_quatexpmap.cpp b/tests/tests_quatexpmap.cpp index 881b8bfe7..1b650895e 100644 --- a/tests/tests_quatexpmap.cpp +++ b/tests/tests_quatexpmap.cpp @@ -22,10 +22,10 @@ TEST_CASE("m_quatexpmap") SECTION("Test integrate velocity and finite difference mappings") { vector q1_axes{{axis1, axis2}}; - float q1_angle = GENERATE(M_PI, -M_PI / 6); + float q1_angle = (float)GENERATE(M_PI, -M_PI / 6); vector vel_axes{{axis3, axis4}}; - float vel_angle = GENERATE(-M_PI, M_PI / 5); - float dt = GENERATE(0.01, 0.1, 1); + float vel_angle = (float)GENERATE(-M_PI, M_PI / 5); + float dt = (float)GENERATE(0.01, 0.1, 1); for (xrt_vec3 q1_axis : q1_axes) { for (xrt_vec3 vel_axis : vel_axes) { @@ -58,7 +58,12 @@ TEST_CASE("m_quatexpmap") SECTION("Test quat_exp and quat_ln are inverses") { // We use rotations with less than PI radians as quat_ln will return the negative rotation otherwise - vector aas = {{0, 0, 0}, axis1 * M_PI * 0.01, axis2 * M_PI * 0.5, axis3 * 0.99 * M_PI}; + vector aas = { + {0, 0, 0}, + axis1 * (float)M_PI * 0.01f, + axis2 * (float)M_PI * 0.5f, + axis3 * (float)M_PI * 0.99f, + }; for (xrt_vec3 aa : aas) { xrt_quat quat{};