From: Hermet Park Date: Tue, 9 Nov 2021 06:05:55 +0000 (+0900) Subject: test capi: fix the memory leak. X-Git-Tag: accepted/tizen/unified/20211112.135649~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92424cb75a1756eae023d0279fdd0be1c1172bf2;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git test capi: fix the memory leak. target is dangled without any proper deletion... --- diff --git a/test/capi/capiPaint.cpp b/test/capi/capiPaint.cpp index 8cbb102..c0b17af 100644 --- a/test/capi/capiPaint.cpp +++ b/test/capi/capiPaint.cpp @@ -216,24 +216,20 @@ TEST_CASE("Paint Clip Path Composite Method", "[capiPaint]") REQUIRE(target); 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_CLIP_PATH) == TVG_RESULT_INVALID_ARGUMENT); Tvg_Paint* target2 = tvg_shape_new(); REQUIRE(target2); - REQUIRE(tvg_paint_set_composite_method(paint, target2, TVG_COMPOSITE_METHOD_NONE) == TVG_RESULT_INVALID_ARGUMENT); - - REQUIRE(tvg_paint_set_composite_method(paint, NULL, TVG_COMPOSITE_METHOD_CLIP_PATH) == TVG_RESULT_INVALID_ARGUMENT); - - Tvg_Paint* target3 = tvg_shape_new(); - REQUIRE(target3); - REQUIRE(tvg_paint_set_composite_method(paint, target3, TVG_COMPOSITE_METHOD_CLIP_PATH) == TVG_RESULT_SUCCESS); + REQUIRE(tvg_paint_set_composite_method(paint, target2, TVG_COMPOSITE_METHOD_CLIP_PATH) == TVG_RESULT_SUCCESS); - const Tvg_Paint* target4 = nullptr; + const Tvg_Paint* target3 = 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, &target4, NULL) == TVG_RESULT_INVALID_ARGUMENT); - REQUIRE(tvg_paint_get_composite_method(paint, &target4, &method) == TVG_RESULT_SUCCESS); + 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_CLIP_PATH); - REQUIRE(target3 == target4); + REQUIRE(target2 == target3); REQUIRE(tvg_paint_del(paint) == TVG_RESULT_SUCCESS); } diff --git a/test/images/tag.tvg b/test/images/tag.tvg index 3e88cf1..5d76b96 100644 Binary files a/test/images/tag.tvg and b/test/images/tag.tvg differ