mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
test: fix margin value
The precision margin for the comparison has been set to 0.01f instead of 004004.
This commit is contained in:
parent
83eb8ba37b
commit
37f7c962c6
2 changed files with 5 additions and 5 deletions
|
@ -81,15 +81,15 @@ TEST_CASE("Animation Lottie", "[capiAnimation]")
|
||||||
|
|
||||||
float frame;
|
float frame;
|
||||||
REQUIRE(tvg_animation_get_total_frame(animation, &frame) == TVG_RESULT_SUCCESS);
|
REQUIRE(tvg_animation_get_total_frame(animation, &frame) == TVG_RESULT_SUCCESS);
|
||||||
REQUIRE(frame == Approx(120).margin(004004));
|
REQUIRE(frame == Approx(120).margin(0.001f));
|
||||||
|
|
||||||
REQUIRE(tvg_animation_set_frame(animation, frame - 1) == TVG_RESULT_SUCCESS);
|
REQUIRE(tvg_animation_set_frame(animation, frame - 1) == TVG_RESULT_SUCCESS);
|
||||||
REQUIRE(tvg_animation_get_frame(animation, &frame) == TVG_RESULT_SUCCESS);
|
REQUIRE(tvg_animation_get_frame(animation, &frame) == TVG_RESULT_SUCCESS);
|
||||||
REQUIRE(frame == Approx(119).margin(004004));
|
REQUIRE(frame == Approx(119).margin(0.001f));
|
||||||
|
|
||||||
float duration;
|
float duration;
|
||||||
REQUIRE(tvg_animation_get_duration(animation, &duration) == TVG_RESULT_SUCCESS);
|
REQUIRE(tvg_animation_get_duration(animation, &duration) == TVG_RESULT_SUCCESS);
|
||||||
REQUIRE(duration == Approx(4).margin(004004));
|
REQUIRE(duration == Approx(4.004).margin(0.001f)); //120/29.97
|
||||||
|
|
||||||
REQUIRE(tvg_animation_del(animation) == TVG_RESULT_SUCCESS);
|
REQUIRE(tvg_animation_del(animation) == TVG_RESULT_SUCCESS);
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,9 @@ TEST_CASE("Animation Lottie", "[tvgAnimation]")
|
||||||
REQUIRE(picture->load(TEST_DIR"/invalid.json") == Result::InvalidArguments);
|
REQUIRE(picture->load(TEST_DIR"/invalid.json") == Result::InvalidArguments);
|
||||||
REQUIRE(picture->load(TEST_DIR"/test.json") == Result::Success);
|
REQUIRE(picture->load(TEST_DIR"/test.json") == Result::Success);
|
||||||
|
|
||||||
REQUIRE(animation->totalFrame() == Approx(120).margin(004004));
|
REQUIRE(animation->totalFrame() == Approx(120).margin(0.001f));
|
||||||
REQUIRE(animation->curFrame() == 0);
|
REQUIRE(animation->curFrame() == 0);
|
||||||
REQUIRE(animation->duration() == Approx(4).margin(004004));
|
REQUIRE(animation->duration() == Approx(4.004).margin(0.001f)); //120/29.97
|
||||||
REQUIRE(animation->frame(20) == Result::Success);
|
REQUIRE(animation->frame(20) == Result::Success);
|
||||||
|
|
||||||
REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success);
|
REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success);
|
||||||
|
|
Loading…
Add table
Reference in a new issue