summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-06-15 15:28:53 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-06-15 15:28:53 +0100
commit02c3f1fd622bb5b4da1462c5bb507a4a541447d5 (patch)
tree8db9ad8cc755cdab17d11a97309b3b147c576964 /test
parentAdd imgui init and shutdown to appbase and gamemainwindow (diff)
downloadilt-02c3f1fd622bb5b4da1462c5bb507a4a541447d5.tar.bz2
ilt-02c3f1fd622bb5b4da1462c5bb507a4a541447d5.tar.xz
ilt-02c3f1fd622bb5b4da1462c5bb507a4a541447d5.zip
First cut reshuffling app/window/gl/render bits
Diffstat (limited to 'test')
-rw-r--r--test/test-assetFactory.cpp4
-rw-r--r--test/test-glContainer.cpp4
-rw-r--r--test/test-instancing.cpp5
-rw-r--r--test/test-network.cpp4
-rw-r--r--test/test-render.cpp3
-rw-r--r--test/test-text.cpp4
-rw-r--r--test/testMainWindow.cpp2
-rw-r--r--test/testMainWindow.h12
8 files changed, 12 insertions, 26 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 73370c8..1c2c417 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -21,10 +21,8 @@
#include "lib/location.h"
#include "lib/stream_support.h"
#include "testMainWindow.h"
-#include "ui/applicationBase.h"
-BOOST_GLOBAL_FIXTURE(ApplicationBase);
-BOOST_GLOBAL_FIXTURE(TestMainWindow);
+BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase);
const std::filesystem::path TMP {"/tmp"};
diff --git a/test/test-glContainer.cpp b/test/test-glContainer.cpp
index ec1c0d1..332d440 100644
--- a/test/test-glContainer.cpp
+++ b/test/test-glContainer.cpp
@@ -1,7 +1,6 @@
#define BOOST_TEST_MODULE glContainer
#include "testMainWindow.h"
-#include "ui/applicationBase.h"
#include <boost/test/data/test_case.hpp>
#include <boost/test/unit_test.hpp>
@@ -15,8 +14,7 @@ BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer<int>::const_iterator);
BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer<int>::reverse_iterator);
BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer<int>::const_reverse_iterator);
-BOOST_GLOBAL_FIXTURE(ApplicationBase);
-BOOST_GLOBAL_FIXTURE(TestMainWindow);
+BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase);
BOOST_FIXTURE_TEST_SUITE(i, glContainer<int>)
diff --git a/test/test-instancing.cpp b/test/test-instancing.cpp
index c1860a4..3244bad 100644
--- a/test/test-instancing.cpp
+++ b/test/test-instancing.cpp
@@ -1,17 +1,14 @@
#define BOOST_TEST_MODULE instancing
#include "stream_support.h"
-#include "testHelpers.h"
#include "testMainWindow.h"
-#include "ui/applicationBase.h"
#include <boost/test/data/test_case.hpp>
#include <boost/test/unit_test.hpp>
#include <set>
#include <gfx/gl/instanceVertices.h>
-BOOST_GLOBAL_FIXTURE(ApplicationBase);
-BOOST_GLOBAL_FIXTURE(TestMainWindow);
+BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase);
BOOST_FIXTURE_TEST_SUITE(i, InstanceVertices<int>)
diff --git a/test/test-network.cpp b/test/test-network.cpp
index 174e2a5..59eebae 100644
--- a/test/test-network.cpp
+++ b/test/test-network.cpp
@@ -5,7 +5,6 @@
#include <boost/test/unit_test.hpp>
#include "testMainWindow.h"
-#include "ui/applicationBase.h"
#include <array>
#include <collection.h>
#include <game/network/link.h>
@@ -20,8 +19,7 @@
#include <utility>
#include <vector>
-BOOST_GLOBAL_FIXTURE(ApplicationBase);
-BOOST_GLOBAL_FIXTURE(TestMainWindow);
+BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase);
struct TestLinkS;
diff --git a/test/test-render.cpp b/test/test-render.cpp
index 79424f5..2c4efea 100644
--- a/test/test-render.cpp
+++ b/test/test-render.cpp
@@ -69,8 +69,7 @@ public:
}
};
-BOOST_GLOBAL_FIXTURE(ApplicationBase);
-BOOST_GLOBAL_FIXTURE(TestMainWindow);
+BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase);
BOOST_DATA_TEST_CASE(cam,
boost::unit_test::data::xrange(500, 30000, 1300) * boost::unit_test::data::xrange(500, 10000, 300)
diff --git a/test/test-text.cpp b/test/test-text.cpp
index f185cf5..b0a9503 100644
--- a/test/test-text.cpp
+++ b/test/test-text.cpp
@@ -7,7 +7,6 @@
#include "testMainWindow.h"
#include "testRenderOutput.h"
-#include "ui/applicationBase.h"
#include "ui/text.h"
#include <array>
#include <gfx/models/texture.h>
@@ -16,8 +15,7 @@
#include <unicode.h>
#include <vector>
-BOOST_GLOBAL_FIXTURE(ApplicationBase);
-BOOST_GLOBAL_FIXTURE(TestMainWindow);
+BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase);
BOOST_AUTO_TEST_CASE(utf8_string_view_iter)
{
diff --git a/test/testMainWindow.cpp b/test/testMainWindow.cpp
index d0b674c..4a76044 100644
--- a/test/testMainWindow.cpp
+++ b/test/testMainWindow.cpp
@@ -2,7 +2,7 @@
#include <boost/test/test_tools.hpp>
#include <format>
-TestMainWindow::TestMainWindow() : Window {1, 1, __FILE__, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN}
+TestMainWindow::TestMainWindow() : MainWindow {1, 1, __FILE__, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN}
{
glEnable(GL_DEBUG_OUTPUT);
glDebugMessageCallback(
diff --git a/test/testMainWindow.h b/test/testMainWindow.h
index 445491d..f54eb72 100644
--- a/test/testMainWindow.h
+++ b/test/testMainWindow.h
@@ -1,15 +1,13 @@
#pragma once
-#include "ui/window.h"
+#include "ui/applicationBase.h"
+#include "ui/mainWindow.h"
-class TestMainWindow : public Window {
+class TestMainWindow : public MainWindow {
// This exists only to hold an OpenGL context open for the duration of the tests,
// in the same way a real main window would always exist.
public:
TestMainWindow();
-
- void
- tick(TickDuration) override
- {
- }
};
+
+class TestMainWindowAppBase : public ApplicationBase, public TestMainWindow { };