summaryrefslogtreecommitdiff
path: root/test/test-ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-ui.cpp')
-rw-r--r--test/test-ui.cpp20
1 files changed, 20 insertions, 0 deletions
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 <boost/test/unit_test.hpp>
+#include <stream_support.h>
+
+#include "testMainWindow.h"
+#include <gfx/models/texture.h>
+#include <resource.h>
+#include <ui/svgIcon.h>
+
+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");
+}