From dbb0fc9476371a3d0bcd895ae40d4754529f3fb9 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 7 Jun 2024 12:56:04 +0900 Subject: [PATCH] test: resolve compiler warnings on msvc. warning C4305: 'argument': truncation from 'double' to 'float' --- test/capi/capiShape.cpp | 4 ++-- test/testShape.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/capi/capiShape.cpp b/test/capi/capiShape.cpp index 0c260dce..3813b92a 100644 --- a/test/capi/capiShape.cpp +++ b/test/capi/capiShape.cpp @@ -260,8 +260,8 @@ TEST_CASE("Stroke trim", "[capiStrokeTrim]") REQUIRE(tvg_shape_get_stroke_trim(NULL, &begin, &end, &simultaneous) == TVG_RESULT_INVALID_ARGUMENT); REQUIRE(tvg_shape_get_stroke_trim(paint, &begin, &end, &simultaneous) == TVG_RESULT_SUCCESS); - REQUIRE(tvg_shape_set_stroke_trim(NULL, 0.33, 0.66, false) == TVG_RESULT_INVALID_ARGUMENT); - REQUIRE(tvg_shape_set_stroke_trim(paint, 0.33, 0.66, false) == TVG_RESULT_SUCCESS); + REQUIRE(tvg_shape_set_stroke_trim(NULL, 0.33f, 0.66f, false) == TVG_RESULT_INVALID_ARGUMENT); + REQUIRE(tvg_shape_set_stroke_trim(paint, 0.33f, 0.66f, false) == TVG_RESULT_SUCCESS); REQUIRE(tvg_shape_get_stroke_trim(paint, &begin, &end, &simultaneous) == TVG_RESULT_SUCCESS); REQUIRE(begin == Approx(0.33).margin(0.000001)); REQUIRE(end == Approx(0.66).margin(0.000001)); diff --git a/test/testShape.cpp b/test/testShape.cpp index 7c0a598b..de43c406 100644 --- a/test/testShape.cpp +++ b/test/testShape.cpp @@ -205,7 +205,7 @@ TEST_CASE("Stroking", "[tvgShape]") REQUIRE(begin == Approx(0.0).margin(0.000001)); REQUIRE(end == Approx(1.0).margin(0.000001)); - REQUIRE(shape->strokeTrim(0.3, 0.88, false) == Result::Success); + REQUIRE(shape->strokeTrim(0.3f, 0.88f, false) == Result::Success); REQUIRE(shape->strokeTrim(&begin, &end) == false); REQUIRE(begin == Approx(0.3).margin(0.000001)); REQUIRE(end == Approx(0.88).margin(0.000001));