The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tests: Resolve warnings

+14 -13
+6 -6
tests/tests_input_transform.cpp
··· 480 480 struct oxr_dpad_binding_modification dpad_binding_modification_val = { 481 481 XR_NULL_PATH, // XrPath binding, unused at this stage 482 482 { 483 - 0.5f, // float forceThreshold 484 - 0.4f, // float forceThresholdReleased 485 - 0.5f, // float centerRegion 486 - M_PI_2, // float wedgeAngle 487 - true, // bool isSticky 483 + 0.5f, // float forceThreshold 484 + 0.4f, // float forceThresholdReleased 485 + 0.5f, // float centerRegion 486 + (float)M_PI_2, // float wedgeAngle 487 + true, // bool isSticky 488 488 }}; 489 489 dpad_binding_modification = &dpad_binding_modification_val; 490 490 ··· 549 549 oxr_log_slog(&log, &slog); 550 550 oxr_input_transform_destroy(&transforms); 551 551 CHECK(NULL == transforms); 552 - } 552 + }
+8 -7
tests/tests_pose.cpp
··· 18 18 // Pick an arbitrary and non-trivial original pose 19 19 struct xrt_pose orig = {}; 20 20 orig.position = {123.f, 456.f, 789.f}; 21 - orig.orientation = {-0.439, -0.561, 0.072, -0.698}; 21 + orig.orientation = {-0.439f, -0.561f, 0.072f, -0.698f}; 22 22 math_quat_normalize(&orig.orientation); 23 23 24 24 // Invert it ··· 26 26 math_pose_invert(&orig, &invert); 27 27 28 28 // Multiply the poses together in both orders 29 - struct xrt_pose out_a, out_b; 29 + struct xrt_pose out_a; 30 30 math_pose_transform(&orig, &invert, &out_a); 31 + struct xrt_pose out_b; 31 32 math_pose_transform(&invert, &orig, &out_b); 32 33 33 34 // A pose multiplied by it's inverse or vice-verse should have both a negligible rotation and position 34 - CHECK(m_vec3_len(out_a.position) < 0.001); 35 - CHECK(1 - abs(out_a.orientation.w) < 0.001); 35 + CHECK(m_vec3_len(out_a.position) < 0.001f); 36 + CHECK(1 - abs(out_a.orientation.w) < 0.001f); 36 37 37 - CHECK(m_vec3_len(out_b.position) < 0.001); 38 - CHECK(1 - abs(out_b.orientation.w) < 0.001); 38 + CHECK(m_vec3_len(out_b.position) < 0.001f); 39 + CHECK(1 - abs(out_b.orientation.w) < 0.001f); 39 40 } 40 41 41 42 TEST_CASE("Pose interpolation works") ··· 56 57 struct xrt_pose res = {}; 57 58 math_pose_interpolate(&a, &b, 0.5, &res); 58 59 59 - float e = std::numeric_limits<float>::epsilon(); 60 + constexpr float e = std::numeric_limits<float>::epsilon(); 60 61 CHECK(res.position.x == Approx(0).margin(e)); 61 62 CHECK(res.position.y == Approx(0).margin(e)); 62 63 CHECK(res.position.z == Approx(0).margin(e));