From ee3afc1bbc72a74991b768f6764e74b8d9dd7b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 13 Jan 2017 17:53:42 +0100 Subject: [PATCH] Code simplification in plugin tests. Somehow slipped through ages ago. --- .../MagnumFont/Test/MagnumFontGLTest.cpp | 11 +- .../Test/MagnumFontConverterGLTest.cpp | 7 +- src/MagnumPlugins/ObjImporter/Test/Test.cpp | 105 +++++++++--------- .../Test/TgaImageConverterTest.cpp | 13 +-- .../TgaImporter/Test/TgaImporterTest.cpp | 25 ++--- .../WavAudioImporter/Test/WavImporterTest.cpp | 75 ++++++------- 6 files changed, 115 insertions(+), 121 deletions(-) diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp index b15e82a8b..e4b910f22 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp @@ -33,13 +33,12 @@ namespace Magnum { namespace Text { namespace Test { -class MagnumFontGLTest: public OpenGLTester { - public: - explicit MagnumFontGLTest(); +struct MagnumFontGLTest: OpenGLTester { + explicit MagnumFontGLTest(); - void properties(); - void layout(); - void createGlyphCache(); + void properties(); + void layout(); + void createGlyphCache(); }; MagnumFontGLTest::MagnumFontGLTest() { diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp index faa259929..c53d9b3c8 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp @@ -42,11 +42,10 @@ namespace Magnum { namespace Text { namespace Test { -class MagnumFontConverterGLTest: public OpenGLTester { - public: - explicit MagnumFontConverterGLTest(); +struct MagnumFontConverterGLTest: OpenGLTester { + explicit MagnumFontConverterGLTest(); - void exportFont(); + void exportFont(); }; MagnumFontConverterGLTest::MagnumFontConverterGLTest() { diff --git a/src/MagnumPlugins/ObjImporter/Test/Test.cpp b/src/MagnumPlugins/ObjImporter/Test/Test.cpp index df1bc8e21..efd9010d3 100644 --- a/src/MagnumPlugins/ObjImporter/Test/Test.cpp +++ b/src/MagnumPlugins/ObjImporter/Test/Test.cpp @@ -36,59 +36,58 @@ namespace Magnum { namespace Trade { namespace Test { -class ObjImporterTest: public TestSuite::Tester { - public: - explicit ObjImporterTest(); - - void pointMesh(); - void lineMesh(); - void triangleMesh(); - void mixedPrimitives(); - - void positionsOnly(); - void textureCoordinates(); - void normals(); - void textureCoordinatesNormals(); - - void emptyFile(); - void unnamedMesh(); - void namedMesh(); - void moreMeshes(); - void unnamedFirstMesh(); - - void wrongFloat(); - void wrongInteger(); - void unmergedIndexOutOfRange(); - void mergedIndexOutOfRange(); - void zeroIndex(); - - void explicitOptionalPositionCoordinate(); - void explicitOptionalTextureCoordinate(); - void unsupportedOptionalPositionCoordinate(); - void unsupportedOptionalTextureCoordinate(); - - void shortFloatData(); - void longFloatData(); - void longOptionalFloatData(); - - void longIndexData(); - void wrongPointIndexData(); - void wrongLineIndexData(); - void wrongTriangleIndexData(); - void polygonIndexData(); - - void missingPositionData(); - void missingNormalData(); - void missingTextureCoordinateData(); - void missingPositionIndices(); - void missingNormalIndices(); - void missingTextureCoordinateIndices(); - - void wrongTextureCoordinateIndexCount(); - void wrongNormalIndexCount(); - - void unsupportedKeyword(); - void unknownKeyword(); +struct ObjImporterTest: TestSuite::Tester { + explicit ObjImporterTest(); + + void pointMesh(); + void lineMesh(); + void triangleMesh(); + void mixedPrimitives(); + + void positionsOnly(); + void textureCoordinates(); + void normals(); + void textureCoordinatesNormals(); + + void emptyFile(); + void unnamedMesh(); + void namedMesh(); + void moreMeshes(); + void unnamedFirstMesh(); + + void wrongFloat(); + void wrongInteger(); + void unmergedIndexOutOfRange(); + void mergedIndexOutOfRange(); + void zeroIndex(); + + void explicitOptionalPositionCoordinate(); + void explicitOptionalTextureCoordinate(); + void unsupportedOptionalPositionCoordinate(); + void unsupportedOptionalTextureCoordinate(); + + void shortFloatData(); + void longFloatData(); + void longOptionalFloatData(); + + void longIndexData(); + void wrongPointIndexData(); + void wrongLineIndexData(); + void wrongTriangleIndexData(); + void polygonIndexData(); + + void missingPositionData(); + void missingNormalData(); + void missingTextureCoordinateData(); + void missingPositionIndices(); + void missingNormalIndices(); + void missingTextureCoordinateIndices(); + + void wrongTextureCoordinateIndexCount(); + void wrongNormalIndexCount(); + + void unsupportedKeyword(); + void unknownKeyword(); }; ObjImporterTest::ObjImporterTest() { diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index b05545083..3010a00b1 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -38,15 +38,14 @@ namespace Magnum { namespace Trade { namespace Test { -class TgaImageConverterTest: public TestSuite::Tester { - public: - explicit TgaImageConverterTest(); +struct TgaImageConverterTest: TestSuite::Tester { + explicit TgaImageConverterTest(); - void wrongFormat(); - void wrongType(); + void wrongFormat(); + void wrongType(); - void rgb(); - void rgba(); + void rgb(); + void rgba(); }; namespace { diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index e4e823d05..1a8730685 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -37,23 +37,22 @@ namespace Magnum { namespace Trade { namespace Test { -class TgaImporterTest: public TestSuite::Tester { - public: - TgaImporterTest(); +struct TgaImporterTest: TestSuite::Tester { + explicit TgaImporterTest(); - void openNonexistent(); - void openShort(); - void paletted(); - void compressed(); + void openNonexistent(); + void openShort(); + void paletted(); + void compressed(); - void colorBits16(); - void colorBits24(); - void colorBits32(); + void colorBits16(); + void colorBits24(); + void colorBits32(); - void grayscaleBits8(); - void grayscaleBits16(); + void grayscaleBits8(); + void grayscaleBits16(); - void useTwice(); + void useTwice(); }; TgaImporterTest::TgaImporterTest() { diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp index 2c537ea57..f2562084d 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp @@ -37,44 +37,43 @@ namespace Magnum { namespace Audio { namespace Test { -class WavImporterTest: public TestSuite::Tester { - public: - explicit WavImporterTest(); - - void wrongSize(); - void wrongSignature(); - void unsupportedFormat(); - void unsupportedChannelCount(); - - void invalidPadding(); - void invalidLength(); - void invalidDataChunk(); - void invalidFactChunk(); - - void mono4(); - void mono8(); - void mono8junk(); - void mono8ALaw(); - void mono8MuLaw(); - void mono16(); - - void stereo4(); - void stereo8(); - void stereo8ALaw(); - void stereo8MuLaw(); - void stereo12(); - void stereo16(); - void stereo24(); - void stereo32(); - - void mono32f(); - void stereo32f(); - void stereo64f(); - - void surround51Channel16(); - void surround71Channel24(); - - void debugAudioFormat(); +struct WavImporterTest: TestSuite::Tester { + explicit WavImporterTest(); + + void wrongSize(); + void wrongSignature(); + void unsupportedFormat(); + void unsupportedChannelCount(); + + void invalidPadding(); + void invalidLength(); + void invalidDataChunk(); + void invalidFactChunk(); + + void mono4(); + void mono8(); + void mono8junk(); + void mono8ALaw(); + void mono8MuLaw(); + void mono16(); + + void stereo4(); + void stereo8(); + void stereo8ALaw(); + void stereo8MuLaw(); + void stereo12(); + void stereo16(); + void stereo24(); + void stereo32(); + + void mono32f(); + void stereo32f(); + void stereo64f(); + + void surround51Channel16(); + void surround71Channel24(); + + void debugAudioFormat(); }; WavImporterTest::WavImporterTest() {