mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-21 15:32:49 +00:00
test capi: scene added negative tests
This commit is contained in:
parent
1c30bb391f
commit
9b276cc5fa
1 changed files with 14 additions and 7 deletions
|
@ -41,8 +41,9 @@ TEST_CASE("Paints Into a Scene", "[capiScene]")
|
|||
REQUIRE(tvg_scene_push(scene, tvg_picture_new()) == TVG_RESULT_SUCCESS);
|
||||
REQUIRE(tvg_scene_push(scene, tvg_scene_new()) == TVG_RESULT_SUCCESS);
|
||||
|
||||
//Pusing Null Pointer
|
||||
//Pushing Null Pointer
|
||||
REQUIRE(tvg_scene_push(scene, NULL) == TVG_RESULT_INVALID_ARGUMENT);
|
||||
REQUIRE(tvg_scene_push(NULL, NULL) == TVG_RESULT_INVALID_ARGUMENT);
|
||||
|
||||
REQUIRE(tvg_paint_del(scene) == TVG_RESULT_SUCCESS);
|
||||
}
|
||||
|
@ -61,6 +62,9 @@ TEST_CASE("Scene Reservation", "[capiScene]")
|
|||
//Too big size
|
||||
REQUIRE(tvg_scene_reserve(scene, -1) == TVG_RESULT_FAILED_ALLOCATION);
|
||||
|
||||
//Invalid scene
|
||||
REQUIRE(tvg_scene_reserve(NULL, 1) == TVG_RESULT_INVALID_ARGUMENT);
|
||||
|
||||
REQUIRE(tvg_paint_del(scene) == TVG_RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -72,6 +76,9 @@ TEST_CASE("Clear the Scene", "[capiScene]")
|
|||
REQUIRE(tvg_scene_push(scene, tvg_shape_new()) == TVG_RESULT_SUCCESS);
|
||||
REQUIRE(tvg_scene_clear(scene, true) == TVG_RESULT_SUCCESS);
|
||||
|
||||
//Invalid scene
|
||||
REQUIRE(tvg_scene_clear(NULL, false) == TVG_RESULT_INVALID_ARGUMENT);
|
||||
|
||||
REQUIRE(tvg_paint_del(scene) == TVG_RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue