Browse Source

Test: consistently use a struct for Tester subclasses.

I thought I cleaned this up ages ago, heh.
pull/578/head
Vladimír Vondruš 4 years ago
parent
commit
1a4eefe271
  1. 29
      src/Magnum/Trade/Test/FlatMaterialDataTest.cpp
  2. 253
      src/Magnum/Trade/Test/MaterialDataTest.cpp
  3. 35
      src/Magnum/Trade/Test/ObjectData2DTest.cpp
  4. 37
      src/Magnum/Trade/Test/ObjectData3DTest.cpp
  5. 33
      src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp
  6. 39
      src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp
  7. 33
      src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp
  8. 55
      src/Magnum/Trade/Test/PhongMaterialDataTest.cpp
  9. 15
      src/Magnum/Trade/Test/TextureDataTest.cpp

29
src/Magnum/Trade/Test/FlatMaterialDataTest.cpp

@ -33,21 +33,20 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class FlatMaterialDataTest: public TestSuite::Tester { struct FlatMaterialDataTest: TestSuite::Tester {
public: explicit FlatMaterialDataTest();
explicit FlatMaterialDataTest();
void baseColor();
void baseColor(); void diffuseColor();
void diffuseColor(); void defaults();
void defaults(); void texturedBaseColor();
void texturedBaseColor(); void texturedDiffuseColor();
void texturedDiffuseColor(); void texturedDefaults();
void texturedDefaults(); void texturedBaseColorSingleMatrixCoordinatesLayer();
void texturedBaseColorSingleMatrixCoordinatesLayer(); void texturedDiffuseColorSingleMatrixCoordinatesLayer();
void texturedDiffuseColorSingleMatrixCoordinatesLayer(); void texturedMismatchedMatrixCoordinatesLayer();
void texturedMismatchedMatrixCoordinatesLayer(); void texturedImplicitCoordinatesLayer();
void texturedImplicitCoordinatesLayer(); void invalidTextures();
void invalidTextures();
}; };
FlatMaterialDataTest::FlatMaterialDataTest() { FlatMaterialDataTest::FlatMaterialDataTest() {

253
src/Magnum/Trade/Test/MaterialDataTest.cpp

@ -43,133 +43,132 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class MaterialDataTest: public TestSuite::Tester { struct MaterialDataTest: TestSuite::Tester {
public: explicit MaterialDataTest();
explicit MaterialDataTest();
void textureSwizzleComponentCount();
void textureSwizzleComponentCount(); void attributeTypeSize();
void attributeTypeSize(); void attributeTypeSizeInvalid();
void attributeTypeSizeInvalid();
void attributeMap();
void attributeMap(); void layerMap();
void layerMap();
void constructAttributeDefault();
void constructAttributeDefault(); void constructAttributeString();
void constructAttributeString(); void constructAttributeName();
void constructAttributeName(); void constructAttributeTypeErasedString();
void constructAttributeTypeErasedString(); void constructAttributeTypeErasedName();
void constructAttributeTypeErasedName();
template<class T> void constructAttributeStringConstexpr();
template<class T> void constructAttributeStringConstexpr();
void constructAttributePointer();
void constructAttributePointer(); void constructAttributeMutablePointer();
void constructAttributeMutablePointer(); void constructAttributeStringNameStringValue();
void constructAttributeStringNameStringValue(); void constructAttributeNameStringValue();
void constructAttributeNameStringValue(); void constructAttributeTextureSwizzle();
void constructAttributeTextureSwizzle(); void constructAttributeLayer();
void constructAttributeLayer();
void constructAttributeInvalidName();
void constructAttributeInvalidName(); void constructAttributeInvalidLayerName();
void constructAttributeInvalidLayerName(); void constructAttributeWrongTypeForName();
void constructAttributeWrongTypeForName(); void constructAttributeInvalidType();
void constructAttributeInvalidType(); void constructAttributeEmptyName();
void constructAttributeEmptyName(); void constructAttributeEmptyNameString();
void constructAttributeEmptyNameString(); void constructAttributeTooLarge();
void constructAttributeTooLarge(); void constructAttributeTooLargeString();
void constructAttributeTooLargeString(); void constructAttributeTooLargeNameString();
void constructAttributeTooLargeNameString(); void constructAttributeWrongAccessType();
void constructAttributeWrongAccessType(); void constructAttributeWrongAccessPointerType();
void constructAttributeWrongAccessPointerType(); void constructAttributeWrongAccessTypeString();
void constructAttributeWrongAccessTypeString();
void construct();
void construct(); void constructEmptyAttribute();
void constructEmptyAttribute(); void constructDuplicateAttribute();
void constructDuplicateAttribute(); void constructFromImmutableSortedArray();
void constructFromImmutableSortedArray();
void constructLayers();
void constructLayers(); void constructLayersNotMonotonic();
void constructLayersNotMonotonic(); void constructLayersOffsetOutOfBounds();
void constructLayersOffsetOutOfBounds();
void constructNonOwned();
void constructNonOwned(); void constructNonOwnedLayers();
void constructNonOwnedLayers(); void constructNonOwnedEmptyAttribute();
void constructNonOwnedEmptyAttribute(); void constructNonOwnedNotSorted();
void constructNonOwnedNotSorted(); void constructNonOwnedDuplicateAttribute();
void constructNonOwnedDuplicateAttribute(); void constructNonOwnedLayersNotMonotonic();
void constructNonOwnedLayersNotMonotonic(); void constructNonOwnedLayersOffsetOutOfBounds();
void constructNonOwnedLayersOffsetOutOfBounds(); void constructNonOwnedAttributeFlagOwned();
void constructNonOwnedAttributeFlagOwned(); void constructNonOwnedLayerFlagOwned();
void constructNonOwnedLayerFlagOwned();
void constructCopy();
void constructCopy(); void constructMove();
void constructMove();
void as();
void as(); void asRvalue();
void asRvalue();
void access();
void access(); void accessPointer();
void accessPointer(); void accessString();
void accessString(); void accessTextureSwizzle();
void accessTextureSwizzle(); void accessMutable();
void accessMutable(); void accessOptional();
void accessOptional(); void accessOutOfBounds();
void accessOutOfBounds(); void accessNotFound();
void accessNotFound(); void accessInvalidAttributeName();
void accessInvalidAttributeName(); void accessWrongType();
void accessWrongType(); void accessWrongPointerType();
void accessWrongPointerType(); void accessWrongTypeString();
void accessWrongTypeString();
void accessLayers();
void accessLayers(); void accessLayersDefaults();
void accessLayersDefaults(); void accessLayersTextured();
void accessLayersTextured(); void accessLayersTexturedDefault();
void accessLayersTexturedDefault(); void accessLayersTexturedSingleMatrixCoordinatesLayer();
void accessLayersTexturedSingleMatrixCoordinatesLayer(); void accessLayersTexturedBaseMaterialMatrixCoordinatesLayer();
void accessLayersTexturedBaseMaterialMatrixCoordinatesLayer(); void accessLayersInvalidTextures();
void accessLayersInvalidTextures();
void accessLayerLayerNameInBaseMaterial();
void accessLayerLayerNameInBaseMaterial(); void accessLayerEmptyLayer();
void accessLayerEmptyLayer(); void accessLayerIndexMutable();
void accessLayerIndexMutable(); void accessLayerNameMutable();
void accessLayerNameMutable(); void accessLayerStringMutable();
void accessLayerStringMutable(); void accessLayerIndexOptional();
void accessLayerIndexOptional(); void accessLayerNameOptional();
void accessLayerNameOptional(); void accessLayerStringOptional();
void accessLayerStringOptional(); void accessLayerOutOfBounds();
void accessLayerOutOfBounds(); void accessLayerNotFound();
void accessLayerNotFound(); void accessInvalidLayerName();
void accessInvalidLayerName(); void accessOutOfBoundsInLayerIndex();
void accessOutOfBoundsInLayerIndex(); void accessOutOfBoundsInLayerString();
void accessOutOfBoundsInLayerString(); void accessNotFoundInLayerIndex();
void accessNotFoundInLayerIndex(); void accessNotFoundInLayerString();
void accessNotFoundInLayerString(); void accessMutableNotAllowed();
void accessMutableNotAllowed();
void releaseAttributes();
void releaseAttributes(); void releaseLayers();
void releaseLayers();
void templateLayerAccess();
void templateLayerAccess(); void templateLayerAccessMutable();
void templateLayerAccessMutable();
void debugLayer();
void debugLayer(); /* No packed version, as layer name is stored as a string */
/* No packed version, as layer name is stored as a string */ void debugAttribute();
void debugAttribute(); /* No packed version, as attribute name is stored as a string */
/* No packed version, as attribute name is stored as a string */ void debugTextureSwizzle();
void debugTextureSwizzle(); void debugTextureSwizzlePacked();
void debugTextureSwizzlePacked(); void debugAttributeType();
void debugAttributeType(); void debugAttributeTypePacked();
void debugAttributeTypePacked();
void debugType();
void debugType(); void debugTypePacked();
void debugTypePacked(); void debugTypes();
void debugTypes(); void debugTypesPacked();
void debugTypesPacked(); #ifdef MAGNUM_BUILD_DEPRECATED
#ifdef MAGNUM_BUILD_DEPRECATED void debugFlag();
void debugFlag(); void debugFlags();
void debugFlags(); #endif
#endif void debugAlphaMode();
void debugAlphaMode(); void debugAlphaModePacked();
void debugAlphaModePacked();
}; };
MaterialDataTest::MaterialDataTest() { MaterialDataTest::MaterialDataTest() {

35
src/Magnum/Trade/Test/ObjectData2DTest.cpp

@ -34,24 +34,23 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class ObjectData2DTest: public TestSuite::Tester { struct ObjectData2DTest: TestSuite::Tester {
public: explicit ObjectData2DTest();
explicit ObjectData2DTest();
void constructEmpty();
void constructEmpty(); void constructEmptyTransformations();
void constructEmptyTransformations(); void constructMesh();
void constructMesh(); void constructMeshTransformations();
void constructMeshTransformations(); void constructCamera();
void constructCamera(); void constructCopy();
void constructCopy(); void constructMoveTransformations();
void constructMoveTransformations(); void constructMoveMesh();
void constructMoveMesh();
void accessInvalidTransformations();
void accessInvalidTransformations();
void debugType();
void debugType(); void debugFlag();
void debugFlag(); void debugFlags();
void debugFlags();
}; };
CORRADE_IGNORE_DEPRECATED_PUSH CORRADE_IGNORE_DEPRECATED_PUSH

37
src/Magnum/Trade/Test/ObjectData3DTest.cpp

@ -34,25 +34,24 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class ObjectData3DTest: public TestSuite::Tester { struct ObjectData3DTest: TestSuite::Tester {
public: explicit ObjectData3DTest();
explicit ObjectData3DTest();
void constructEmpty();
void constructEmpty(); void constructEmptyTransformations();
void constructEmptyTransformations(); void constructMesh();
void constructMesh(); void constructMeshTransformations();
void constructMeshTransformations(); void constructCamera();
void constructCamera(); void constructLight();
void constructLight(); void constructCopy();
void constructCopy(); void constructMoveTransformations();
void constructMoveTransformations(); void constructMoveMesh();
void constructMoveMesh();
void accessInvalidTransformations();
void accessInvalidTransformations();
void debugType();
void debugType(); void debugFlag();
void debugFlag(); void debugFlags();
void debugFlags();
}; };
ObjectData3DTest::ObjectData3DTest() { ObjectData3DTest::ObjectData3DTest() {

33
src/Magnum/Trade/Test/PbrClearCoatMaterialDataTest.cpp

@ -32,23 +32,22 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class PbrClearCoatMaterialDataTest: public TestSuite::Tester { struct PbrClearCoatMaterialDataTest: TestSuite::Tester {
public: explicit PbrClearCoatMaterialDataTest();
explicit PbrClearCoatMaterialDataTest();
void basics();
void basics(); void defaults();
void defaults(); void textured();
void textured(); void texturedDefaults();
void texturedDefaults(); void texturedExplicitPackedLayerFactorRoughness();
void texturedExplicitPackedLayerFactorRoughness(); void texturedSingleMatrixCoordinatesLayer();
void texturedSingleMatrixCoordinatesLayer(); void texturedBaseMaterialMatrixCoordinatesLayer();
void texturedBaseMaterialMatrixCoordinatesLayer(); void invalidTextures();
void invalidTextures(); void commonTransformationCoordinatesLayerNoTextures();
void commonTransformationCoordinatesLayerNoTextures(); void commonTransformationCoordinatesLayerOneTexture();
void commonTransformationCoordinatesLayerOneTexture(); void commonTransformationCoordinatesLayerOneDifferentTexture();
void commonTransformationCoordinatesLayerOneDifferentTexture(); void commonCoordinatesLayerImplicit();
void commonCoordinatesLayerImplicit(); void noCommonTransformationCoordinatesLayer();
void noCommonTransformationCoordinatesLayer();
}; };
const Containers::StringView PbrClearCoatTextureData[] { const Containers::StringView PbrClearCoatTextureData[] {

39
src/Magnum/Trade/Test/PbrMetallicRoughnessMaterialDataTest.cpp

@ -34,26 +34,25 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class PbrMetallicRoughnessMaterialDataTest: public TestSuite::Tester { struct PbrMetallicRoughnessMaterialDataTest: TestSuite::Tester {
public: explicit PbrMetallicRoughnessMaterialDataTest();
explicit PbrMetallicRoughnessMaterialDataTest();
void basics();
void basics(); void defaults();
void defaults(); void textured();
void textured(); void texturedDefaults();
void texturedDefaults(); void texturedImplicitPackedMetallicRoughness();
void texturedImplicitPackedMetallicRoughness(); void texturedExplicitPackedMetallicRoughness();
void texturedExplicitPackedMetallicRoughness(); void texturedExplicitPackedRoughnessMetallicOcclusion();
void texturedExplicitPackedRoughnessMetallicOcclusion(); void texturedExplicitPackedOcclusionRoughnessMetallic();
void texturedExplicitPackedOcclusionRoughnessMetallic(); void texturedExplicitPackedNormalRoughnessMetallic();
void texturedExplicitPackedNormalRoughnessMetallic(); void texturedSingleMatrixCoordinatesLayer();
void texturedSingleMatrixCoordinatesLayer(); void invalidTextures();
void invalidTextures(); void commonTransformationCoordinatesLayerNoTextures();
void commonTransformationCoordinatesLayerNoTextures(); void commonTransformationCoordinatesLayerOneTexture();
void commonTransformationCoordinatesLayerOneTexture(); void commonTransformationCoordinatesLayerOneDifferentTexture();
void commonTransformationCoordinatesLayerOneDifferentTexture(); void commonCoordinatesLayerImplicit();
void commonCoordinatesLayerImplicit(); void noCommonTransformationCoordinatesLayer();
void noCommonTransformationCoordinatesLayer();
}; };
const Containers::StringView PbrMetallicRoughnessTextureData[] { const Containers::StringView PbrMetallicRoughnessTextureData[] {

33
src/Magnum/Trade/Test/PbrSpecularGlossinessMaterialDataTest.cpp

@ -34,23 +34,22 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class PbrSpecularGlossinessMaterialDataTest: public TestSuite::Tester { struct PbrSpecularGlossinessMaterialDataTest: TestSuite::Tester {
public: explicit PbrSpecularGlossinessMaterialDataTest();
explicit PbrSpecularGlossinessMaterialDataTest();
void basics();
void basics(); void defaults();
void defaults(); void textured();
void textured(); void texturedDefaults();
void texturedDefaults(); void texturedImplicitPackedSpecularGlossiness();
void texturedImplicitPackedSpecularGlossiness(); void texturedExplicitPackedSpecularGlossiness();
void texturedExplicitPackedSpecularGlossiness(); void texturedSingleMatrixCoordinatesLayer();
void texturedSingleMatrixCoordinatesLayer(); void invalidTextures();
void invalidTextures(); void commonTransformationCoordinatesLayerNoTextures();
void commonTransformationCoordinatesLayerNoTextures(); void commonTransformationCoordinatesLayerOneTexture();
void commonTransformationCoordinatesLayerOneTexture(); void commonTransformationCoordinatesLayerOneDifferentTexture();
void commonTransformationCoordinatesLayerOneDifferentTexture(); void commonCoordinatesLayerImplicit();
void commonCoordinatesLayerImplicit(); void noCommonTransformationCoordinatesLayer();
void noCommonTransformationCoordinatesLayer();
}; };
const Containers::StringView PbrSpecularGlossinessTextureData[] { const Containers::StringView PbrSpecularGlossinessTextureData[] {

55
src/Magnum/Trade/Test/PhongMaterialDataTest.cpp

@ -34,37 +34,36 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class PhongMaterialDataTest: public TestSuite::Tester { struct PhongMaterialDataTest: TestSuite::Tester {
public: explicit PhongMaterialDataTest();
explicit PhongMaterialDataTest();
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
void constructDeprecated(); void constructDeprecated();
void constructDeprecatedTextured(); void constructDeprecatedTextured();
void constructDeprecatedTexturedTextureTransform(); void constructDeprecatedTexturedTextureTransform();
void constructDeprecatedTexturedCoordinates(); void constructDeprecatedTexturedCoordinates();
void constructDeprecatedTextureTransformNoTextures(); void constructDeprecatedTextureTransformNoTextures();
void constructDeprecatedNoTextureTransformationFlag(); void constructDeprecatedNoTextureTransformationFlag();
void constructDeprecatedNoTextureCoordinatesFlag(); void constructDeprecatedNoTextureCoordinatesFlag();
#endif #endif
void basics(); void basics();
void defaults(); void defaults();
void textured(); void textured();
void texturedDefaults(); void texturedDefaults();
void texturedSingleMatrixCoordinatesLayer(); void texturedSingleMatrixCoordinatesLayer();
void texturedImplicitPackedSpecularGlossiness(); void texturedImplicitPackedSpecularGlossiness();
void invalidTextures(); void invalidTextures();
void commonTransformationCoordinatesLayerNoTextures(); void commonTransformationCoordinatesLayerNoTextures();
void commonTransformationCoordinatesLayerOneTexture(); void commonTransformationCoordinatesLayerOneTexture();
void commonTransformationCoordinatesLayerOneDifferentTexture(); void commonTransformationCoordinatesLayerOneDifferentTexture();
void commonCoordinatesLayerImplicit(); void commonCoordinatesLayerImplicit();
void noCommonTransformationCoordinatesLayer(); void noCommonTransformationCoordinatesLayer();
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
void debugFlag(); void debugFlag();
void debugFlags(); void debugFlags();
#endif #endif
}; };
const Containers::StringView PhongTextureData[] { const Containers::StringView PhongTextureData[] {

15
src/Magnum/Trade/Test/TextureDataTest.cpp

@ -31,16 +31,15 @@
namespace Magnum { namespace Trade { namespace Test { namespace { namespace Magnum { namespace Trade { namespace Test { namespace {
class TextureDataTest: public TestSuite::Tester { struct TextureDataTest: TestSuite::Tester {
public: explicit TextureDataTest();
explicit TextureDataTest();
void construct(); void construct();
void constructCopy(); void constructCopy();
void constructMove(); void constructMove();
void debugType(); void debugType();
void debugTypePacked(); void debugTypePacked();
}; };
TextureDataTest::TextureDataTest() { TextureDataTest::TextureDataTest() {

Loading…
Cancel
Save