From 2f1873f04e23e354d231e9491cf568deb5f8a8ad Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 25 Sep 2023 20:51:16 +0900 Subject: [PATCH] test/capi: update unit tests added a Tvg_Composite_Method::TVG_COMPOSITE_METHOD_NONE case --- test/capi/capiPaint.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/capi/capiPaint.cpp b/test/capi/capiPaint.cpp index 3c863d4a..f2655ca9 100644 --- a/test/capi/capiPaint.cpp +++ b/test/capi/capiPaint.cpp @@ -321,18 +321,23 @@ TEST_CASE("Paint LumaMask Composite Method", "[capiPaint]") REQUIRE(tvg_paint_set_composite_method(paint, NULL, TVG_COMPOSITE_METHOD_NONE) == TVG_RESULT_SUCCESS); REQUIRE(tvg_paint_set_composite_method(paint, target, TVG_COMPOSITE_METHOD_NONE) == TVG_RESULT_INVALID_ARGUMENT); REQUIRE(tvg_paint_set_composite_method(paint, NULL, TVG_COMPOSITE_METHOD_LUMA_MASK) == TVG_RESULT_INVALID_ARGUMENT); + REQUIRE(tvg_paint_set_composite_method(paint, NULL, TVG_COMPOSITE_METHOD_INVERSE_LUMA_MASK) == TVG_RESULT_INVALID_ARGUMENT); Tvg_Paint* target2 = tvg_shape_new(); REQUIRE(target2); REQUIRE(tvg_paint_set_composite_method(paint, target2, TVG_COMPOSITE_METHOD_LUMA_MASK) == TVG_RESULT_SUCCESS); - const Tvg_Paint* target3 = nullptr; + Tvg_Paint* target3 = tvg_shape_new(); + REQUIRE(target3); + REQUIRE(tvg_paint_set_composite_method(paint, target3, TVG_COMPOSITE_METHOD_INVERSE_LUMA_MASK) == TVG_RESULT_SUCCESS); + + const Tvg_Paint* target4 = nullptr; Tvg_Composite_Method method = TVG_COMPOSITE_METHOD_NONE; REQUIRE(tvg_paint_get_composite_method(paint, NULL, &method) == TVG_RESULT_INVALID_ARGUMENT); - REQUIRE(tvg_paint_get_composite_method(paint, &target3, NULL) == TVG_RESULT_INVALID_ARGUMENT); - REQUIRE(tvg_paint_get_composite_method(paint, &target3, &method) == TVG_RESULT_SUCCESS); - REQUIRE(method == TVG_COMPOSITE_METHOD_LUMA_MASK); - REQUIRE(target2 == target3); + REQUIRE(tvg_paint_get_composite_method(paint, &target4, NULL) == TVG_RESULT_INVALID_ARGUMENT); + REQUIRE(tvg_paint_get_composite_method(paint, &target4, &method) == TVG_RESULT_SUCCESS); + REQUIRE(method == TVG_COMPOSITE_METHOD_INVERSE_LUMA_MASK); + REQUIRE(target3 == target4); REQUIRE(tvg_paint_del(paint) == TVG_RESULT_SUCCESS); }