From 0cd256f99ca8c50027988b41ec4d775b3068793b 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 fefc4ac5..17132fdd 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 077296fe..05943b0b 100644 --- a/test/testShape.cpp +++ b/test/testShape.cpp @@ -209,7 +209,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));