mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
test: svg rendering
Added SVG file loading and rendering for increasing TC Line coverage Line coverage for src/loaders/svg: 85.5%
This commit is contained in:
parent
9b276cc5fa
commit
a8e13ed2b7
1 changed files with 21 additions and 1 deletions
|
@ -130,4 +130,24 @@ TEST_CASE("Picture Size", "[tvgPicture]")
|
||||||
REQUIRE(picture->load(EXAMPLE_DIR"/tiger.svg") == Result::Success);
|
REQUIRE(picture->load(EXAMPLE_DIR"/tiger.svg") == Result::Success);
|
||||||
REQUIRE(picture->size(&w, &h) == Result::Success);
|
REQUIRE(picture->size(&w, &h) == Result::Success);
|
||||||
REQUIRE(picture->size(w, h) == Result::Success);
|
REQUIRE(picture->size(w, h) == Result::Success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Load SVG file and render", "[tvgPicture]")
|
||||||
|
{
|
||||||
|
REQUIRE(Initializer::init(CanvasEngine::Sw, 0) == Result::Success);
|
||||||
|
|
||||||
|
auto canvas = SwCanvas::gen();
|
||||||
|
REQUIRE(canvas);
|
||||||
|
|
||||||
|
uint32_t buffer[100*100];
|
||||||
|
REQUIRE(canvas->target(buffer, 100, 100, 100, SwCanvas::Colorspace::ABGR8888) == Result::Success);
|
||||||
|
|
||||||
|
auto picture = Picture::gen();
|
||||||
|
REQUIRE(picture);
|
||||||
|
|
||||||
|
REQUIRE(picture->load(EXAMPLE_DIR"/logo_test.svg") == Result::Success);
|
||||||
|
|
||||||
|
REQUIRE(canvas->push(move(picture)) == Result::Success);
|
||||||
|
|
||||||
|
REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue