test/lottie: added the slot resetting use case

This commit is contained in:
Jinny You 2024-03-21 15:09:53 +09:00 committed by Hermet Park
parent 3cb8c4311d
commit 62e7f0a7c6
2 changed files with 24 additions and 2 deletions

View file

@ -46,8 +46,19 @@ TEST_CASE("Lottie Slot", "[capiLottie]")
//Slot override before loaded
REQUIRE(tvg_lottie_animation_override(animation, slotJson) == TVG_RESULT_INSUFFICIENT_CONDITION);
//Slot override
//Animation load
REQUIRE(tvg_picture_load(picture, TEST_DIR"/lottieslot.json") == TVG_RESULT_SUCCESS);
//Slot revert before overriding
REQUIRE(tvg_lottie_animation_override(animation, nullptr) == TVG_RESULT_SUCCESS);
//Slot override
REQUIRE(tvg_lottie_animation_override(animation, slotJson) == TVG_RESULT_SUCCESS);
//Slot revert
REQUIRE(tvg_lottie_animation_override(animation, nullptr) == TVG_RESULT_SUCCESS);
//Slot override after reverting
REQUIRE(tvg_lottie_animation_override(animation, slotJson) == TVG_RESULT_SUCCESS);
//Slot override with invalid JSON

View file

@ -47,8 +47,19 @@ TEST_CASE("Lottie Slot", "[tvgLottie]")
//Slot override before loaded
REQUIRE(animation->override(slotJson) == Result::InsufficientCondition);
//Slot override
//Animation load
REQUIRE(picture->load(TEST_DIR"/lottieslot.json") == Result::Success);
//Slot revert before overriding
REQUIRE(animation->override(nullptr) == Result::Success);
//Slot override
REQUIRE(animation->override(slotJson) == Result::Success);
//Slot revert
REQUIRE(animation->override(nullptr) == Result::Success);
//Slot override after reverting
REQUIRE(animation->override(slotJson) == Result::Success);
//Slot override with invalid JSON