summaryrefslogtreecommitdiff
path: root/test/testMainWindow.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-01-08 16:34:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-01-08 16:34:43 +0000
commit8cd0977a3688fa705c83867c57505a47b9269369 (patch)
treeb7b48711051299607077ed31fdf3b3f6dd6cc41f /test/testMainWindow.cpp
parentTidy shadow map creation (diff)
downloadilt-8cd0977a3688fa705c83867c57505a47b9269369.tar.bz2
ilt-8cd0977a3688fa705c83867c57505a47b9269369.tar.xz
ilt-8cd0977a3688fa705c83867c57505a47b9269369.zip
Fix up all the static analyzer warnings
Diffstat (limited to 'test/testMainWindow.cpp')
-rw-r--r--test/testMainWindow.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/testMainWindow.cpp b/test/testMainWindow.cpp
index 66e8832..49e18f1 100644
--- a/test/testMainWindow.cpp
+++ b/test/testMainWindow.cpp
@@ -1,14 +1,14 @@
#include "testMainWindow.h"
+#include "testHelpers.h"
#include <boost/test/test_tools.hpp>
TestMainWindow::TestMainWindow() : Window {1, 1, __FILE__, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN}
{
glEnable(GL_DEBUG_OUTPUT);
glDebugMessageCallback(
- [](GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * message,
- const void *) {
- char buf[BUFSIZ];
- snprintf(buf, BUFSIZ, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s",
+ [](GLenum /*source*/, GLenum type, GLuint /*id*/, GLenum severity, GLsizei /*length*/,
+ const GLchar * message, const void *) {
+ const auto msg = uasprintf("GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s",
(type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : ""), type, severity, message);
switch (type) {
case GL_DEBUG_TYPE_ERROR:
@@ -16,9 +16,10 @@ TestMainWindow::TestMainWindow() : Window {1, 1, __FILE__, SDL_WINDOW_OPENGL | S
case GL_DEBUG_TYPE_PORTABILITY:
case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
- BOOST_TEST_ERROR(buf);
+ BOOST_TEST_ERROR(msg.get());
+ default:
+ BOOST_TEST_MESSAGE(msg.get());
}
- BOOST_TEST_MESSAGE(buf);
},
nullptr);
}