diff --git a/src/Math/Algorithms/Test/GaussJordanTest.cpp b/src/Math/Algorithms/Test/GaussJordanTest.cpp index 5a13365df..aad48debd 100644 --- a/src/Math/Algorithms/Test/GaussJordanTest.cpp +++ b/src/Math/Algorithms/Test/GaussJordanTest.cpp @@ -13,15 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "GaussJordanTest.h" +#include -#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) diff --git a/src/Math/Algorithms/Test/GaussJordanTest.h b/src/Math/Algorithms/Test/GaussJordanTest.h deleted file mode 100644 index fb5389cf9..000000000 --- a/src/Math/Algorithms/Test/GaussJordanTest.h +++ /dev/null @@ -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š - - 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 - -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { - -class GaussJordanTest: public Corrade::TestSuite::Tester { - public: - GaussJordanTest(); - - void singular(); - void invert(); -}; - -}}}} - -#endif diff --git a/src/Math/Algorithms/Test/GramSchmidtTest.cpp b/src/Math/Algorithms/Test/GramSchmidtTest.cpp index b7671eae9..764616324 100644 --- a/src/Math/Algorithms/Test/GramSchmidtTest.cpp +++ b/src/Math/Algorithms/Test/GramSchmidtTest.cpp @@ -13,14 +13,19 @@ GNU Lesser General Public License version 3 for more details. */ -#include "GramSchmidtTest.h" +#include #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) diff --git a/src/Math/Algorithms/Test/GramSchmidtTest.h b/src/Math/Algorithms/Test/GramSchmidtTest.h deleted file mode 100644 index c09df77d8..000000000 --- a/src/Math/Algorithms/Test/GramSchmidtTest.h +++ /dev/null @@ -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š - - 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 - -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { - -class GramSchmidtTest: public Corrade::TestSuite::Tester { - public: - GramSchmidtTest(); - - void test(); -}; - -}}}} - -#endif diff --git a/src/Math/CMakeLists.txt b/src/Math/CMakeLists.txt index 4e4505fee..ed55629d2 100644 --- a/src/Math/CMakeLists.txt +++ b/src/Math/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - set(MagnumMath_HEADERS Constants.h Math.h diff --git a/src/Math/Geometry/CMakeLists.txt b/src/Math/Geometry/CMakeLists.txt index fb55add04..73cd0f0f6 100644 --- a/src/Math/Geometry/CMakeLists.txt +++ b/src/Math/Geometry/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - set(MagnumMathGeometry_HEADERS Distance.h Intersection.h diff --git a/src/Math/Geometry/Test/DistanceTest.cpp b/src/Math/Geometry/Test/DistanceTest.cpp index 79de37345..069ad493d 100644 --- a/src/Math/Geometry/Test/DistanceTest.cpp +++ b/src/Math/Geometry/Test/DistanceTest.cpp @@ -13,17 +13,24 @@ GNU Lesser General Public License version 3 for more details. */ -#include "DistanceTest.h" - #include +#include -#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 Vector2; typedef Magnum::Math::Vector3 Vector3; @@ -122,3 +129,5 @@ void DistanceTest::lineSegmentPoint3D() { } }}}} + +CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::DistanceTest) diff --git a/src/Math/Geometry/Test/DistanceTest.h b/src/Math/Geometry/Test/DistanceTest.h deleted file mode 100644 index 485e1d576..000000000 --- a/src/Math/Geometry/Test/DistanceTest.h +++ /dev/null @@ -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š - - 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 - -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 diff --git a/src/Math/Geometry/Test/IntersectionTest.cpp b/src/Math/Geometry/Test/IntersectionTest.cpp index c19591be8..3e1f27d08 100644 --- a/src/Math/Geometry/Test/IntersectionTest.cpp +++ b/src/Math/Geometry/Test/IntersectionTest.cpp @@ -13,16 +13,20 @@ GNU Lesser General Public License version 3 for more details. */ -#include "IntersectionTest.h" - +#include #include -#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 Vector3; IntersectionTest::IntersectionTest() { @@ -51,3 +55,5 @@ void IntersectionTest::planeLine() { } }}}} + +CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::IntersectionTest) diff --git a/src/Math/Geometry/Test/IntersectionTest.h b/src/Math/Geometry/Test/IntersectionTest.h deleted file mode 100644 index 7375b2d51..000000000 --- a/src/Math/Geometry/Test/IntersectionTest.h +++ /dev/null @@ -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š - - 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 - -namespace Magnum { namespace Math { namespace Geometry { namespace Test { - -class IntersectionTest: public Corrade::TestSuite::Tester { - public: - IntersectionTest(); - - void planeLine(); -}; - -}}}} - -#endif diff --git a/src/Math/Geometry/Test/RectangleTest.cpp b/src/Math/Geometry/Test/RectangleTest.cpp index c5ab1f6e6..20562c860 100644 --- a/src/Math/Geometry/Test/RectangleTest.cpp +++ b/src/Math/Geometry/Test/RectangleTest.cpp @@ -13,16 +13,25 @@ GNU Lesser General Public License version 3 for more details. */ -#include "RectangleTest.h" - #include +#include -#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 Rectangle; typedef Geometry::Rectangle Rectanglei; typedef Vector2 Vector2i; @@ -85,3 +94,5 @@ void RectangleTest::debug() { } }}}} + +CORRADE_TEST_MAIN(Magnum::Math::Geometry::Test::RectangleTest) diff --git a/src/Math/Geometry/Test/RectangleTest.h b/src/Math/Geometry/Test/RectangleTest.h deleted file mode 100644 index 87f552c03..000000000 --- a/src/Math/Geometry/Test/RectangleTest.h +++ /dev/null @@ -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š - - 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 - -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 diff --git a/src/Math/Test/ConstantsTest.cpp b/src/Math/Test/ConstantsTest.cpp index 4a780de5c..0baa25d12 100644 --- a/src/Math/Test/ConstantsTest.cpp +++ b/src/Math/Test/ConstantsTest.cpp @@ -13,15 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ConstantsTest.h" +#include -#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) diff --git a/src/Math/Test/ConstantsTest.h b/src/Math/Test/ConstantsTest.h deleted file mode 100644 index 3a96e0c35..000000000 --- a/src/Math/Test/ConstantsTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Math_Test_ConstantsTest_h -#define Magnum_Math_Test_ConstantsTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Math { namespace Test { - -class ConstantsTest: public Corrade::TestSuite::Tester { - public: - ConstantsTest(); - - void constants(); - void degrad(); -}; - -}}} - -#endif diff --git a/src/Math/Test/MathTest.cpp b/src/Math/Test/MathTest.cpp index 424e470cc..e14aeaf18 100644 --- a/src/Math/Test/MathTest.cpp +++ b/src/Math/Test/MathTest.cpp @@ -13,14 +13,23 @@ GNU Lesser General Public License version 3 for more details. */ -#include "MathTest.h" +#include -#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) diff --git a/src/Math/Test/MathTest.h b/src/Math/Test/MathTest.h deleted file mode 100644 index 3f16d33d9..000000000 --- a/src/Math/Test/MathTest.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef Magnum_Math_Test_MathTest_h -#define Magnum_Math_Test_MathTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/MathTypeTraitsTest.cpp b/src/Math/Test/MathTypeTraitsTest.cpp index e2d08dd1c..74e50d286 100644 --- a/src/Math/Test/MathTypeTraitsTest.cpp +++ b/src/Math/Test/MathTypeTraitsTest.cpp @@ -13,16 +13,25 @@ GNU Lesser General Public License version 3 for more details. */ -#include "MathTypeTraitsTest.h" - #include +#include -#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 void _equalsFloatingPoint(); + template void _equalsIntegral(); +}; + MathTypeTraitsTest::MathTypeTraitsTest() { addTests(&MathTypeTraitsTest::equalsIntegral, &MathTypeTraitsTest::equalsFloatingPoint); @@ -63,3 +72,5 @@ template void MathTypeTraitsTest::_equalsFloatingPoint() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::MathTypeTraitsTest) diff --git a/src/Math/Test/MathTypeTraitsTest.h b/src/Math/Test/MathTypeTraitsTest.h deleted file mode 100644 index 5baa9da49..000000000 --- a/src/Math/Test/MathTypeTraitsTest.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef Magnum_Math_Test_MathTypeTraitsTest_h -#define Magnum_Math_Test_MathTypeTraitsTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Math { namespace Test { - -class MathTypeTraitsTest: public Corrade::TestSuite::Tester { - public: - MathTypeTraitsTest(); - - void equalsFloatingPoint(); - void equalsIntegral(); - - private: - template void _equalsFloatingPoint(); - template void _equalsIntegral(); -}; - -}}} - -#endif diff --git a/src/Math/Test/Matrix3Test.cpp b/src/Math/Test/Matrix3Test.cpp index b9219b57a..bc57f5e51 100644 --- a/src/Math/Test/Matrix3Test.cpp +++ b/src/Math/Test/Matrix3Test.cpp @@ -13,20 +13,37 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Matrix3Test.h" - #include +#include #include -#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 Matrix3; typedef Math::Matrix<2, float> Matrix2; typedef Math::Vector2 Vector2; @@ -231,3 +248,5 @@ void Matrix3Test::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix3Test) diff --git a/src/Math/Test/Matrix3Test.h b/src/Math/Test/Matrix3Test.h deleted file mode 100644 index bea82a6f8..000000000 --- a/src/Math/Test/Matrix3Test.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef Magnum_Math_Test_Matrix3Test_h -#define Magnum_Math_Test_Matrix3Test_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/Matrix4Test.cpp b/src/Math/Test/Matrix4Test.cpp index 0f3ee5be6..7787eb49b 100644 --- a/src/Math/Test/Matrix4Test.cpp +++ b/src/Math/Test/Matrix4Test.cpp @@ -13,20 +13,40 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Matrix4Test.h" - #include +#include #include -#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 Matrix4; typedef Math::Matrix<3, float> Matrix3; typedef Math::Vector3 Vector3; @@ -287,3 +307,5 @@ void Matrix4Test::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix4Test) diff --git a/src/Math/Test/Matrix4Test.h b/src/Math/Test/Matrix4Test.h deleted file mode 100644 index 737778533..000000000 --- a/src/Math/Test/Matrix4Test.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef Magnum_Math_Test_Matrix4Test_h -#define Magnum_Math_Test_Matrix4Test_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/MatrixTest.cpp b/src/Math/Test/MatrixTest.cpp index 28432709d..b004d6a3e 100644 --- a/src/Math/Test/MatrixTest.cpp +++ b/src/Math/Test/MatrixTest.cpp @@ -13,19 +13,32 @@ GNU Lesser General Public License version 3 for more details. */ -#include "MatrixTest.h" - #include +#include #include -#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) diff --git a/src/Math/Test/MatrixTest.h b/src/Math/Test/MatrixTest.h deleted file mode 100644 index a3c6f53ea..000000000 --- a/src/Math/Test/MatrixTest.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef Magnum_Math_Test_MatrixTest_h -#define Magnum_Math_Test_MatrixTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/Point2DTest.cpp b/src/Math/Test/Point2DTest.cpp index 70093d026..f69179c37 100644 --- a/src/Math/Test/Point2DTest.cpp +++ b/src/Math/Test/Point2DTest.cpp @@ -13,19 +13,25 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Point2DTest.h" - #include +#include #include -#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 Point2D; Point2DTest::Point2DTest() { @@ -58,3 +64,5 @@ void Point2DTest::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Point2DTest) diff --git a/src/Math/Test/Point2DTest.h b/src/Math/Test/Point2DTest.h deleted file mode 100644 index 8baf04980..000000000 --- a/src/Math/Test/Point2DTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_Math_Test_Point2DTest_h -#define Magnum_Math_Test_Point2DTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Math { namespace Test { - -class Point2DTest: public Corrade::TestSuite::Tester { - public: - Point2DTest(); - - void construct(); - void debug(); - void configuration(); -}; - -}}} - -#endif diff --git a/src/Math/Test/Point3DTest.cpp b/src/Math/Test/Point3DTest.cpp index dc77ab420..4617b6fbc 100644 --- a/src/Math/Test/Point3DTest.cpp +++ b/src/Math/Test/Point3DTest.cpp @@ -13,19 +13,25 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Point3DTest.h" - #include +#include #include -#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 Point3D; Point3DTest::Point3DTest() { @@ -58,3 +64,5 @@ void Point3DTest::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Point3DTest) diff --git a/src/Math/Test/Point3DTest.h b/src/Math/Test/Point3DTest.h deleted file mode 100644 index 54518afa7..000000000 --- a/src/Math/Test/Point3DTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_Math_Test_Point3DTest_h -#define Magnum_Math_Test_Point3DTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Math { namespace Test { - -class Point3DTest: public Corrade::TestSuite::Tester { - public: - Point3DTest(); - - void construct(); - void debug(); - void configuration(); -}; - -}}} - -#endif diff --git a/src/Math/Test/RectangularMatrixTest.cpp b/src/Math/Test/RectangularMatrixTest.cpp index a2fbd0af8..24fc78fba 100644 --- a/src/Math/Test/RectangularMatrixTest.cpp +++ b/src/Math/Test/RectangularMatrixTest.cpp @@ -13,19 +13,37 @@ GNU Lesser General Public License version 3 for more details. */ -#include "RectangularMatrixTest.h" - #include +#include #include -#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) diff --git a/src/Math/Test/RectangularMatrixTest.h b/src/Math/Test/RectangularMatrixTest.h deleted file mode 100644 index 34754f583..000000000 --- a/src/Math/Test/RectangularMatrixTest.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef Magnum_Math_Test_RectangularMatrixTest_h -#define Magnum_Math_Test_RectangularMatrixTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/SwizzleTest.cpp b/src/Math/Test/SwizzleTest.cpp index 78fc7a1dd..9df00e89f 100644 --- a/src/Math/Test/SwizzleTest.cpp +++ b/src/Math/Test/SwizzleTest.cpp @@ -13,14 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "SwizzleTest.h" +#include #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) diff --git a/src/Math/Test/SwizzleTest.h b/src/Math/Test/SwizzleTest.h deleted file mode 100644 index a2d64fb2a..000000000 --- a/src/Math/Test/SwizzleTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_Math_Test_SwizzleTest_h -#define Magnum_Math_Test_SwizzleTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Math { namespace Test { - -class SwizzleTest: public Corrade::TestSuite::Tester { - public: - SwizzleTest(); - - void components(); - void constants(); - void sizes(); -}; - -}}} - -#endif diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index 7b427650a..729281509 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -13,19 +13,29 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Vector2Test.h" - #include +#include #include -#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 Vector2; Vector2Test::Vector2Test() { @@ -79,3 +89,5 @@ void Vector2Test::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Vector2Test) diff --git a/src/Math/Test/Vector2Test.h b/src/Math/Test/Vector2Test.h deleted file mode 100644 index b9cc71797..000000000 --- a/src/Math/Test/Vector2Test.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef Magnum_Math_Test_Vector2Test_h -#define Magnum_Math_Test_Vector2Test_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/Vector3Test.cpp b/src/Math/Test/Vector3Test.cpp index 6a97a5f87..c4a7a2c03 100644 --- a/src/Math/Test/Vector3Test.cpp +++ b/src/Math/Test/Vector3Test.cpp @@ -13,19 +13,31 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Vector3Test.h" - #include +#include #include -#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 Vector3; typedef Math::Vector2 Vector2; @@ -99,3 +111,5 @@ void Vector3Test::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Vector3Test) diff --git a/src/Math/Test/Vector3Test.h b/src/Math/Test/Vector3Test.h deleted file mode 100644 index 23ecd5db5..000000000 --- a/src/Math/Test/Vector3Test.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef Magnum_Math_Test_Vector3Test_h -#define Magnum_Math_Test_Vector3Test_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/Vector4Test.cpp b/src/Math/Test/Vector4Test.cpp index 9d4b1e959..b1606c230 100644 --- a/src/Math/Test/Vector4Test.cpp +++ b/src/Math/Test/Vector4Test.cpp @@ -13,19 +13,29 @@ GNU Lesser General Public License version 3 for more details. */ -#include "Vector4Test.h" - #include +#include #include -#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 Vector4; typedef Math::Vector3 Vector3; typedef Math::Vector2 Vector2; @@ -85,3 +95,5 @@ void Vector4Test::configuration() { } }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::Vector4Test) diff --git a/src/Math/Test/Vector4Test.h b/src/Math/Test/Vector4Test.h deleted file mode 100644 index 95b41c986..000000000 --- a/src/Math/Test/Vector4Test.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef Magnum_Math_Test_Vector4Test_h -#define Magnum_Math_Test_Vector4Test_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Math/Test/VectorTest.cpp b/src/Math/Test/VectorTest.cpp index f7b1c6e72..3b1dc417c 100644 --- a/src/Math/Test/VectorTest.cpp +++ b/src/Math/Test/VectorTest.cpp @@ -13,20 +13,39 @@ GNU Lesser General Public License version 3 for more details. */ -#include "VectorTest.h" - #include +#include #include -#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) diff --git a/src/Math/Test/VectorTest.h b/src/Math/Test/VectorTest.h deleted file mode 100644 index 94590d604..000000000 --- a/src/Math/Test/VectorTest.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef Magnum_Math_Test_VectorTest_h -#define Magnum_Math_Test_VectorTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/MeshTools/Test/CleanTest.cpp b/src/MeshTools/Test/CleanTest.cpp index 23d80e10b..c26413082 100644 --- a/src/MeshTools/Test/CleanTest.cpp +++ b/src/MeshTools/Test/CleanTest.cpp @@ -13,14 +13,36 @@ GNU Lesser General Public License version 3 for more details. */ -#include "CleanTest.h" +#include #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) diff --git a/src/MeshTools/Test/CleanTest.h b/src/MeshTools/Test/CleanTest.h deleted file mode 100644 index 2b6b797ef..000000000 --- a/src/MeshTools/Test/CleanTest.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef Magnum_MeshTools_Test_CleanTest_h -#define Magnum_MeshTools_Test_CleanTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/MeshTools/Test/CombineIndexedArraysTest.cpp b/src/MeshTools/Test/CombineIndexedArraysTest.cpp index b97447e68..1758d5856 100644 --- a/src/MeshTools/Test/CombineIndexedArraysTest.cpp +++ b/src/MeshTools/Test/CombineIndexedArraysTest.cpp @@ -13,16 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "CombineIndexedArraysTest.h" - #include +#include #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) diff --git a/src/MeshTools/Test/CombineIndexedArraysTest.h b/src/MeshTools/Test/CombineIndexedArraysTest.h deleted file mode 100644 index 80b08c418..000000000 --- a/src/MeshTools/Test/CombineIndexedArraysTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_MeshTools_Test_CombineIndexedArraysTest_h -#define Magnum_MeshTools_Test_CombineIndexedArraysTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace MeshTools { namespace Test { - -class CombineIndexedArraysTest: public Corrade::TestSuite::Tester { - public: - CombineIndexedArraysTest(); - - void wrongIndexCount(); - void combine(); -}; - -}}} - -#endif diff --git a/src/MeshTools/Test/CompressIndicesTest.cpp b/src/MeshTools/Test/CompressIndicesTest.cpp index 7814e2872..696e949fb 100644 --- a/src/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/MeshTools/Test/CompressIndicesTest.cpp @@ -13,18 +13,24 @@ GNU Lesser General Public License version 3 for more details. */ -#include "CompressIndicesTest.h" - +#include #include #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) diff --git a/src/MeshTools/Test/CompressIndicesTest.h b/src/MeshTools/Test/CompressIndicesTest.h deleted file mode 100644 index 187610326..000000000 --- a/src/MeshTools/Test/CompressIndicesTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_MeshTools_Test_CompressIndicesTest_h -#define Magnum_MeshTools_Test_CompressIndicesTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace MeshTools { namespace Test { - -class CompressIndicesTest: public Corrade::TestSuite::Tester { - public: - CompressIndicesTest(); - - void compressChar(); - void compressShort(); - void compressInt(); -}; - -}}} - -#endif diff --git a/src/MeshTools/Test/FlipNormalsTest.cpp b/src/MeshTools/Test/FlipNormalsTest.cpp index 0a693b6de..6fc61d1ca 100644 --- a/src/MeshTools/Test/FlipNormalsTest.cpp +++ b/src/MeshTools/Test/FlipNormalsTest.cpp @@ -13,17 +13,23 @@ GNU Lesser General Public License version 3 for more details. */ -#include "FlipNormalsTest.h" - #include +#include #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) diff --git a/src/MeshTools/Test/FlipNormalsTest.h b/src/MeshTools/Test/FlipNormalsTest.h deleted file mode 100644 index 8a25d8bed..000000000 --- a/src/MeshTools/Test/FlipNormalsTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_MeshTools_Test_FlipNormalsTest_h -#define Magnum_MeshTools_Test_FlipNormalsTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace MeshTools { namespace Test { - -class FlipNormalsTest: public Corrade::TestSuite::Tester { - public: - FlipNormalsTest(); - - void wrongIndexCount(); - void flipFaceWinding(); - void flipNormals(); -}; - -}}} - -#endif diff --git a/src/MeshTools/Test/GenerateFlatNormalsTest.cpp b/src/MeshTools/Test/GenerateFlatNormalsTest.cpp index 5f91f05d9..64107680e 100644 --- a/src/MeshTools/Test/GenerateFlatNormalsTest.cpp +++ b/src/MeshTools/Test/GenerateFlatNormalsTest.cpp @@ -13,17 +13,22 @@ GNU Lesser General Public License version 3 for more details. */ -#include "GenerateFlatNormalsTest.h" - #include +#include #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) diff --git a/src/MeshTools/Test/GenerateFlatNormalsTest.h b/src/MeshTools/Test/GenerateFlatNormalsTest.h deleted file mode 100644 index b699e991e..000000000 --- a/src/MeshTools/Test/GenerateFlatNormalsTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_MeshTools_Test_GenerateFlatNormalsTest_h -#define Magnum_MeshTools_Test_GenerateFlatNormalsTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace MeshTools { namespace Test { - -class GenerateFlatNormalsTest: public Corrade::TestSuite::Tester { - public: - GenerateFlatNormalsTest(); - - void wrongIndexCount(); - void generate(); -}; - -}}} - -#endif diff --git a/src/MeshTools/Test/InterleaveTest.cpp b/src/MeshTools/Test/InterleaveTest.cpp index e3416b166..09f1ba2d3 100644 --- a/src/MeshTools/Test/InterleaveTest.cpp +++ b/src/MeshTools/Test/InterleaveTest.cpp @@ -13,20 +13,26 @@ GNU Lesser General Public License version 3 for more details. */ -#include "InterleaveTest.h" - #include +#include #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) diff --git a/src/MeshTools/Test/InterleaveTest.h b/src/MeshTools/Test/InterleaveTest.h deleted file mode 100644 index 19aae30fb..000000000 --- a/src/MeshTools/Test/InterleaveTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_MeshTools_Test_InterleaveTest_h -#define Magnum_MeshTools_Test_InterleaveTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace MeshTools { namespace Test { - -class InterleaveTest: public Corrade::TestSuite::Tester { - public: - InterleaveTest(); - - void attributeCount(); - void stride(); - void write(); -}; - -}}} - -#endif diff --git a/src/MeshTools/Test/SubdivideTest.cpp b/src/MeshTools/Test/SubdivideTest.cpp index 33401d54d..4bd09edd9 100644 --- a/src/MeshTools/Test/SubdivideTest.cpp +++ b/src/MeshTools/Test/SubdivideTest.cpp @@ -13,17 +13,41 @@ GNU Lesser General Public License version 3 for more details. */ -#include "SubdivideTest.h" - #include +#include #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) diff --git a/src/MeshTools/Test/SubdivideTest.h b/src/MeshTools/Test/SubdivideTest.h deleted file mode 100644 index 9d1521a9c..000000000 --- a/src/MeshTools/Test/SubdivideTest.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef Magnum_MeshTools_Test_SubdivideTest_h -#define Magnum_MeshTools_Test_SubdivideTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/MeshTools/Test/TipsifyTest.cpp b/src/MeshTools/Test/TipsifyTest.cpp index 6138075b7..a62159947 100644 --- a/src/MeshTools/Test/TipsifyTest.cpp +++ b/src/MeshTools/Test/TipsifyTest.cpp @@ -13,14 +13,24 @@ GNU Lesser General Public License version 3 for more details. */ -#include "TipsifyTest.h" +#include #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 indices; + std::size_t vertexCount; +}; + /* 0 ----- 1 ----- 2 ----- 3 @@ -136,3 +146,5 @@ void TipsifyTest::tipsify() { } }}} + +CORRADE_TEST_MAIN(Magnum::MeshTools::Test::TipsifyTest) diff --git a/src/MeshTools/Test/TipsifyTest.h b/src/MeshTools/Test/TipsifyTest.h deleted file mode 100644 index 5e4952430..000000000 --- a/src/MeshTools/Test/TipsifyTest.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef Magnum_MeshTools_Test_TipsifyTest_h -#define Magnum_MeshTools_Test_TipsifyTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace MeshTools { namespace Test { - -class TipsifyTest: public Corrade::TestSuite::Tester { - public: - TipsifyTest(); - - void buildAdjacency(); - void tipsify(); - - private: - std::vector indices; - std::size_t vertexCount; -}; - -}}} - -#endif diff --git a/src/Physics/Test/AbstractShapeTest.cpp b/src/Physics/Test/AbstractShapeTest.cpp index a7979c8ae..973041087 100644 --- a/src/Physics/Test/AbstractShapeTest.cpp +++ b/src/Physics/Test/AbstractShapeTest.cpp @@ -13,17 +13,20 @@ GNU Lesser General Public License version 3 for more details. */ -#include "AbstractShapeTest.h" - #include -#include +#include #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) diff --git a/src/Physics/Test/AbstractShapeTest.h b/src/Physics/Test/AbstractShapeTest.h deleted file mode 100644 index 4272b72d5..000000000 --- a/src/Physics/Test/AbstractShapeTest.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef Magnum_Physics_Test_AbstractShapeTest_h -#define Magnum_Physics_Test_AbstractShapeTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class AbstractShapeTest: public Corrade::TestSuite::Tester { - public: - AbstractShapeTest(); - - void debug(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/AxisAlignedBoxTest.cpp b/src/Physics/Test/AxisAlignedBoxTest.cpp index a3b8595d8..a9554d30d 100644 --- a/src/Physics/Test/AxisAlignedBoxTest.cpp +++ b/src/Physics/Test/AxisAlignedBoxTest.cpp @@ -13,16 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "AxisAlignedBoxTest.h" +#include #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) diff --git a/src/Physics/Test/AxisAlignedBoxTest.h b/src/Physics/Test/AxisAlignedBoxTest.h deleted file mode 100644 index 63451a508..000000000 --- a/src/Physics/Test/AxisAlignedBoxTest.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef Magnum_Physics_Test_AxisAlignedBoxTest_h -#define Magnum_Physics_Test_AxisAlignedBoxTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class AxisAlignedBoxTest: public Corrade::TestSuite::Tester { - public: - AxisAlignedBoxTest(); - - void applyTransformation(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/BoxTest.cpp b/src/Physics/Test/BoxTest.cpp index 824ce34d9..7c162baee 100644 --- a/src/Physics/Test/BoxTest.cpp +++ b/src/Physics/Test/BoxTest.cpp @@ -13,15 +13,20 @@ GNU Lesser General Public License version 3 for more details. */ -#include "BoxTest.h" +#include #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) diff --git a/src/Physics/Test/BoxTest.h b/src/Physics/Test/BoxTest.h deleted file mode 100644 index abf67ce52..000000000 --- a/src/Physics/Test/BoxTest.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef Magnum_Physics_Test_BoxTest_h -#define Magnum_Physics_Test_BoxTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class BoxTest: public Corrade::TestSuite::Tester { - public: - BoxTest(); - - void applyTransformation(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/CapsuleTest.cpp b/src/Physics/Test/CapsuleTest.cpp index 04c85235b..60636bf5e 100644 --- a/src/Physics/Test/CapsuleTest.cpp +++ b/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) diff --git a/src/Physics/Test/CapsuleTest.h b/src/Physics/Test/CapsuleTest.h deleted file mode 100644 index 6c6c969a1..000000000 --- a/src/Physics/Test/CapsuleTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_Physics_Test_CapsuleTest_h -#define Magnum_Physics_Test_CapsuleTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 diff --git a/src/Physics/Test/LineTest.cpp b/src/Physics/Test/LineTest.cpp index 2de48f44a..2b9c8be2c 100644 --- a/src/Physics/Test/LineTest.cpp +++ b/src/Physics/Test/LineTest.cpp @@ -13,16 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "LineTest.h" +#include #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) diff --git a/src/Physics/Test/LineTest.h b/src/Physics/Test/LineTest.h deleted file mode 100644 index 8f33c3245..000000000 --- a/src/Physics/Test/LineTest.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef Magnum_Physics_Test_LineTest_h -#define Magnum_Physics_Test_LineTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class LineTest: public Corrade::TestSuite::Tester { - public: - LineTest(); - - void applyTransformation(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/ObjectShapeTest.cpp b/src/Physics/Test/ObjectShapeTest.cpp index dd5b438bd..256e453d0 100644 --- a/src/Physics/Test/ObjectShapeTest.cpp +++ b/src/Physics/Test/ObjectShapeTest.cpp @@ -13,7 +13,7 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ObjectShapeTest.h" +#include #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> Scene3D; typedef SceneGraph::Object> Object3D; @@ -74,3 +79,5 @@ void ObjectShapeTest::clean() { } }}} + +CORRADE_TEST_MAIN(Magnum::Physics::Test::ObjectShapeTest) diff --git a/src/Physics/Test/ObjectShapeTest.h b/src/Physics/Test/ObjectShapeTest.h deleted file mode 100644 index 6a3f0b398..000000000 --- a/src/Physics/Test/ObjectShapeTest.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef Magnum_Physics_Test_ObjectShapeTest_h -#define Magnum_Physics_Test_ObjectShapeTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class ObjectShapeTest: public Corrade::TestSuite::Tester { - public: - ObjectShapeTest(); - - void clean(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/PlaneTest.cpp b/src/Physics/Test/PlaneTest.cpp index 2ec0ab9d0..d3af840e0 100644 --- a/src/Physics/Test/PlaneTest.cpp +++ b/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) diff --git a/src/Physics/Test/PlaneTest.h b/src/Physics/Test/PlaneTest.h deleted file mode 100644 index d685917e4..000000000 --- a/src/Physics/Test/PlaneTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_Physics_Test_PlaneTest_h -#define Magnum_Physics_Test_PlaneTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 diff --git a/src/Physics/Test/PointTest.cpp b/src/Physics/Test/PointTest.cpp index 25c36bf53..5a2cbe83f 100644 --- a/src/Physics/Test/PointTest.cpp +++ b/src/Physics/Test/PointTest.cpp @@ -13,15 +13,20 @@ GNU Lesser General Public License version 3 for more details. */ -#include "PointTest.h" +#include #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) diff --git a/src/Physics/Test/PointTest.h b/src/Physics/Test/PointTest.h deleted file mode 100644 index 529ffbd9e..000000000 --- a/src/Physics/Test/PointTest.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef Magnum_Physics_Test_PointTest_h -#define Magnum_Physics_Test_PointTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class PointTest: public Corrade::TestSuite::Tester { - public: - PointTest(); - - void applyTransformation(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/ShapeGroupTest.cpp b/src/Physics/Test/ShapeGroupTest.cpp index eb5d0f989..74189b5ca 100644 --- a/src/Physics/Test/ShapeGroupTest.cpp +++ b/src/Physics/Test/ShapeGroupTest.cpp @@ -13,17 +13,23 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ShapeGroupTest.h" +#include #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) diff --git a/src/Physics/Test/ShapeGroupTest.h b/src/Physics/Test/ShapeGroupTest.h deleted file mode 100644 index 49c93a949..000000000 --- a/src/Physics/Test/ShapeGroupTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Physics_Test_ShapeGroupTest_h -#define Magnum_Physics_Test_ShapeGroupTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Physics { namespace Test { - -class ShapeGroupTest: public Corrade::TestSuite::Tester { - public: - ShapeGroupTest(); - - void copy(); - void reference(); -}; - -}}} - -#endif diff --git a/src/Physics/Test/SphereTest.cpp b/src/Physics/Test/SphereTest.cpp index 3b8414e79..f53057f6d 100644 --- a/src/Physics/Test/SphereTest.cpp +++ b/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) diff --git a/src/Physics/Test/SphereTest.h b/src/Physics/Test/SphereTest.h deleted file mode 100644 index a8fa7ef0b..000000000 --- a/src/Physics/Test/SphereTest.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef Magnum_Physics_Test_SphereTest_h -#define Magnum_Physics_Test_SphereTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 diff --git a/src/Primitives/Test/CapsuleTest.cpp b/src/Primitives/Test/CapsuleTest.cpp index 51f2230ea..a39871d77 100644 --- a/src/Primitives/Test/CapsuleTest.cpp +++ b/src/Primitives/Test/CapsuleTest.cpp @@ -16,8 +16,7 @@ /* Less precision */ #define FLOAT_EQUALITY_PRECISION 1.0e-5 -#include "CapsuleTest.h" - +#include #include #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) diff --git a/src/Primitives/Test/CapsuleTest.h b/src/Primitives/Test/CapsuleTest.h deleted file mode 100644 index ab276ae4f..000000000 --- a/src/Primitives/Test/CapsuleTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Primitives_Test_CapsuleTest_h -#define Magnum_Primitives_Test_CapsuleTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Primitives { namespace Test { - -class CapsuleTest: public Corrade::TestSuite::Tester { - public: - CapsuleTest(); - - void withoutTextureCoords(); - void withTextureCoords(); -}; - -}}} - -#endif diff --git a/src/Primitives/Test/CylinderTest.cpp b/src/Primitives/Test/CylinderTest.cpp index 4eda71de4..dd951d8e5 100644 --- a/src/Primitives/Test/CylinderTest.cpp +++ b/src/Primitives/Test/CylinderTest.cpp @@ -13,8 +13,7 @@ GNU Lesser General Public License version 3 for more details. */ -#include "CylinderTest.h" - +#include #include #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) diff --git a/src/Primitives/Test/CylinderTest.h b/src/Primitives/Test/CylinderTest.h deleted file mode 100644 index 48234fb99..000000000 --- a/src/Primitives/Test/CylinderTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Primitives_Test_CylinderTest_h -#define Magnum_Primitives_Test_CylinderTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Primitives { namespace Test { - -class CylinderTest: public Corrade::TestSuite::Tester { - public: - CylinderTest(); - - void withoutAnything(); - void withTextureCoordsAndCaps(); -}; - -}}} - -#endif diff --git a/src/Primitives/Test/UVSphereTest.cpp b/src/Primitives/Test/UVSphereTest.cpp index 4a57c5c0b..20c88f625 100644 --- a/src/Primitives/Test/UVSphereTest.cpp +++ b/src/Primitives/Test/UVSphereTest.cpp @@ -13,8 +13,7 @@ GNU Lesser General Public License version 3 for more details. */ -#include "UVSphereTest.h" - +#include #include #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) diff --git a/src/Primitives/Test/UVSphereTest.h b/src/Primitives/Test/UVSphereTest.h deleted file mode 100644 index 560cb9d4c..000000000 --- a/src/Primitives/Test/UVSphereTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Primitives_Test_UVSphereTest_h -#define Magnum_Primitives_Test_UVSphereTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Primitives { namespace Test { - -class UVSphereTest: public Corrade::TestSuite::Tester { - public: - UVSphereTest(); - - void withoutTextureCoords(); - void withTextureCoords(); -}; - -}}} - -#endif diff --git a/src/SceneGraph/Test/AnimableTest.cpp b/src/SceneGraph/Test/AnimableTest.cpp index 9b6505589..d824ff4ff 100644 --- a/src/SceneGraph/Test/AnimableTest.cpp +++ b/src/SceneGraph/Test/AnimableTest.cpp @@ -13,18 +13,29 @@ GNU Lesser General Public License version 3 for more details. */ -#include "AnimableTest.h" - #include +#include #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> Object3D; AnimableTest::AnimableTest() { @@ -304,3 +315,5 @@ void AnimableTest::debug() { } }}} + +CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::AnimableTest) diff --git a/src/SceneGraph/Test/AnimableTest.h b/src/SceneGraph/Test/AnimableTest.h deleted file mode 100644 index 1428db3ca..000000000 --- a/src/SceneGraph/Test/AnimableTest.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef Magnum_SceneGraph_Test_AnimableTest_h -#define Magnum_SceneGraph_Test_AnimableTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/SceneGraph/Test/CameraTest.cpp b/src/SceneGraph/Test/CameraTest.cpp index 4dd856798..e0a737e24 100644 --- a/src/SceneGraph/Test/CameraTest.cpp +++ b/src/SceneGraph/Test/CameraTest.cpp @@ -13,7 +13,7 @@ GNU Lesser General Public License version 3 for more details. */ -#include "CameraTest.h" +#include #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> Object2D; typedef SceneGraph::Object> Object3D; typedef SceneGraph::Scene> Scene3D; @@ -209,3 +221,5 @@ void CameraTest::draw() { } }}} + +CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::CameraTest) diff --git a/src/SceneGraph/Test/CameraTest.h b/src/SceneGraph/Test/CameraTest.h deleted file mode 100644 index b43ec879b..000000000 --- a/src/SceneGraph/Test/CameraTest.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef Magnum_SceneGraph_Test_CameraTest_h -#define Magnum_SceneGraph_Test_CameraTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/SceneGraph/Test/ObjectTest.cpp b/src/SceneGraph/Test/ObjectTest.cpp index 60bab57b6..bf586bb10 100644 --- a/src/SceneGraph/Test/ObjectTest.cpp +++ b/src/SceneGraph/Test/ObjectTest.cpp @@ -13,18 +13,27 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ObjectTest.h" - #include +#include #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> Object3D; typedef SceneGraph::Scene> Scene3D; @@ -312,3 +321,5 @@ void ObjectTest::bulkSetClean() { } }}} + +CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::ObjectTest) diff --git a/src/SceneGraph/Test/ObjectTest.h b/src/SceneGraph/Test/ObjectTest.h deleted file mode 100644 index 0c2e594d9..000000000 --- a/src/SceneGraph/Test/ObjectTest.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef Magnum_SceneGraph_Test_ObjectTest_h -#define Magnum_SceneGraph_Test_ObjectTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/SceneGraph/Test/SceneTest.cpp b/src/SceneGraph/Test/SceneTest.cpp index 301a82846..a8c7b177e 100644 --- a/src/SceneGraph/Test/SceneTest.cpp +++ b/src/SceneGraph/Test/SceneTest.cpp @@ -13,16 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "SceneTest.h" +#include -#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> Scene3D; typedef SceneGraph::Object> Object3D; @@ -52,3 +57,5 @@ void SceneTest::parent() { } }}} + +CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::SceneTest) diff --git a/src/SceneGraph/Test/SceneTest.h b/src/SceneGraph/Test/SceneTest.h deleted file mode 100644 index 93aef48a7..000000000 --- a/src/SceneGraph/Test/SceneTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_SceneGraph_Test_SceneTest_h -#define Magnum_SceneGraph_Test_SceneTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace SceneGraph { namespace Test { - -class SceneTest: public Corrade::TestSuite::Tester { - public: - SceneTest(); - - void transformation(); - void parent(); -}; - -}}} - -#endif diff --git a/src/Test/ArrayTest.cpp b/src/Test/ArrayTest.cpp index 928ecc274..eb3fe1da9 100644 --- a/src/Test/ArrayTest.cpp +++ b/src/Test/ArrayTest.cpp @@ -13,14 +13,22 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ArrayTest.h" +#include #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 Array1D; typedef Magnum::Array2D Array2D; typedef Magnum::Array3D Array3D; @@ -90,3 +98,5 @@ void ArrayTest::access() { } }} + +CORRADE_TEST_MAIN(Magnum::Test::ArrayTest) diff --git a/src/Test/ArrayTest.h b/src/Test/ArrayTest.h deleted file mode 100644 index eab504e9b..000000000 --- a/src/Test/ArrayTest.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef Magnum_Test_ArrayTest_h -#define Magnum_Test_ArrayTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Test { - -class ArrayTest: public Corrade::TestSuite::Tester { - public: - ArrayTest(); - - void construct(); - void constexprConstruct(); - void equality(); - void access(); -}; - -}} - -#endif diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 6d77f5555..d7ae54931 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -13,19 +13,41 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ColorTest.h" - #include +#include #include #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 Color3; typedef Magnum::Color4 Color4; typedef Magnum::Color3 Color3f; @@ -180,3 +202,5 @@ void ColorTest::configuration() { } }} + +CORRADE_TEST_MAIN(Magnum::Test::ColorTest) diff --git a/src/Test/ColorTest.h b/src/Test/ColorTest.h deleted file mode 100644 index 27991ea3d..000000000 --- a/src/Test/ColorTest.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef Magnum_Test_ColorTest_h -#define Magnum_Test_ColorTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Test/MeshTest.cpp b/src/Test/MeshTest.cpp index 36b3248d8..658febb17 100644 --- a/src/Test/MeshTest.cpp +++ b/src/Test/MeshTest.cpp @@ -13,19 +13,24 @@ GNU Lesser General Public License version 3 for more details. */ -#include "MeshTest.h" - #include +#include #include #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) diff --git a/src/Test/MeshTest.h b/src/Test/MeshTest.h deleted file mode 100644 index 4b40a3f69..000000000 --- a/src/Test/MeshTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Test_MeshTest_h -#define Magnum_Test_MeshTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Test { - -class MeshTest: public Corrade::TestSuite::Tester { - public: - MeshTest(); - - void debug(); - void configuration(); -}; - -}} - -#endif diff --git a/src/Test/ResourceManagerTest.cpp b/src/Test/ResourceManagerTest.cpp index 6efa8c520..79a2c308f 100644 --- a/src/Test/ResourceManagerTest.cpp +++ b/src/Test/ResourceManagerTest.cpp @@ -13,9 +13,8 @@ GNU Lesser General Public License version 3 for more details. */ -#include "ResourceManagerTest.h" - #include +#include #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) diff --git a/src/Test/ResourceManagerTest.h b/src/Test/ResourceManagerTest.h deleted file mode 100644 index 35aa5aa0a..000000000 --- a/src/Test/ResourceManagerTest.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef Magnum_Test_ResourceManagerTest_h -#define Magnum_Test_ResourceManagerTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -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 diff --git a/src/Test/SwizzleTest.cpp b/src/Test/SwizzleTest.cpp index b07c4da34..d3f500333 100644 --- a/src/Test/SwizzleTest.cpp +++ b/src/Test/SwizzleTest.cpp @@ -13,14 +13,21 @@ GNU Lesser General Public License version 3 for more details. */ -#include "SwizzleTest.h" +#include #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) diff --git a/src/Test/SwizzleTest.h b/src/Test/SwizzleTest.h deleted file mode 100644 index e432ed9ec..000000000 --- a/src/Test/SwizzleTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_Test_SwizzleTest_h -#define Magnum_Test_SwizzleTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Test { - -class SwizzleTest: public Corrade::TestSuite::Tester { - public: - SwizzleTest(); - - void rgba(); - void type(); - void defaultType(); -}; - -}} - -#endif diff --git a/src/Test/TypeTraitsTest.cpp b/src/Test/TypeTraitsTest.cpp index 6da0f265f..a6da165a7 100644 --- a/src/Test/TypeTraitsTest.cpp +++ b/src/Test/TypeTraitsTest.cpp @@ -13,19 +13,24 @@ GNU Lesser General Public License version 3 for more details. */ -#include "TypeTraitsTest.h" - #include +#include #include #include "TypeTraits.h" -CORRADE_TEST_MAIN(Magnum::Test::TypeTraitsTest) - using namespace Corrade::Utility; namespace Magnum { namespace Test { +class TypeTraitsTest: public Corrade::TestSuite::Tester { + public: + TypeTraitsTest(); + + void debug(); + void configuration(); +}; + TypeTraitsTest::TypeTraitsTest() { addTests(&TypeTraitsTest::debug, &TypeTraitsTest::configuration); @@ -46,3 +51,5 @@ void TypeTraitsTest::configuration() { } }} + +CORRADE_TEST_MAIN(Magnum::Test::TypeTraitsTest) diff --git a/src/Test/TypeTraitsTest.h b/src/Test/TypeTraitsTest.h deleted file mode 100644 index d39a42265..000000000 --- a/src/Test/TypeTraitsTest.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef Magnum_Test_TypeTraitsTest_h -#define Magnum_Test_TypeTraitsTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace Test { - -class TypeTraitsTest: public Corrade::TestSuite::Tester { - public: - TypeTraitsTest(); - - void debug(); - void configuration(); -}; - -}} - -#endif diff --git a/src/TextureTools/Test/AtlasTest.cpp b/src/TextureTools/Test/AtlasTest.cpp index 01a7e53ce..de508ce2d 100644 --- a/src/TextureTools/Test/AtlasTest.cpp +++ b/src/TextureTools/Test/AtlasTest.cpp @@ -13,17 +13,23 @@ GNU Lesser General Public License version 3 for more details. */ -#include "AtlasTest.h" - #include +#include #include "Math/Geometry/Rectangle.h" #include "TextureTools/Atlas.h" -CORRADE_TEST_MAIN(Magnum::TextureTools::Test::AtlasTest) - namespace Magnum { namespace TextureTools { namespace Test { +class AtlasTest: public Corrade::TestSuite::Tester { + public: + explicit AtlasTest(); + + void create(); + void createEmpty(); + void createTooSmall(); +}; + AtlasTest::AtlasTest() { addTests(&AtlasTest::create, &AtlasTest::createEmpty, @@ -63,3 +69,5 @@ void AtlasTest::createTooSmall() { } }}} + +CORRADE_TEST_MAIN(Magnum::TextureTools::Test::AtlasTest) diff --git a/src/TextureTools/Test/AtlasTest.h b/src/TextureTools/Test/AtlasTest.h deleted file mode 100644 index 13c92aa27..000000000 --- a/src/TextureTools/Test/AtlasTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef Magnum_TextureTools_Test_AtlasTest_h -#define Magnum_TextureTools_Test_AtlasTest_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - 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 - -namespace Magnum { namespace TextureTools { namespace Test { - -class AtlasTest: public Corrade::TestSuite::Tester { - public: - explicit AtlasTest(); - - void create(); - void createEmpty(); - void createTooSmall(); -}; - -}}} - -#endif