mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
tests: ++lcov
This commit is contained in:
parent
21dad77da6
commit
7e30bd850c
4 changed files with 39 additions and 0 deletions
Binary file not shown.
1
test/resources/test11.json
Normal file
1
test/resources/test11.json
Normal file
File diff suppressed because one or more lines are too long
1
test/resources/test12.json
Normal file
1
test/resources/test12.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -239,6 +239,43 @@ TEST_CASE("Animation Lottie10", "[tvgAnimation]")
|
|||
REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success);
|
||||
}
|
||||
|
||||
TEST_CASE("Animation Lottie11", "[tvgAnimation]")
|
||||
{
|
||||
REQUIRE(Initializer::init(tvg::CanvasEngine::Sw, 0) == Result::Success);
|
||||
|
||||
auto animation = Animation::gen();
|
||||
REQUIRE(animation);
|
||||
|
||||
auto picture = animation->picture();
|
||||
|
||||
ifstream file(TEST_DIR"/test11.json");
|
||||
REQUIRE(file.is_open());
|
||||
file.seekg(0, std::ios::end);
|
||||
auto size = file.tellg();
|
||||
file.seekg(0, std::ios::beg);
|
||||
auto data = (char*)malloc(size);
|
||||
file.seekg(0, ios::beg);
|
||||
file.read(data, size);
|
||||
file.close();
|
||||
REQUIRE(picture->load(data, size, "json", true) == Result::Success);
|
||||
|
||||
REQUIRE(Initializer::term(tvg::CanvasEngine::Sw) == Result::Success);
|
||||
}
|
||||
|
||||
TEST_CASE("Animation Lottie12", "[tvgAnimation]")
|
||||
{
|
||||
REQUIRE(Initializer::init(tvg::CanvasEngine::Sw, 0) == Result::Success);
|
||||
|
||||
auto animation = Animation::gen();
|
||||
REQUIRE(animation);
|
||||
|
||||
auto picture = animation->picture();
|
||||
|
||||
REQUIRE(picture->load(TEST_DIR"/test12.json") == Result::Success);
|
||||
|
||||
REQUIRE(Initializer::term(tvg::CanvasEngine::Sw) == Result::Success);
|
||||
}
|
||||
|
||||
TEST_CASE("Animation Segment", "[tvgAnimation]")
|
||||
{
|
||||
REQUIRE(Initializer::init(tvg::CanvasEngine::Sw, 0) == Result::Success);
|
||||
|
|
Loading…
Add table
Reference in a new issue