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 {
class FlatMaterialDataTest: public TestSuite::Tester {
public:
explicit FlatMaterialDataTest();
void baseColor();
void diffuseColor();
void defaults();
void texturedBaseColor();
void texturedDiffuseColor();
void texturedDefaults();
void texturedBaseColorSingleMatrixCoordinatesLayer();
void texturedDiffuseColorSingleMatrixCoordinatesLayer();
void texturedMismatchedMatrixCoordinatesLayer();
void texturedImplicitCoordinatesLayer();
void invalidTextures();
struct FlatMaterialDataTest: TestSuite::Tester {
explicit FlatMaterialDataTest();
void baseColor();
void diffuseColor();
void defaults();
void texturedBaseColor();
void texturedDiffuseColor();
void texturedDefaults();
void texturedBaseColorSingleMatrixCoordinatesLayer();
void texturedDiffuseColorSingleMatrixCoordinatesLayer();
void texturedMismatchedMatrixCoordinatesLayer();
void texturedImplicitCoordinatesLayer();
void invalidTextures();
};
FlatMaterialDataTest::FlatMaterialDataTest() {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save