From 6a932a14b6f0639c61c483cec63f74d243a1f623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 5 Jan 2025 13:50:23 +0100 Subject: [PATCH] GL: use the String[Not]Contains comparator in a test. Somehow forgot to update this once it got implemented. --- src/Magnum/GL/Test/ContextGLTest.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Magnum/GL/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp index 8812cb909..316f9e89d 100644 --- a/src/Magnum/GL/Test/ContextGLTest.cpp +++ b/src/Magnum/GL/Test/ContextGLTest.cpp @@ -28,9 +28,10 @@ #include #include #include -#include /* contains() on std::string */ +#include /** @todo remove once Debug is stream-free */ #include #include +#include #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" @@ -280,11 +281,14 @@ void ContextGLTest::constructConfiguration() { }; } - /** @todo TestSuite::Compare::StringContains / NotContains for proper diag */ if(!data.logShouldContain.isEmpty()) - CORRADE_VERIFY(Containers::StringView{out.str()}.contains(data.logShouldContain)); + CORRADE_COMPARE_AS(out.str(), + data.logShouldContain, + TestSuite::Compare::StringContains); if(!data.logShouldNotContain.isEmpty()) - CORRADE_VERIFY(!Containers::StringView{out.str()}.contains(data.logShouldNotContain)); + CORRADE_COMPARE_AS(out.str(), + data.logShouldNotContain, + TestSuite::Compare::StringNotContains); } void ContextGLTest::constructMove() { @@ -335,11 +339,14 @@ void ContextGLTest::constructMove() { #endif .addDisabledExtensions(data.disabledExtensions)); } - /** @todo TestSuite::Compare::StringContains / NotContains for proper diag */ if(!data.logShouldContain.isEmpty()) - CORRADE_VERIFY(Containers::StringView{out.str()}.contains(data.logShouldContain)); + CORRADE_COMPARE_AS(out.str(), + data.logShouldContain, + TestSuite::Compare::StringContains); if(!data.logShouldNotContain.isEmpty()) - CORRADE_VERIFY(!Containers::StringView{out.str()}.contains(data.logShouldNotContain)); + CORRADE_COMPARE_AS(out.str(), + data.logShouldNotContain, + TestSuite::Compare::StringNotContains); /* The context is created now */ CORRADE_VERIFY(Context::hasCurrent());