Browse Source

Got rid of header files in tests.

They have no practical use and they only bloat codebase size and add
maintenance burden.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
fcb8a7b768
  1. 16
      src/Math/Algorithms/Test/GaussJordanTest.cpp
  2. 32
      src/Math/Algorithms/Test/GaussJordanTest.h
  3. 13
      src/Math/Algorithms/Test/GramSchmidtTest.cpp
  4. 31
      src/Math/Algorithms/Test/GramSchmidtTest.h
  5. 2
      src/Math/CMakeLists.txt
  6. 2
      src/Math/Geometry/CMakeLists.txt
  7. 21
      src/Math/Geometry/Test/DistanceTest.cpp
  8. 34
      src/Math/Geometry/Test/DistanceTest.h
  9. 16
      src/Math/Geometry/Test/IntersectionTest.cpp
  10. 31
      src/Math/Geometry/Test/IntersectionTest.h
  11. 21
      src/Math/Geometry/Test/RectangleTest.cpp
  12. 36
      src/Math/Geometry/Test/RectangleTest.h
  13. 18
      src/Math/Test/ConstantsTest.cpp
  14. 32
      src/Math/Test/ConstantsTest.h
  15. 19
      src/Math/Test/MathTest.cpp
  16. 35
      src/Math/Test/MathTest.h
  17. 21
      src/Math/Test/MathTypeTraitsTest.cpp
  18. 36
      src/Math/Test/MathTypeTraitsTest.h
  19. 31
      src/Math/Test/Matrix3Test.cpp
  20. 44
      src/Math/Test/Matrix3Test.h
  21. 34
      src/Math/Test/Matrix4Test.cpp
  22. 47
      src/Math/Test/Matrix4Test.h
  23. 25
      src/Math/Test/MatrixTest.cpp
  24. 40
      src/Math/Test/MatrixTest.h
  25. 18
      src/Math/Test/Point2DTest.cpp
  26. 33
      src/Math/Test/Point2DTest.h
  27. 18
      src/Math/Test/Point3DTest.cpp
  28. 33
      src/Math/Test/Point3DTest.h
  29. 30
      src/Math/Test/RectangularMatrixTest.cpp
  30. 45
      src/Math/Test/RectangularMatrixTest.h
  31. 15
      src/Math/Test/SwizzleTest.cpp
  32. 33
      src/Math/Test/SwizzleTest.h
  33. 22
      src/Math/Test/Vector2Test.cpp
  34. 37
      src/Math/Test/Vector2Test.h
  35. 24
      src/Math/Test/Vector3Test.cpp
  36. 39
      src/Math/Test/Vector3Test.h
  37. 22
      src/Math/Test/Vector4Test.cpp
  38. 37
      src/Math/Test/Vector4Test.h
  39. 33
      src/Math/Test/VectorTest.cpp
  40. 46
      src/Math/Test/VectorTest.h
  41. 30
      src/MeshTools/Test/CleanTest.cpp
  42. 48
      src/MeshTools/Test/CleanTest.h
  43. 15
      src/MeshTools/Test/CombineIndexedArraysTest.cpp
  44. 32
      src/MeshTools/Test/CombineIndexedArraysTest.h
  45. 16
      src/MeshTools/Test/CompressIndicesTest.cpp
  46. 33
      src/MeshTools/Test/CompressIndicesTest.h
  47. 16
      src/MeshTools/Test/FlipNormalsTest.cpp
  48. 33
      src/MeshTools/Test/FlipNormalsTest.h
  49. 15
      src/MeshTools/Test/GenerateFlatNormalsTest.cpp
  50. 32
      src/MeshTools/Test/GenerateFlatNormalsTest.h
  51. 16
      src/MeshTools/Test/InterleaveTest.cpp
  52. 33
      src/MeshTools/Test/InterleaveTest.h
  53. 34
      src/MeshTools/Test/SubdivideTest.cpp
  54. 51
      src/MeshTools/Test/SubdivideTest.h
  55. 18
      src/MeshTools/Test/TipsifyTest.cpp
  56. 36
      src/MeshTools/Test/TipsifyTest.h
  57. 15
      src/Physics/Test/AbstractShapeTest.cpp
  58. 31
      src/Physics/Test/AbstractShapeTest.h
  59. 13
      src/Physics/Test/AxisAlignedBoxTest.cpp
  60. 31
      src/Physics/Test/AxisAlignedBoxTest.h
  61. 13
      src/Physics/Test/BoxTest.cpp
  62. 31
      src/Physics/Test/BoxTest.h
  63. 15
      src/Physics/Test/CapsuleTest.cpp
  64. 33
      src/Physics/Test/CapsuleTest.h
  65. 13
      src/Physics/Test/LineTest.cpp
  66. 31
      src/Physics/Test/LineTest.h
  67. 13
      src/Physics/Test/ObjectShapeTest.cpp
  68. 31
      src/Physics/Test/ObjectShapeTest.h
  69. 15
      src/Physics/Test/PlaneTest.cpp
  70. 33
      src/Physics/Test/PlaneTest.h
  71. 13
      src/Physics/Test/PointTest.cpp
  72. 31
      src/Physics/Test/PointTest.h
  73. 14
      src/Physics/Test/ShapeGroupTest.cpp
  74. 32
      src/Physics/Test/ShapeGroupTest.h
  75. 17
      src/Physics/Test/SphereTest.cpp
  76. 35
      src/Physics/Test/SphereTest.h
  77. 15
      src/Primitives/Test/CapsuleTest.cpp
  78. 32
      src/Primitives/Test/CapsuleTest.h
  79. 15
      src/Primitives/Test/CylinderTest.cpp
  80. 32
      src/Primitives/Test/CylinderTest.h
  81. 15
      src/Primitives/Test/UVSphereTest.cpp
  82. 32
      src/Primitives/Test/UVSphereTest.h
  83. 21
      src/SceneGraph/Test/AnimableTest.cpp
  84. 38
      src/SceneGraph/Test/AnimableTest.h
  85. 20
      src/SceneGraph/Test/CameraTest.cpp
  86. 38
      src/SceneGraph/Test/CameraTest.h
  87. 19
      src/SceneGraph/Test/ObjectTest.cpp
  88. 36
      src/SceneGraph/Test/ObjectTest.h
  89. 15
      src/SceneGraph/Test/SceneTest.cpp
  90. 32
      src/SceneGraph/Test/SceneTest.h
  91. 16
      src/Test/ArrayTest.cpp
  92. 34
      src/Test/ArrayTest.h
  93. 32
      src/Test/ColorTest.cpp
  94. 49
      src/Test/ColorTest.h
  95. 15
      src/Test/MeshTest.cpp
  96. 32
      src/Test/MeshTest.h
  97. 21
      src/Test/ResourceManagerTest.cpp
  98. 38
      src/Test/ResourceManagerTest.h
  99. 15
      src/Test/SwizzleTest.cpp
  100. 33
      src/Test/SwizzleTest.h
  101. Some files were not shown because too many files have changed in this diff Show More

16
src/Math/Algorithms/Test/GaussJordanTest.cpp

@ -13,15 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "GaussJordanTest.h"
#include <TestSuite/Tester.h>
#include "Math/Algorithms/GaussJordan.h"
#include "Math/Matrix.h"
CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::GaussJordanTest)
#include "Math/Algorithms/GaussJordan.h"
namespace Magnum { namespace Math { namespace Algorithms { namespace Test {
class GaussJordanTest: public Corrade::TestSuite::Tester {
public:
explicit GaussJordanTest();
void singular();
void invert();
};
typedef Matrix<4, float> Matrix4;
GaussJordanTest::GaussJordanTest() {
@ -59,3 +65,5 @@ void GaussJordanTest::invert() {
}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::GaussJordanTest)

32
src/Math/Algorithms/Test/GaussJordanTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Math_Algorithms_Test_GaussJordanTest_h
#define Magnum_Math_Algorithms_Test_GaussJordanTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Algorithms { namespace Test {
class GaussJordanTest: public Corrade::TestSuite::Tester {
public:
GaussJordanTest();
void singular();
void invert();
};
}}}}
#endif

13
src/Math/Algorithms/Test/GramSchmidtTest.cpp

@ -13,14 +13,19 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "GramSchmidtTest.h"
#include <TestSuite/Tester.h>
#include "Math/Algorithms/GramSchmidt.h"
CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::GramSchmidtTest)
namespace Magnum { namespace Math { namespace Algorithms { namespace Test {
class GramSchmidtTest: public Corrade::TestSuite::Tester {
public:
GramSchmidtTest();
void test();
};
typedef Matrix<3, float> Matrix3;
typedef Vector<3, float> Vector3;
@ -58,3 +63,5 @@ void GramSchmidtTest::test() {
}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::GramSchmidtTest)

31
src/Math/Algorithms/Test/GramSchmidtTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Math_Algorithms_Test_GramSchmidtTest_h
#define Magnum_Math_Algorithms_Test_GramSchmidtTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Algorithms { namespace Test {
class GramSchmidtTest: public Corrade::TestSuite::Tester {
public:
GramSchmidtTest();
void test();
};
}}}}
#endif

2
src/Math/CMakeLists.txt

@ -1,5 +1,3 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(MagnumMath_HEADERS
Constants.h
Math.h

2
src/Math/Geometry/CMakeLists.txt

@ -1,5 +1,3 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(MagnumMathGeometry_HEADERS
Distance.h
Intersection.h

21
src/Math/Geometry/Test/DistanceTest.cpp

@ -13,17 +13,24 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "DistanceTest.h"
#include <limits>
#include <TestSuite/Tester.h>
#include "Constants.h"
#include "Distance.h"
CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::DistanceTest)
#include "Math/Constants.h"
#include "Math/Geometry/Distance.h"
namespace Magnum { namespace Math { namespace Geometry { namespace Test {
class DistanceTest: public Corrade::TestSuite::Tester {
public:
DistanceTest();
void linePoint2D();
void linePoint3D();
void lineSegmentPoint2D();
void lineSegmentPoint3D();
};
typedef Magnum::Math::Vector2<float> Vector2;
typedef Magnum::Math::Vector3<float> Vector3;
@ -122,3 +129,5 @@ void DistanceTest::lineSegmentPoint3D() {
}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::DistanceTest)

34
src/Math/Geometry/Test/DistanceTest.h

@ -1,34 +0,0 @@
#ifndef Magnum_Math_Geometry_Test_DistanceTest_h
#define Magnum_Math_Geometry_Test_DistanceTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Geometry { namespace Test {
class DistanceTest: public Corrade::TestSuite::Tester {
public:
DistanceTest();
void linePoint2D();
void linePoint3D();
void lineSegmentPoint2D();
void lineSegmentPoint3D();
};
}}}}
#endif

16
src/Math/Geometry/Test/IntersectionTest.cpp

@ -13,16 +13,20 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "IntersectionTest.h"
#include <TestSuite/Tester.h>
#include <limits>
#include "Intersection.h"
CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::IntersectionTest)
#include "Math/Geometry/Intersection.h"
namespace Magnum { namespace Math { namespace Geometry { namespace Test {
class IntersectionTest: public Corrade::TestSuite::Tester {
public:
IntersectionTest();
void planeLine();
};
typedef Magnum::Math::Vector3<float> Vector3;
IntersectionTest::IntersectionTest() {
@ -51,3 +55,5 @@ void IntersectionTest::planeLine() {
}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::IntersectionTest)

31
src/Math/Geometry/Test/IntersectionTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Math_Geometry_Test_IntersectionTest_h
#define Magnum_Math_Geometry_Test_IntersectionTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Geometry { namespace Test {
class IntersectionTest: public Corrade::TestSuite::Tester {
public:
IntersectionTest();
void planeLine();
};
}}}}
#endif

21
src/Math/Geometry/Test/RectangleTest.cpp

@ -13,16 +13,25 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "RectangleTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "Rectangle.h"
CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::RectangleTest)
#include "Math/Geometry/Rectangle.h"
namespace Magnum { namespace Math { namespace Geometry { namespace Test {
class RectangleTest: public Corrade::TestSuite::Tester {
public:
RectangleTest();
void access();
void compare();
void construct();
void size();
void debug();
};
typedef Geometry::Rectangle<float> Rectangle;
typedef Geometry::Rectangle<std::int32_t> Rectanglei;
typedef Vector2<std::int32_t> Vector2i;
@ -85,3 +94,5 @@ void RectangleTest::debug() {
}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::RectangleTest)

36
src/Math/Geometry/Test/RectangleTest.h

@ -1,36 +0,0 @@
#ifndef Magnum_Math_Geometry_Test_RectangleTest_h
#define Magnum_Math_Geometry_Test_RectangleTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Geometry { namespace Test {
class RectangleTest: public Corrade::TestSuite::Tester {
public:
RectangleTest();
void access();
void compare();
void construct();
void size();
void debug();
};
}}}}
#endif

18
src/Math/Test/ConstantsTest.cpp

@ -13,15 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ConstantsTest.h"
#include <TestSuite/Tester.h>
#include "Constants.h"
#include "Math.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::ConstantsTest)
#include "Math/Constants.h"
#include "Math/Math.h"
namespace Magnum { namespace Math { namespace Test {
class ConstantsTest: public Corrade::TestSuite::Tester {
public:
ConstantsTest();
void constants();
void degrad();
};
ConstantsTest::ConstantsTest() {
addTests(&ConstantsTest::constants,
&ConstantsTest::degrad);
@ -42,3 +48,5 @@ void ConstantsTest::degrad() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::ConstantsTest)

32
src/Math/Test/ConstantsTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Math_Test_ConstantsTest_h
#define Magnum_Math_Test_ConstantsTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class ConstantsTest: public Corrade::TestSuite::Tester {
public:
ConstantsTest();
void constants();
void degrad();
};
}}}
#endif

19
src/Math/Test/MathTest.cpp

@ -13,14 +13,23 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "MathTest.h"
#include <TestSuite/Tester.h>
#include "Math.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::MathTest)
#include "Math/Math.h"
namespace Magnum { namespace Math { namespace Test {
class MathTest: public Corrade::TestSuite::Tester {
public:
MathTest();
void normalize();
void denormalize();
void clamp();
void pow();
void log();
};
MathTest::MathTest() {
addTests(&MathTest::normalize,
&MathTest::denormalize,
@ -97,3 +106,5 @@ void MathTest::log() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::MathTest)

35
src/Math/Test/MathTest.h

@ -1,35 +0,0 @@
#ifndef Magnum_Math_Test_MathTest_h
#define Magnum_Math_Test_MathTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class MathTest: public Corrade::TestSuite::Tester {
public:
MathTest();
void normalize();
void denormalize();
void clamp();
void pow();
void log();
};
}}}
#endif

21
src/Math/Test/MathTypeTraitsTest.cpp

@ -13,16 +13,25 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "MathTypeTraitsTest.h"
#include <limits>
#include <TestSuite/Tester.h>
#include "MathTypeTraits.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::MathTypeTraitsTest)
#include "Math/MathTypeTraits.h"
namespace Magnum { namespace Math { namespace Test {
class MathTypeTraitsTest: public Corrade::TestSuite::Tester {
public:
MathTypeTraitsTest();
void equalsFloatingPoint();
void equalsIntegral();
private:
template<class T> void _equalsFloatingPoint();
template<class T> void _equalsIntegral();
};
MathTypeTraitsTest::MathTypeTraitsTest() {
addTests(&MathTypeTraitsTest::equalsIntegral,
&MathTypeTraitsTest::equalsFloatingPoint);
@ -63,3 +72,5 @@ template<class T> void MathTypeTraitsTest::_equalsFloatingPoint() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::MathTypeTraitsTest)

36
src/Math/Test/MathTypeTraitsTest.h

@ -1,36 +0,0 @@
#ifndef Magnum_Math_Test_MathTypeTraitsTest_h
#define Magnum_Math_Test_MathTypeTraitsTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class MathTypeTraitsTest: public Corrade::TestSuite::Tester {
public:
MathTypeTraitsTest();
void equalsFloatingPoint();
void equalsIntegral();
private:
template<class T> void _equalsFloatingPoint();
template<class T> void _equalsIntegral();
};
}}}
#endif

31
src/Math/Test/Matrix3Test.cpp

@ -13,20 +13,37 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Matrix3Test.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Constants.h"
#include "Matrix3.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix3Test)
#include "Math/Constants.h"
#include "Math/Matrix3.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Matrix3Test: public Corrade::TestSuite::Tester {
public:
Matrix3Test();
void constructIdentity();
void translation();
void scaling();
void rotation();
void reflection();
void fromParts();
void rotationScalingPart();
void rotationPart();
void vectorParts();
void invertedEuclidean();
void debug();
void configuration();
};
typedef Math::Matrix3<float> Matrix3;
typedef Math::Matrix<2, float> Matrix2;
typedef Math::Vector2<float> Vector2;
@ -231,3 +248,5 @@ void Matrix3Test::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix3Test)

44
src/Math/Test/Matrix3Test.h

@ -1,44 +0,0 @@
#ifndef Magnum_Math_Test_Matrix3Test_h
#define Magnum_Math_Test_Matrix3Test_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Matrix3Test: public Corrade::TestSuite::Tester {
public:
Matrix3Test();
void constructIdentity();
void translation();
void scaling();
void rotation();
void reflection();
void fromParts();
void rotationScalingPart();
void rotationPart();
void vectorParts();
void invertedEuclidean();
void debug();
void configuration();
};
}}}
#endif

34
src/Math/Test/Matrix4Test.cpp

@ -13,20 +13,40 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Matrix4Test.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Constants.h"
#include "Matrix4.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix4Test)
#include "Math/Constants.h"
#include "Math/Matrix4.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Matrix4Test: public Corrade::TestSuite::Tester {
public:
Matrix4Test();
void constructIdentity();
void translation();
void scaling();
void rotation();
void rotationX();
void rotationY();
void rotationZ();
void reflection();
void fromParts();
void rotationScalingPart();
void rotationPart();
void vectorParts();
void invertedEuclidean();
void debug();
void configuration();
};
typedef Math::Matrix4<float> Matrix4;
typedef Math::Matrix<3, float> Matrix3;
typedef Math::Vector3<float> Vector3;
@ -287,3 +307,5 @@ void Matrix4Test::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix4Test)

47
src/Math/Test/Matrix4Test.h

@ -1,47 +0,0 @@
#ifndef Magnum_Math_Test_Matrix4Test_h
#define Magnum_Math_Test_Matrix4Test_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Matrix4Test: public Corrade::TestSuite::Tester {
public:
Matrix4Test();
void constructIdentity();
void translation();
void scaling();
void rotation();
void rotationX();
void rotationY();
void rotationZ();
void reflection();
void fromParts();
void rotationScalingPart();
void rotationPart();
void vectorParts();
void invertedEuclidean();
void debug();
void configuration();
};
}}}
#endif

25
src/Math/Test/MatrixTest.cpp

@ -13,19 +13,32 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "MatrixTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Matrix.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::MatrixTest)
#include "Math/Matrix.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class MatrixTest: public Corrade::TestSuite::Tester {
public:
MatrixTest();
void construct();
void constructIdentity();
void constructZero();
void trace();
void ij();
void determinant();
void inverted();
void debug();
void configuration();
};
typedef Matrix<4, float> Matrix4;
typedef Matrix<3, float> Matrix3;
typedef Vector<4, float> Vector4;
@ -202,3 +215,5 @@ void MatrixTest::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::MatrixTest)

40
src/Math/Test/MatrixTest.h

@ -1,40 +0,0 @@
#ifndef Magnum_Math_Test_MatrixTest_h
#define Magnum_Math_Test_MatrixTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class MatrixTest: public Corrade::TestSuite::Tester {
public:
MatrixTest();
void construct();
void constructIdentity();
void constructZero();
void trace();
void ij();
void determinant();
void inverted();
void debug();
void configuration();
};
}}}
#endif

18
src/Math/Test/Point2DTest.cpp

@ -13,19 +13,25 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Point2DTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Point2D.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Point2DTest)
#include "Math/Point2D.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Point2DTest: public Corrade::TestSuite::Tester {
public:
Point2DTest();
void construct();
void debug();
void configuration();
};
typedef Math::Point2D<float> Point2D;
Point2DTest::Point2DTest() {
@ -58,3 +64,5 @@ void Point2DTest::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Point2DTest)

33
src/Math/Test/Point2DTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_Math_Test_Point2DTest_h
#define Magnum_Math_Test_Point2DTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Point2DTest: public Corrade::TestSuite::Tester {
public:
Point2DTest();
void construct();
void debug();
void configuration();
};
}}}
#endif

18
src/Math/Test/Point3DTest.cpp

@ -13,19 +13,25 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Point3DTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Point3D.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Point3DTest)
#include "Math/Point3D.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Point3DTest: public Corrade::TestSuite::Tester {
public:
Point3DTest();
void construct();
void debug();
void configuration();
};
typedef Math::Point3D<float> Point3D;
Point3DTest::Point3DTest() {
@ -58,3 +64,5 @@ void Point3DTest::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Point3DTest)

33
src/Math/Test/Point3DTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_Math_Test_Point3DTest_h
#define Magnum_Math_Test_Point3DTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Point3DTest: public Corrade::TestSuite::Tester {
public:
Point3DTest();
void construct();
void debug();
void configuration();
};
}}}
#endif

30
src/Math/Test/RectangularMatrixTest.cpp

@ -13,19 +13,37 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "RectangularMatrixTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "RectangularMatrix.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::RectangularMatrixTest)
#include "Math/RectangularMatrix.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class RectangularMatrixTest: public Corrade::TestSuite::Tester {
public:
RectangularMatrixTest();
void construct();
void constructFromVectors();
void constructFrom();
void constructZero();
void data();
void negative();
void addSubtract();
void multiplyDivide();
void multiply();
void transposed();
void debug();
void configuration();
};
typedef RectangularMatrix<4, 3, float> Matrix4x3;
typedef RectangularMatrix<3, 4, float> Matrix3x4;
typedef RectangularMatrix<2, 2, float> Matrix2;
@ -251,3 +269,5 @@ void RectangularMatrixTest::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::RectangularMatrixTest)

45
src/Math/Test/RectangularMatrixTest.h

@ -1,45 +0,0 @@
#ifndef Magnum_Math_Test_RectangularMatrixTest_h
#define Magnum_Math_Test_RectangularMatrixTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class RectangularMatrixTest: public Corrade::TestSuite::Tester {
public:
RectangularMatrixTest();
void construct();
void constructFromVectors();
void constructFrom();
void constructZero();
void data();
void negative();
void addSubtract();
void multiplyDivide();
void multiply();
void transposed();
void debug();
void configuration();
};
}}}
#endif

15
src/Math/Test/SwizzleTest.cpp

@ -13,14 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "SwizzleTest.h"
#include <TestSuite/Tester.h>
#include "Math/Swizzle.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::SwizzleTest)
namespace Magnum { namespace Math { namespace Test {
class SwizzleTest: public Corrade::TestSuite::Tester {
public:
SwizzleTest();
void components();
void constants();
void sizes();
};
typedef Vector<4, std::int32_t> Vector4i;
SwizzleTest::SwizzleTest() {
@ -47,3 +54,5 @@ void SwizzleTest::sizes() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::SwizzleTest)

33
src/Math/Test/SwizzleTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_Math_Test_SwizzleTest_h
#define Magnum_Math_Test_SwizzleTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class SwizzleTest: public Corrade::TestSuite::Tester {
public:
SwizzleTest();
void components();
void constants();
void sizes();
};
}}}
#endif

22
src/Math/Test/Vector2Test.cpp

@ -13,19 +13,29 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Vector2Test.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Vector2.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Vector2Test)
#include "Math/Vector2.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Vector2Test: public Corrade::TestSuite::Tester {
public:
Vector2Test();
void construct();
void access();
void axes();
void scales();
void debug();
void configuration();
};
typedef Math::Vector2<float> Vector2;
Vector2Test::Vector2Test() {
@ -79,3 +89,5 @@ void Vector2Test::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Vector2Test)

37
src/Math/Test/Vector2Test.h

@ -1,37 +0,0 @@
#ifndef Magnum_Math_Test_Vector2Test_h
#define Magnum_Math_Test_Vector2Test_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Vector2Test: public Corrade::TestSuite::Tester {
public:
Vector2Test();
void construct();
void access();
void axes();
void scales();
void debug();
void configuration();
};
}}}
#endif

24
src/Math/Test/Vector3Test.cpp

@ -13,19 +13,31 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Vector3Test.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Vector3.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Vector3Test)
#include "Math/Vector3.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Vector3Test: public Corrade::TestSuite::Tester {
public:
Vector3Test();
void construct();
void access();
void cross();
void axes();
void scales();
void twoComponent();
void debug();
void configuration();
};
typedef Math::Vector3<float> Vector3;
typedef Math::Vector2<float> Vector2;
@ -99,3 +111,5 @@ void Vector3Test::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Vector3Test)

39
src/Math/Test/Vector3Test.h

@ -1,39 +0,0 @@
#ifndef Magnum_Math_Test_Vector3Test_h
#define Magnum_Math_Test_Vector3Test_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Vector3Test: public Corrade::TestSuite::Tester {
public:
Vector3Test();
void construct();
void access();
void cross();
void axes();
void scales();
void twoComponent();
void debug();
void configuration();
};
}}}
#endif

22
src/Math/Test/Vector4Test.cpp

@ -13,19 +13,29 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Vector4Test.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Vector4.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::Vector4Test)
#include "Math/Vector4.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class Vector4Test: public Corrade::TestSuite::Tester {
public:
Vector4Test();
void access();
void construct();
void threeComponent();
void twoComponent();
void debug();
void configuration();
};
typedef Math::Vector4<float> Vector4;
typedef Math::Vector3<float> Vector3;
typedef Math::Vector2<float> Vector2;
@ -85,3 +95,5 @@ void Vector4Test::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Vector4Test)

37
src/Math/Test/Vector4Test.h

@ -1,37 +0,0 @@
#ifndef Magnum_Math_Test_Vector4Test_h
#define Magnum_Math_Test_Vector4Test_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class Vector4Test: public Corrade::TestSuite::Tester {
public:
Vector4Test();
void access();
void construct();
void threeComponent();
void twoComponent();
void debug();
void configuration();
};
}}}
#endif

33
src/Math/Test/VectorTest.cpp

@ -13,20 +13,39 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "VectorTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Constants.h"
#include "Vector.h"
CORRADE_TEST_MAIN(Magnum::Math::Test::VectorTest)
#include "Math/Constants.h"
#include "Math/Vector.h"
using namespace Corrade::Utility;
namespace Magnum { namespace Math { namespace Test {
class VectorTest: public Corrade::TestSuite::Tester {
public:
VectorTest();
void construct();
void compareComponentWise();
void dot();
void multiplyDivideComponentWise();
void dotSelf();
void length();
void normalized();
void projected();
void sum();
void product();
void min();
void max();
void angle();
void debug();
void configuration();
};
typedef Vector<4, float> Vector4;
typedef Vector<3, float> Vector3;
@ -151,3 +170,5 @@ void VectorTest::configuration() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::VectorTest)

46
src/Math/Test/VectorTest.h

@ -1,46 +0,0 @@
#ifndef Magnum_Math_Test_VectorTest_h
#define Magnum_Math_Test_VectorTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Math { namespace Test {
class VectorTest: public Corrade::TestSuite::Tester {
public:
VectorTest();
void construct();
void compareComponentWise();
void dot();
void multiplyDivideComponentWise();
void dotSelf();
void length();
void normalized();
void projected();
void sum();
void product();
void min();
void max();
void angle();
void debug();
void configuration();
};
}}}
#endif

30
src/MeshTools/Test/CleanTest.cpp

@ -13,14 +13,36 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "CleanTest.h"
#include <TestSuite/Tester.h>
#include "MeshTools/Clean.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CleanTest)
namespace Magnum { namespace MeshTools { namespace Test {
class CleanTest: public Corrade::TestSuite::Tester {
public:
CleanTest();
void cleanMesh();
private:
class Vector1 {
public:
static const std::size_t Size = 1;
typedef std::int32_t Type;
Vector1(): data(0) {}
Vector1(Type i): data(i) {}
Type operator[](std::size_t) const { return data; }
Type& operator[](std::size_t) { return data; }
bool operator==(Vector1 i) const { return i.data == data; }
Vector1 operator-(Vector1 i) const { return data-i.data; }
private:
Type data;
};
};
CleanTest::CleanTest() {
addTests(&CleanTest::cleanMesh);
}
@ -36,3 +58,5 @@ void CleanTest::cleanMesh() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CleanTest)

48
src/MeshTools/Test/CleanTest.h

@ -1,48 +0,0 @@
#ifndef Magnum_MeshTools_Test_CleanTest_h
#define Magnum_MeshTools_Test_CleanTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class CleanTest: public Corrade::TestSuite::Tester {
public:
CleanTest();
void cleanMesh();
private:
class Vector1 {
public:
static const std::size_t Size = 1;
typedef std::int32_t Type;
Vector1(): data(0) {}
Vector1(Type i): data(i) {}
Type operator[](std::size_t) const { return data; }
Type& operator[](std::size_t) { return data; }
bool operator==(Vector1 i) const { return i.data == data; }
Vector1 operator-(Vector1 i) const { return data-i.data; }
private:
Type data;
};
};
}}}
#endif

15
src/MeshTools/Test/CombineIndexedArraysTest.cpp

@ -13,16 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "CombineIndexedArraysTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "MeshTools/CombineIndexedArrays.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CombineIndexedArraysTest)
namespace Magnum { namespace MeshTools { namespace Test {
class CombineIndexedArraysTest: public Corrade::TestSuite::Tester {
public:
CombineIndexedArraysTest();
void wrongIndexCount();
void combine();
};
CombineIndexedArraysTest::CombineIndexedArraysTest() {
addTests(&CombineIndexedArraysTest::wrongIndexCount,
&CombineIndexedArraysTest::combine);
@ -57,3 +62,5 @@ void CombineIndexedArraysTest::combine() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CombineIndexedArraysTest)

32
src/MeshTools/Test/CombineIndexedArraysTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_MeshTools_Test_CombineIndexedArraysTest_h
#define Magnum_MeshTools_Test_CombineIndexedArraysTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class CombineIndexedArraysTest: public Corrade::TestSuite::Tester {
public:
CombineIndexedArraysTest();
void wrongIndexCount();
void combine();
};
}}}
#endif

16
src/MeshTools/Test/CompressIndicesTest.cpp

@ -13,18 +13,24 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "CompressIndicesTest.h"
#include <TestSuite/Tester.h>
#include <Utility/Endianness.h>
#include "MeshTools/CompressIndices.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CompressIndicesTest)
using Corrade::Utility::Endianness;
namespace Magnum { namespace MeshTools { namespace Test {
class CompressIndicesTest: public Corrade::TestSuite::Tester {
public:
CompressIndicesTest();
void compressChar();
void compressShort();
void compressInt();
};
CompressIndicesTest::CompressIndicesTest() {
addTests(&CompressIndicesTest::compressChar,
&CompressIndicesTest::compressShort,
@ -98,3 +104,5 @@ void CompressIndicesTest::compressInt() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CompressIndicesTest)

33
src/MeshTools/Test/CompressIndicesTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_MeshTools_Test_CompressIndicesTest_h
#define Magnum_MeshTools_Test_CompressIndicesTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class CompressIndicesTest: public Corrade::TestSuite::Tester {
public:
CompressIndicesTest();
void compressChar();
void compressShort();
void compressInt();
};
}}}
#endif

16
src/MeshTools/Test/FlipNormalsTest.cpp

@ -13,17 +13,23 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "FlipNormalsTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "Math/Vector3.h"
#include "MeshTools/FlipNormals.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::FlipNormalsTest)
namespace Magnum { namespace MeshTools { namespace Test {
class FlipNormalsTest: public Corrade::TestSuite::Tester {
public:
FlipNormalsTest();
void wrongIndexCount();
void flipFaceWinding();
void flipNormals();
};
FlipNormalsTest::FlipNormalsTest() {
addTests(&FlipNormalsTest::wrongIndexCount,
&FlipNormalsTest::flipFaceWinding,
@ -61,3 +67,5 @@ void FlipNormalsTest::flipNormals() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::FlipNormalsTest)

33
src/MeshTools/Test/FlipNormalsTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_MeshTools_Test_FlipNormalsTest_h
#define Magnum_MeshTools_Test_FlipNormalsTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class FlipNormalsTest: public Corrade::TestSuite::Tester {
public:
FlipNormalsTest();
void wrongIndexCount();
void flipFaceWinding();
void flipNormals();
};
}}}
#endif

15
src/MeshTools/Test/GenerateFlatNormalsTest.cpp

@ -13,17 +13,22 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "GenerateFlatNormalsTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "Math/Point3D.h"
#include "MeshTools/GenerateFlatNormals.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::GenerateFlatNormalsTest)
namespace Magnum { namespace MeshTools { namespace Test {
class GenerateFlatNormalsTest: public Corrade::TestSuite::Tester {
public:
GenerateFlatNormalsTest();
void wrongIndexCount();
void generate();
};
GenerateFlatNormalsTest::GenerateFlatNormalsTest() {
addTests(&GenerateFlatNormalsTest::wrongIndexCount,
&GenerateFlatNormalsTest::generate);
@ -68,3 +73,5 @@ void GenerateFlatNormalsTest::generate() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::GenerateFlatNormalsTest)

32
src/MeshTools/Test/GenerateFlatNormalsTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_MeshTools_Test_GenerateFlatNormalsTest_h
#define Magnum_MeshTools_Test_GenerateFlatNormalsTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class GenerateFlatNormalsTest: public Corrade::TestSuite::Tester {
public:
GenerateFlatNormalsTest();
void wrongIndexCount();
void generate();
};
}}}
#endif

16
src/MeshTools/Test/InterleaveTest.cpp

@ -13,20 +13,26 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "InterleaveTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "Utility/Endianness.h"
#include "Utility/Debug.h"
#include "MeshTools/Interleave.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::InterleaveTest)
using Corrade::Utility::Endianness;
namespace Magnum { namespace MeshTools { namespace Test {
class InterleaveTest: public Corrade::TestSuite::Tester {
public:
InterleaveTest();
void attributeCount();
void stride();
void write();
};
InterleaveTest::InterleaveTest() {
addTests(&InterleaveTest::attributeCount,
&InterleaveTest::stride,
@ -80,3 +86,5 @@ void InterleaveTest::write() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::InterleaveTest)

33
src/MeshTools/Test/InterleaveTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_MeshTools_Test_InterleaveTest_h
#define Magnum_MeshTools_Test_InterleaveTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class InterleaveTest: public Corrade::TestSuite::Tester {
public:
InterleaveTest();
void attributeCount();
void stride();
void write();
};
}}}
#endif

34
src/MeshTools/Test/SubdivideTest.cpp

@ -13,17 +13,41 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "SubdivideTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "MeshTools/Clean.h"
#include "MeshTools/Subdivide.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::SubdivideTest)
namespace Magnum { namespace MeshTools { namespace Test {
class SubdivideTest: public Corrade::TestSuite::Tester {
public:
SubdivideTest();
void wrongIndexCount();
void subdivide();
private:
class Vector1 {
public:
static const std::size_t Size = 1;
typedef std::int32_t Type;
Vector1(): data(0) {}
Vector1(Type i): data(i) {}
Type operator[](std::size_t) const { return data; }
Type& operator[](std::size_t) { return data; }
bool operator==(Vector1 i) const { return i.data == data; }
Vector1 operator-(Vector1 i) const { return data-i.data; }
private:
Type data;
};
inline static Vector1 interpolator(Vector1 a, Vector1 b) { return (a[0]+b[0])/2; }
};
SubdivideTest::SubdivideTest() {
addTests(&SubdivideTest::wrongIndexCount,
&SubdivideTest::subdivide);
@ -56,3 +80,5 @@ void SubdivideTest::subdivide() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::SubdivideTest)

51
src/MeshTools/Test/SubdivideTest.h

@ -1,51 +0,0 @@
#ifndef Magnum_MeshTools_Test_SubdivideTest_h
#define Magnum_MeshTools_Test_SubdivideTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class SubdivideTest: public Corrade::TestSuite::Tester {
public:
SubdivideTest();
void wrongIndexCount();
void subdivide();
private:
class Vector1 {
public:
static const std::size_t Size = 1;
typedef std::int32_t Type;
Vector1(): data(0) {}
Vector1(Type i): data(i) {}
Type operator[](std::size_t) const { return data; }
Type& operator[](std::size_t) { return data; }
bool operator==(Vector1 i) const { return i.data == data; }
Vector1 operator-(Vector1 i) const { return data-i.data; }
private:
Type data;
};
inline static Vector1 interpolator(Vector1 a, Vector1 b) { return (a[0]+b[0])/2; }
};
}}}
#endif

18
src/MeshTools/Test/TipsifyTest.cpp

@ -13,14 +13,24 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "TipsifyTest.h"
#include <TestSuite/Tester.h>
#include "MeshTools/Tipsify.h"
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::TipsifyTest)
namespace Magnum { namespace MeshTools { namespace Test {
class TipsifyTest: public Corrade::TestSuite::Tester {
public:
TipsifyTest();
void buildAdjacency();
void tipsify();
private:
std::vector<std::uint32_t> indices;
std::size_t vertexCount;
};
/*
0 ----- 1 ----- 2 ----- 3
@ -136,3 +146,5 @@ void TipsifyTest::tipsify() {
}
}}}
CORRADE_TEST_MAIN(Magnum::MeshTools::Test::TipsifyTest)

36
src/MeshTools/Test/TipsifyTest.h

@ -1,36 +0,0 @@
#ifndef Magnum_MeshTools_Test_TipsifyTest_h
#define Magnum_MeshTools_Test_TipsifyTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace MeshTools { namespace Test {
class TipsifyTest: public Corrade::TestSuite::Tester {
public:
TipsifyTest();
void buildAdjacency();
void tipsify();
private:
std::vector<std::uint32_t> indices;
std::size_t vertexCount;
};
}}}
#endif

15
src/Physics/Test/AbstractShapeTest.cpp

@ -13,17 +13,20 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "AbstractShapeTest.h"
#include <sstream>
#include <Utility/Debug.h>
#include <TestSuite/Tester.h>
#include "Physics/AbstractShape.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::AbstractShapeTest)
namespace Magnum { namespace Physics { namespace Test {
class AbstractShapeTest: public Corrade::TestSuite::Tester {
public:
AbstractShapeTest();
void debug();
};
AbstractShapeTest::AbstractShapeTest() {
addTests(&AbstractShapeTest::debug);
}
@ -39,3 +42,5 @@ void AbstractShapeTest::debug() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::AbstractShapeTest)

31
src/Physics/Test/AbstractShapeTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Physics_Test_AbstractShapeTest_h
#define Magnum_Physics_Test_AbstractShapeTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class AbstractShapeTest: public Corrade::TestSuite::Tester {
public:
AbstractShapeTest();
void debug();
};
}}}
#endif

13
src/Physics/Test/AxisAlignedBoxTest.cpp

@ -13,16 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "AxisAlignedBoxTest.h"
#include <TestSuite/Tester.h>
#include "Math/Constants.h"
#include "Math/Matrix4.h"
#include "Physics/AxisAlignedBox.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::AxisAlignedBoxTest)
namespace Magnum { namespace Physics { namespace Test {
class AxisAlignedBoxTest: public Corrade::TestSuite::Tester {
public:
AxisAlignedBoxTest();
void applyTransformation();
};
AxisAlignedBoxTest::AxisAlignedBoxTest() {
addTests(&AxisAlignedBoxTest::applyTransformation);
}
@ -40,3 +45,5 @@ void AxisAlignedBoxTest::applyTransformation() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::AxisAlignedBoxTest)

31
src/Physics/Test/AxisAlignedBoxTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Physics_Test_AxisAlignedBoxTest_h
#define Magnum_Physics_Test_AxisAlignedBoxTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class AxisAlignedBoxTest: public Corrade::TestSuite::Tester {
public:
AxisAlignedBoxTest();
void applyTransformation();
};
}}}
#endif

13
src/Physics/Test/BoxTest.cpp

@ -13,15 +13,20 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "BoxTest.h"
#include <TestSuite/Tester.h>
#include "Math/Matrix4.h"
#include "Physics/Box.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::BoxTest)
namespace Magnum { namespace Physics { namespace Test {
class BoxTest: public Corrade::TestSuite::Tester {
public:
BoxTest();
void applyTransformation();
};
BoxTest::BoxTest() {
addTests(&BoxTest::applyTransformation);
}
@ -34,3 +39,5 @@ void BoxTest::applyTransformation() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::BoxTest)

31
src/Physics/Test/BoxTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Physics_Test_BoxTest_h
#define Magnum_Physics_Test_BoxTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class BoxTest: public Corrade::TestSuite::Tester {
public:
BoxTest();
void applyTransformation();
};
}}}
#endif

15
src/Physics/Test/CapsuleTest.cpp

@ -13,17 +13,24 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "CapsuleTest.h"
#include "Math/Constants.h"
#include "Physics/Capsule.h"
#include "Physics/Point.h"
#include "Physics/Sphere.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::CapsuleTest)
#include "ShapeTestBase.h"
namespace Magnum { namespace Physics { namespace Test {
class CapsuleTest: public Corrade::TestSuite::Tester, ShapeTestBase {
public:
CapsuleTest();
void applyTransformation();
void collisionPoint();
void collisionSphere();
};
CapsuleTest::CapsuleTest() {
addTests(&CapsuleTest::applyTransformation,
&CapsuleTest::collisionPoint);
@ -75,3 +82,5 @@ void CapsuleTest::collisionSphere() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::CapsuleTest)

33
src/Physics/Test/CapsuleTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_Physics_Test_CapsuleTest_h
#define Magnum_Physics_Test_CapsuleTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include "ShapeTestBase.h"
namespace Magnum { namespace Physics { namespace Test {
class CapsuleTest: public Corrade::TestSuite::Tester, ShapeTestBase {
public:
CapsuleTest();
void applyTransformation();
void collisionPoint();
void collisionSphere();
};
}}}
#endif

13
src/Physics/Test/LineTest.cpp

@ -13,16 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "LineTest.h"
#include <TestSuite/Tester.h>
#include "Math/Constants.h"
#include "Math/Matrix4.h"
#include "Physics/Line.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::LineTest)
namespace Magnum { namespace Physics { namespace Test {
class LineTest: public Corrade::TestSuite::Tester {
public:
LineTest();
void applyTransformation();
};
LineTest::LineTest() {
addTests(&LineTest::applyTransformation);
}
@ -35,3 +40,5 @@ void LineTest::applyTransformation() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::LineTest)

31
src/Physics/Test/LineTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Physics_Test_LineTest_h
#define Magnum_Physics_Test_LineTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class LineTest: public Corrade::TestSuite::Tester {
public:
LineTest();
void applyTransformation();
};
}}}
#endif

13
src/Physics/Test/ObjectShapeTest.cpp

@ -13,7 +13,7 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ObjectShapeTest.h"
#include <TestSuite/Tester.h>
#include "Physics/ObjectShapeGroup.h"
#include "Physics/ObjectShape.h"
@ -21,10 +21,15 @@
#include "SceneGraph/MatrixTransformation3D.h"
#include "SceneGraph/Scene.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::ObjectShapeTest)
namespace Magnum { namespace Physics { namespace Test {
class ObjectShapeTest: public Corrade::TestSuite::Tester {
public:
ObjectShapeTest();
void clean();
};
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
@ -74,3 +79,5 @@ void ObjectShapeTest::clean() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::ObjectShapeTest)

31
src/Physics/Test/ObjectShapeTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Physics_Test_ObjectShapeTest_h
#define Magnum_Physics_Test_ObjectShapeTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class ObjectShapeTest: public Corrade::TestSuite::Tester {
public:
ObjectShapeTest();
void clean();
};
}}}
#endif

15
src/Physics/Test/PlaneTest.cpp

@ -13,17 +13,24 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "PlaneTest.h"
#include "Math/Constants.h"
#include "Physics/LineSegment.h"
#include "Physics/Point.h"
#include "Physics/Plane.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::PlaneTest)
#include "ShapeTestBase.h"
namespace Magnum { namespace Physics { namespace Test {
class PlaneTest: public Corrade::TestSuite::Tester, ShapeTestBase {
public:
PlaneTest();
void applyTransformation();
void collisionLine();
void collisionLineSegment();
};
PlaneTest::PlaneTest() {
addTests(&PlaneTest::applyTransformation,
&PlaneTest::collisionLine,
@ -76,3 +83,5 @@ void PlaneTest::collisionLineSegment() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::PlaneTest)

33
src/Physics/Test/PlaneTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_Physics_Test_PlaneTest_h
#define Magnum_Physics_Test_PlaneTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include "ShapeTestBase.h"
namespace Magnum { namespace Physics { namespace Test {
class PlaneTest: public Corrade::TestSuite::Tester, ShapeTestBase {
public:
PlaneTest();
void applyTransformation();
void collisionLine();
void collisionLineSegment();
};
}}}
#endif

13
src/Physics/Test/PointTest.cpp

@ -13,15 +13,20 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "PointTest.h"
#include <TestSuite/Tester.h>
#include "Math/Matrix4.h"
#include "Physics/Point.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::PointTest)
namespace Magnum { namespace Physics { namespace Test {
class PointTest: public Corrade::TestSuite::Tester {
public:
PointTest();
void applyTransformation();
};
PointTest::PointTest() {
addTests(&PointTest::applyTransformation);
}
@ -33,3 +38,5 @@ void PointTest::applyTransformation() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::PointTest)

31
src/Physics/Test/PointTest.h

@ -1,31 +0,0 @@
#ifndef Magnum_Physics_Test_PointTest_h
#define Magnum_Physics_Test_PointTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class PointTest: public Corrade::TestSuite::Tester {
public:
PointTest();
void applyTransformation();
};
}}}
#endif

14
src/Physics/Test/ShapeGroupTest.cpp

@ -13,17 +13,23 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ShapeGroupTest.h"
#include <TestSuite/Tester.h>
#include "Math/Matrix4.h"
#include "Physics/Point.h"
#include "Physics/LineSegment.h"
#include "Physics/ShapeGroup.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::ShapeGroupTest)
namespace Magnum { namespace Physics { namespace Test {
class ShapeGroupTest: public Corrade::TestSuite::Tester {
public:
ShapeGroupTest();
void copy();
void reference();
};
ShapeGroupTest::ShapeGroupTest() {
addTests(&ShapeGroupTest::copy,
&ShapeGroupTest::reference);
@ -57,3 +63,5 @@ void ShapeGroupTest::reference() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::ShapeGroupTest)

32
src/Physics/Test/ShapeGroupTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Physics_Test_ShapeGroupTest_h
#define Magnum_Physics_Test_ShapeGroupTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Physics { namespace Test {
class ShapeGroupTest: public Corrade::TestSuite::Tester {
public:
ShapeGroupTest();
void copy();
void reference();
};
}}}
#endif

17
src/Physics/Test/SphereTest.cpp

@ -13,17 +13,26 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "SphereTest.h"
#include "Math/Constants.h"
#include "Physics/LineSegment.h"
#include "Physics/Point.h"
#include "Physics/Sphere.h"
CORRADE_TEST_MAIN(Magnum::Physics::Test::SphereTest)
#include "ShapeTestBase.h"
namespace Magnum { namespace Physics { namespace Test {
class SphereTest: public Corrade::TestSuite::Tester, ShapeTestBase {
public:
SphereTest();
void applyTransformation();
void collisionPoint();
void collisionLine();
void collisionLineSegment();
void collisionSphere();
};
SphereTest::SphereTest() {
addTests(&SphereTest::applyTransformation,
&SphereTest::collisionPoint,
@ -102,3 +111,5 @@ void SphereTest::collisionSphere() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Physics::Test::SphereTest)

35
src/Physics/Test/SphereTest.h

@ -1,35 +0,0 @@
#ifndef Magnum_Physics_Test_SphereTest_h
#define Magnum_Physics_Test_SphereTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include "ShapeTestBase.h"
namespace Magnum { namespace Physics { namespace Test {
class SphereTest: public Corrade::TestSuite::Tester, ShapeTestBase {
public:
SphereTest();
void applyTransformation();
void collisionPoint();
void collisionLine();
void collisionLineSegment();
void collisionSphere();
};
}}}
#endif

15
src/Primitives/Test/CapsuleTest.cpp

@ -16,8 +16,7 @@
/* Less precision */
#define FLOAT_EQUALITY_PRECISION 1.0e-5
#include "CapsuleTest.h"
#include <TestSuite/Tester.h>
#include <TestSuite/Compare/Container.h>
#include "Math/Point3D.h"
@ -25,10 +24,16 @@
using Corrade::TestSuite::Compare::Container;
CORRADE_TEST_MAIN(Magnum::Primitives::Test::CapsuleTest)
namespace Magnum { namespace Primitives { namespace Test {
class CapsuleTest: public Corrade::TestSuite::Tester {
public:
CapsuleTest();
void withoutTextureCoords();
void withTextureCoords();
};
CapsuleTest::CapsuleTest() {
addTests(&CapsuleTest::withoutTextureCoords,
&CapsuleTest::withTextureCoords);
@ -175,3 +180,5 @@ void CapsuleTest::withTextureCoords() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Primitives::Test::CapsuleTest)

32
src/Primitives/Test/CapsuleTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Primitives_Test_CapsuleTest_h
#define Magnum_Primitives_Test_CapsuleTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Primitives { namespace Test {
class CapsuleTest: public Corrade::TestSuite::Tester {
public:
CapsuleTest();
void withoutTextureCoords();
void withTextureCoords();
};
}}}
#endif

15
src/Primitives/Test/CylinderTest.cpp

@ -13,8 +13,7 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "CylinderTest.h"
#include <TestSuite/Tester.h>
#include <TestSuite/Compare/Container.h>
#include "Math/Point3D.h"
@ -22,10 +21,16 @@
using Corrade::TestSuite::Compare::Container;
CORRADE_TEST_MAIN(Magnum::Primitives::Test::CylinderTest)
namespace Magnum { namespace Primitives { namespace Test {
class CylinderTest: public Corrade::TestSuite::Tester {
public:
CylinderTest();
void withoutAnything();
void withTextureCoordsAndCaps();
};
CylinderTest::CylinderTest() {
addTests(&CylinderTest::withoutAnything,
&CylinderTest::withTextureCoordsAndCaps);
@ -173,3 +178,5 @@ void CylinderTest::withTextureCoordsAndCaps() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Primitives::Test::CylinderTest)

32
src/Primitives/Test/CylinderTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Primitives_Test_CylinderTest_h
#define Magnum_Primitives_Test_CylinderTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Primitives { namespace Test {
class CylinderTest: public Corrade::TestSuite::Tester {
public:
CylinderTest();
void withoutAnything();
void withTextureCoordsAndCaps();
};
}}}
#endif

15
src/Primitives/Test/UVSphereTest.cpp

@ -13,8 +13,7 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "UVSphereTest.h"
#include <TestSuite/Tester.h>
#include <TestSuite/Compare/Container.h>
#include "Math/Point3D.h"
@ -22,10 +21,16 @@
using Corrade::TestSuite::Compare::Container;
CORRADE_TEST_MAIN(Magnum::Primitives::Test::UVSphereTest)
namespace Magnum { namespace Primitives { namespace Test {
class UVSphereTest: public Corrade::TestSuite::Tester {
public:
UVSphereTest();
void withoutTextureCoords();
void withTextureCoords();
};
UVSphereTest::UVSphereTest() {
addTests(&UVSphereTest::withoutTextureCoords,
&UVSphereTest::withTextureCoords);
@ -112,3 +117,5 @@ void UVSphereTest::withTextureCoords() {
}
}}}
CORRADE_TEST_MAIN(Magnum::Primitives::Test::UVSphereTest)

32
src/Primitives/Test/UVSphereTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Primitives_Test_UVSphereTest_h
#define Magnum_Primitives_Test_UVSphereTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Primitives { namespace Test {
class UVSphereTest: public Corrade::TestSuite::Tester {
public:
UVSphereTest();
void withoutTextureCoords();
void withTextureCoords();
};
}}}
#endif

21
src/SceneGraph/Test/AnimableTest.cpp

@ -13,18 +13,29 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "AnimableTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "SceneGraph/Animable.h"
#include "SceneGraph/AnimableGroup.h"
#include "SceneGraph/MatrixTransformation3D.h"
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::AnimableTest)
namespace Magnum { namespace SceneGraph { namespace Test {
class AnimableTest: public Corrade::TestSuite::Tester {
public:
AnimableTest();
void state();
void step();
void duration();
void repeat();
void stop();
void pause();
void debug();
};
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
AnimableTest::AnimableTest() {
@ -304,3 +315,5 @@ void AnimableTest::debug() {
}
}}}
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::AnimableTest)

38
src/SceneGraph/Test/AnimableTest.h

@ -1,38 +0,0 @@
#ifndef Magnum_SceneGraph_Test_AnimableTest_h
#define Magnum_SceneGraph_Test_AnimableTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace SceneGraph { namespace Test {
class AnimableTest: public Corrade::TestSuite::Tester {
public:
AnimableTest();
void state();
void step();
void duration();
void repeat();
void stop();
void pause();
void debug();
};
}}}
#endif

20
src/SceneGraph/Test/CameraTest.cpp

@ -13,7 +13,7 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "CameraTest.h"
#include <TestSuite/Tester.h>
#include "Math/Constants.h"
#include "SceneGraph/AbstractCamera.hpp" /* only for aspectRatioFix(), so it doesn't have to be exported */
@ -24,10 +24,22 @@
#include "SceneGraph/MatrixTransformation3D.h"
#include "SceneGraph/Scene.h"
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::CameraTest)
namespace Magnum { namespace SceneGraph { namespace Test {
class CameraTest: public Corrade::TestSuite::Tester {
public:
CameraTest();
void fixAspectRatio();
void defaultProjection2D();
void defaultProjection3D();
void projection2D();
void orthographic();
void perspective();
void projectionSizeViewport();
void draw();
};
typedef SceneGraph::Object<SceneGraph::MatrixTransformation2D<>> Object2D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D;
@ -209,3 +221,5 @@ void CameraTest::draw() {
}
}}}
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::CameraTest)

38
src/SceneGraph/Test/CameraTest.h

@ -1,38 +0,0 @@
#ifndef Magnum_SceneGraph_Test_CameraTest_h
#define Magnum_SceneGraph_Test_CameraTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace SceneGraph { namespace Test {
class CameraTest: public Corrade::TestSuite::Tester {
public:
CameraTest();
void fixAspectRatio();
void defaultProjection2D();
void defaultProjection3D();
void projection2D();
void orthographic();
void perspective();
void projectionSizeViewport();
void draw();
};
}}}
#endif

19
src/SceneGraph/Test/ObjectTest.cpp

@ -13,18 +13,27 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ObjectTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "Math/Constants.h"
#include "SceneGraph/MatrixTransformation3D.h"
#include "SceneGraph/Scene.h"
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::ObjectTest)
namespace Magnum { namespace SceneGraph { namespace Test {
class ObjectTest: public Corrade::TestSuite::Tester {
public:
ObjectTest();
void parenting();
void scene();
void absoluteTransformation();
void transformations();
void setClean();
void bulkSetClean();
};
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D;
@ -312,3 +321,5 @@ void ObjectTest::bulkSetClean() {
}
}}}
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::ObjectTest)

36
src/SceneGraph/Test/ObjectTest.h

@ -1,36 +0,0 @@
#ifndef Magnum_SceneGraph_Test_ObjectTest_h
#define Magnum_SceneGraph_Test_ObjectTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace SceneGraph { namespace Test {
class ObjectTest: public Corrade::TestSuite::Tester {
public:
ObjectTest();
void parenting();
void scene();
void absoluteTransformation();
void transformations();
void setClean();
void bulkSetClean();
};
}}}
#endif

15
src/SceneGraph/Test/SceneTest.cpp

@ -13,16 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "SceneTest.h"
#include <TestSuite/Tester.h>
#include "Magnum.h"
#include "SceneGraph/MatrixTransformation3D.h"
#include "SceneGraph/Scene.h"
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::SceneTest)
namespace Magnum { namespace SceneGraph { namespace Test {
class SceneTest: public Corrade::TestSuite::Tester {
public:
SceneTest();
void transformation();
void parent();
};
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<GLfloat>> Scene3D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<GLfloat>> Object3D;
@ -52,3 +57,5 @@ void SceneTest::parent() {
}
}}}
CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::SceneTest)

32
src/SceneGraph/Test/SceneTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_SceneGraph_Test_SceneTest_h
#define Magnum_SceneGraph_Test_SceneTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace SceneGraph { namespace Test {
class SceneTest: public Corrade::TestSuite::Tester {
public:
SceneTest();
void transformation();
void parent();
};
}}}
#endif

16
src/Test/ArrayTest.cpp

@ -13,14 +13,22 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ArrayTest.h"
#include <TestSuite/Tester.h>
#include "Array.h"
CORRADE_TEST_MAIN(Magnum::Test::ArrayTest)
namespace Magnum { namespace Test {
class ArrayTest: public Corrade::TestSuite::Tester {
public:
ArrayTest();
void construct();
void constexprConstruct();
void equality();
void access();
};
typedef Magnum::Array1D<int> Array1D;
typedef Magnum::Array2D<int> Array2D;
typedef Magnum::Array3D<int> Array3D;
@ -90,3 +98,5 @@ void ArrayTest::access() {
}
}}
CORRADE_TEST_MAIN(Magnum::Test::ArrayTest)

34
src/Test/ArrayTest.h

@ -1,34 +0,0 @@
#ifndef Magnum_Test_ArrayTest_h
#define Magnum_Test_ArrayTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Test {
class ArrayTest: public Corrade::TestSuite::Tester {
public:
ArrayTest();
void construct();
void constexprConstruct();
void equality();
void access();
};
}}
#endif

32
src/Test/ColorTest.cpp

@ -13,19 +13,41 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ColorTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Color.h"
CORRADE_TEST_MAIN(Magnum::Test::ColorTest)
using namespace Corrade::Utility;
namespace Magnum { namespace Test {
class ColorTest: public Corrade::TestSuite::Tester {
public:
ColorTest();
void access();
void fromDenormalized();
void fromNormalized();
void fromHue();
void fromSaturation();
void fromValue();
void hue();
void saturation();
void value();
void hsv();
void hsvOverflow();
void hsvAlpha();
void debug();
void configuration();
};
typedef Magnum::Color3<std::uint8_t> Color3;
typedef Magnum::Color4<std::uint8_t> Color4;
typedef Magnum::Color3<float> Color3f;
@ -180,3 +202,5 @@ void ColorTest::configuration() {
}
}}
CORRADE_TEST_MAIN(Magnum::Test::ColorTest)

49
src/Test/ColorTest.h

@ -1,49 +0,0 @@
#ifndef Magnum_Test_ColorTest_h
#define Magnum_Test_ColorTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Test {
class ColorTest: public Corrade::TestSuite::Tester {
public:
ColorTest();
void access();
void fromDenormalized();
void fromNormalized();
void fromHue();
void fromSaturation();
void fromValue();
void hue();
void saturation();
void value();
void hsv();
void hsvOverflow();
void hsvAlpha();
void debug();
void configuration();
};
}}
#endif

15
src/Test/MeshTest.cpp

@ -13,19 +13,24 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "MeshTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include <Utility/Configuration.h>
#include "Mesh.h"
CORRADE_TEST_MAIN(Magnum::Test::MeshTest)
using namespace Corrade::Utility;
namespace Magnum { namespace Test {
class MeshTest: public Corrade::TestSuite::Tester {
public:
MeshTest();
void debug();
void configuration();
};
MeshTest::MeshTest() {
addTests(&MeshTest::debug,
&MeshTest::configuration);
@ -46,3 +51,5 @@ void MeshTest::configuration() {
}
}}
CORRADE_TEST_MAIN(Magnum::Test::MeshTest)

32
src/Test/MeshTest.h

@ -1,32 +0,0 @@
#ifndef Magnum_Test_MeshTest_h
#define Magnum_Test_MeshTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Test {
class MeshTest: public Corrade::TestSuite::Tester {
public:
MeshTest();
void debug();
void configuration();
};
}}
#endif

21
src/Test/ResourceManagerTest.cpp

@ -13,9 +13,8 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "ResourceManagerTest.h"
#include <sstream>
#include <TestSuite/Tester.h>
#include "AbstractResourceLoader.h"
#include "ResourceManager.h"
@ -24,10 +23,22 @@
using namespace Corrade::Utility;
CORRADE_TEST_MAIN(Magnum::Test::ResourceManagerTest)
namespace Magnum { namespace Test {
class ResourceManagerTest: public Corrade::TestSuite::Tester {
public:
ResourceManagerTest();
void state();
void stateFallback();
void stateDisallowed();
void basic();
void residentPolicy();
void referenceCountedPolicy();
void manualPolicy();
void loader();
};
class Data {
public:
static std::size_t count;
@ -239,3 +250,5 @@ void ResourceManagerTest::loader() {
}
}}
CORRADE_TEST_MAIN(Magnum::Test::ResourceManagerTest)

38
src/Test/ResourceManagerTest.h

@ -1,38 +0,0 @@
#ifndef Magnum_Test_ResourceManagerTest_h
#define Magnum_Test_ResourceManagerTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Test {
class ResourceManagerTest: public Corrade::TestSuite::Tester {
public:
ResourceManagerTest();
void state();
void stateFallback();
void stateDisallowed();
void basic();
void residentPolicy();
void referenceCountedPolicy();
void manualPolicy();
void loader();
};
}}
#endif

15
src/Test/SwizzleTest.cpp

@ -13,14 +13,21 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "SwizzleTest.h"
#include <TestSuite/Tester.h>
#include "Swizzle.h"
CORRADE_TEST_MAIN(Magnum::Test::SwizzleTest)
namespace Magnum { namespace Test {
class SwizzleTest: public Corrade::TestSuite::Tester {
public:
SwizzleTest();
void rgba();
void type();
void defaultType();
};
SwizzleTest::SwizzleTest() {
addTests(&SwizzleTest::rgba,
&SwizzleTest::type,
@ -52,3 +59,5 @@ void SwizzleTest::defaultType() {
}
}}
CORRADE_TEST_MAIN(Magnum::Test::SwizzleTest)

33
src/Test/SwizzleTest.h

@ -1,33 +0,0 @@
#ifndef Magnum_Test_SwizzleTest_h
#define Magnum_Test_SwizzleTest_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
#include <TestSuite/Tester.h>
namespace Magnum { namespace Test {
class SwizzleTest: public Corrade::TestSuite::Tester {
public:
SwizzleTest();
void rgba();
void type();
void defaultType();
};
}}
#endif

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save