Browse Source

Test: wait, Mac, what the heck are you doing.

So I get a crash by printing a null char* pointer? Amazing!
pull/525/head
Vladimír Vondruš 4 years ago
parent
commit
4be74e225b
  1. 8
      src/Magnum/Audio/Test/ContextTest.cpp
  2. 7
      src/Magnum/GL/Test/ContextTest.cpp

8
src/Magnum/Audio/Test/ContextTest.cpp

@ -27,6 +27,7 @@
#include <set>
#include <sstream>
#include <Corrade/Containers/ArrayView.h>
#include <Corrade/Containers/StringView.h>
#include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/DebugStl.h>
@ -84,8 +85,13 @@ void ContextTest::extensions() {
CORRADE_FAIL_IF(e.index() >= Implementation::ExtensionCount,
"Index" << e.index() << "larger than" << Implementation::ExtensionCount);
/* Have to use Containers::StringView to avoid passing null char* to
std::cout (which crashes on Mac due to strlen being called on it)
because the message is actually printed sooner than the condition
gets tested! */
/** @todo clean up once fixed in Corrade */
CORRADE_FAIL_IF(used[e.index()],
"Index" << e.index() << "already used by" << used[e.index()]);
"Index" << e.index() << "already used by" << Containers::StringView{used[e.index()]});
used[e.index()] = e.string();
CORRADE_FAIL_IF(!unique.insert(e.string()).second,

7
src/Magnum/GL/Test/ContextTest.cpp

@ -406,8 +406,13 @@ void ContextTest::extensions() {
CORRADE_FAIL_IF(e.index() >= GL::Implementation::ExtensionCount,
"Index" << e.index() << "larger than" << GL::Implementation::ExtensionCount);
/* Have to use Containers::StringView to avoid passing null char*
to std::cout (which crashes on Mac due to strlen being called on
it) because the message is actually printed sooner than the
condition gets tested! */
/** @todo clean up once fixed in Corrade */
CORRADE_FAIL_IF(used[e.index()],
"Index" << e.index() << "already used by" << used[e.index()]);
"Index" << e.index() << "already used by" << Containers::StringView{used[e.index()]});
used[e.index()] = e.string();
CORRADE_FAIL_IF(!unique.insert(e.string()).second,

Loading…
Cancel
Save