summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-05-28 11:45:01 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-05-28 11:45:01 +0100
commit3c1c392ab177566f09d11a380210e1937741fad2 (patch)
tree67b12689c60dc2e75a5587988dd11bf36c12da9a /test
parentAdd glad submodule and build a glad library (diff)
downloadilt-3c1c392ab177566f09d11a380210e1937741fad2.tar.bz2
ilt-3c1c392ab177566f09d11a380210e1937741fad2.tar.xz
ilt-3c1c392ab177566f09d11a380210e1937741fad2.zip
Swap GLEW for more modern glad
Diffstat (limited to 'test')
-rw-r--r--test/Jamfile.jam4
-rw-r--r--test/test-glContextBhvr.cpp4
-rw-r--r--test/test-lib.cpp2
-rw-r--r--test/test-network.cpp5
-rw-r--r--test/test-text.cpp5
5 files changed, 15 insertions, 5 deletions
diff --git a/test/Jamfile.jam b/test/Jamfile.jam
index 3b4e891..e221af7 100644
--- a/test/Jamfile.jam
+++ b/test/Jamfile.jam
@@ -47,9 +47,9 @@ run test-collection.cpp ;
run test-maths.cpp ;
run test-lib.cpp ;
run test-geo.cpp ;
-run test-network.cpp ;
+run test-network.cpp : : : <library>test ;
run test-persistence.cpp : -- : [ sequence.insertion-sort [ glob-tree fixtures : *.json ] ] : <library>test ;
-run test-text.cpp ;
+run test-text.cpp : : : <library>test ;
run test-enumDetails.cpp ;
run test-render.cpp : -- : test-assetFactory : <library>test ;
run test-glContextBhvr.cpp ;
diff --git a/test/test-glContextBhvr.cpp b/test/test-glContextBhvr.cpp
index 9716f54..1f1215c 100644
--- a/test/test-glContextBhvr.cpp
+++ b/test/test-glContextBhvr.cpp
@@ -24,12 +24,12 @@ BOOST_AUTO_TEST_CASE(windowContextThingsBehaviour1)
const SDL_WindowPtr window {TEST_WINDOW_PARAMS};
BOOST_REQUIRE(window);
BOOST_REQUIRE(!glCreateProgram);
- BOOST_REQUIRE_NE(glewInit(), GLEW_OK); // No context yet
+ BOOST_REQUIRE_EQUAL(gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)), 0); // No context yet
{
const SDL_GLContextPtr context {window};
BOOST_REQUIRE(context);
BOOST_REQUIRE(!glCreateProgram);
- BOOST_REQUIRE_EQUAL(glewInit(), GLEW_OK);
+ BOOST_REQUIRE_EQUAL(gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)), 40006);
BOOST_REQUIRE(glCreateProgram);
CreateProgramTest();
} // Context destroyed
diff --git a/test/test-lib.cpp b/test/test-lib.cpp
index 73ed53a..aaf6292 100644
--- a/test/test-lib.cpp
+++ b/test/test-lib.cpp
@@ -4,8 +4,8 @@
#include <boost/test/data/test_case.hpp>
#include <boost/test/unit_test.hpp>
-#include <GL/glew.h>
#include <glArrays.h>
+#include <glad/gl.h>
#include <set>
std::set<GLuint> active;
diff --git a/test/test-network.cpp b/test/test-network.cpp
index e6241e4..a8db2b6 100644
--- a/test/test-network.cpp
+++ b/test/test-network.cpp
@@ -4,6 +4,8 @@
#include <boost/test/data/test_case.hpp>
#include <boost/test/unit_test.hpp>
+#include "testMainWindow.h"
+#include "ui/applicationBase.h"
#include <array>
#include <collection.h>
#include <game/network/link.h>
@@ -18,6 +20,9 @@
#include <utility>
#include <vector>
+BOOST_GLOBAL_FIXTURE(ApplicationBase);
+BOOST_GLOBAL_FIXTURE(TestMainWindow);
+
struct TestLink : public LinkStraight {
TestLink(const Node::Ptr & a, const Node::Ptr & b) : TestLink {a, b, (a->pos - b->pos)} { }
TestLink(Node::Ptr a, Node::Ptr b, glm::vec2 l) : Link {{std::move(a), 0}, {std::move(b), pi}, glm::length(l)} { }
diff --git a/test/test-text.cpp b/test/test-text.cpp
index 3a23818..629892f 100644
--- a/test/test-text.cpp
+++ b/test/test-text.cpp
@@ -5,6 +5,8 @@
#include <boost/test/unit_test.hpp>
#include <stream_support.h>
+#include "testMainWindow.h"
+#include "ui/applicationBase.h"
#include <array>
#include <glm/glm.hpp>
#include <span>
@@ -12,6 +14,9 @@
#include <unicode.h>
#include <vector>
+BOOST_GLOBAL_FIXTURE(ApplicationBase);
+BOOST_GLOBAL_FIXTURE(TestMainWindow);
+
BOOST_AUTO_TEST_CASE(utf8_string_view_iter)
{
static constexpr utf8_string_view text {"Some UTF-8 €£²¹ text."};