Browse Source

Audio: improve extension tests similarly to GL.

pull/370/head
Vladimír Vondruš 7 years ago
parent
commit
b0546c4eda
  1. 9
      src/Magnum/Audio/Test/ContextTest.cpp

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

@ -24,6 +24,7 @@
DEALINGS IN THE SOFTWARE.
*/
#include <set>
#include <sstream>
#include <Corrade/Containers/ArrayView.h>
#include <Corrade/TestSuite/Tester.h>
@ -70,7 +71,9 @@ void ContextTest::constructCopyMove() {
void ContextTest::extensions() {
const char* used[Implementation::ExtensionCount]{};
/* Check that all extension indices are unique */
std::set<std::string> unique;
/* Check that all extension indices are unique and are listed just once */
for(const Extension& e: Extension::extensions()) {
if(e.index() >= Implementation::ExtensionCount) {
Error{} << "Index" << e.index() << "used by" << e.string()
@ -85,6 +88,10 @@ void ContextTest::extensions() {
}
used[e.index()] = e.string();
if(!unique.insert(e.string()).second) {
Error{} << "Extension" << e.string() << "listed more than once";
CORRADE_VERIFY(false);
}
}
CORRADE_VERIFY(true);

Loading…
Cancel
Save