From: Michal Maciola Date: Wed, 18 Aug 2021 13:56:59 +0000 (+0200) Subject: utc: increase coverage up X-Git-Tag: accepted/tizen/unified/20210827.122304~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a8f96894c97da8861b30da89e0a375181f8fd37;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git utc: increase coverage up --- diff --git a/test/images/tag.svg b/test/images/tag.svg index 4533376..4d3542a 100644 --- a/test/images/tag.svg +++ b/test/images/tag.svg @@ -1,6 +1,6 @@ - + @@ -20,16 +20,20 @@ + + + + - + - + diff --git a/test/testPicture.cpp b/test/testPicture.cpp index 53b48f4..6be9189 100644 --- a/test/testPicture.cpp +++ b/test/testPicture.cpp @@ -208,8 +208,8 @@ TEST_CASE("Load SVG file and render", "[tvgPicture]") auto canvas = SwCanvas::gen(); REQUIRE(canvas); - uint32_t buffer[100*100]; - REQUIRE(canvas->target(buffer, 100, 100, 100, SwCanvas::Colorspace::ABGR8888) == Result::Success); + uint32_t buffer[1000*1000]; + REQUIRE(canvas->target(buffer, 1000, 1000, 1000, SwCanvas::Colorspace::ABGR8888) == Result::Success); auto picture = Picture::gen(); REQUIRE(picture); @@ -260,3 +260,33 @@ TEST_CASE("Load JPG file and render", "[tvgPicture]") REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success); } + +TEST_CASE("Load RAW 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); + + string path(TEST_DIR"/rawimage_200x300.raw"); + + ifstream file(path); + if (!file.is_open()) return; + auto data = (uint32_t*)malloc(sizeof(uint32_t) * (200*300)); + file.read(reinterpret_cast(data), sizeof (uint32_t) * 200 * 300); + file.close(); + + REQUIRE(picture->load(data, 200, 300, false) == Result::Success); + + REQUIRE(canvas->push(move(picture)) == Result::Success); + + REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success); + + free(data); +}