From c30eda289b5815b6b62799ef986eaf3c462fd72d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 31 Mar 2025 01:18:03 +0100 Subject: Add SvgIcon class Based on Icon class, but constructor replaced with calls to lunasvg. --- test/test-ui.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/test-ui.cpp (limited to 'test/test-ui.cpp') diff --git a/test/test-ui.cpp b/test/test-ui.cpp new file mode 100644 index 0000000..2810cda --- /dev/null +++ b/test/test-ui.cpp @@ -0,0 +1,20 @@ +#define BOOST_TEST_MODULE UI +#include +#include + +#include "testMainWindow.h" +#include +#include +#include + +constexpr GLsizei RENDER_SIZE = 64; + +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); + +BOOST_AUTO_TEST_CASE(LoadFromFile) +{ + SvgIcon svg(ImageDimensions {RENDER_SIZE}, Resource::mapPath("ui/icon/rails.svg")); + const auto size = Texture::getSize(svg.texture); + BOOST_CHECK_EQUAL(size, TextureDimensions(RENDER_SIZE, RENDER_SIZE, 1)); + Texture::save(svg.texture, "/tmp/rails.tga"); +} -- cgit v1.2.3