From 02c3f1fd622bb5b4da1462c5bb507a4a541447d5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 15 Jun 2024 15:28:53 +0100 Subject: First cut reshuffling app/window/gl/render bits --- test/test-assetFactory.cpp | 4 +--- test/test-glContainer.cpp | 4 +--- test/test-instancing.cpp | 5 +---- test/test-network.cpp | 4 +--- test/test-render.cpp | 3 +-- test/test-text.cpp | 4 +--- test/testMainWindow.cpp | 2 +- test/testMainWindow.h | 12 +++++------- 8 files changed, 12 insertions(+), 26 deletions(-) (limited to 'test') 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 #include @@ -15,8 +14,7 @@ BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer::const_iterator); BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer::reverse_iterator); BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer::const_reverse_iterator); -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_FIXTURE_TEST_SUITE(i, glContainer) 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 #include #include #include -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_FIXTURE_TEST_SUITE(i, InstanceVertices) 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 #include "testMainWindow.h" -#include "ui/applicationBase.h" #include #include #include @@ -20,8 +19,7 @@ #include #include -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 #include @@ -16,8 +15,7 @@ #include #include -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 #include -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 { }; -- cgit v1.2.3