mirror of https://github.com/mosra/magnum.git
9 changed files with 169 additions and 1 deletions
@ -0,0 +1,34 @@ |
|||||||
|
/*
|
||||||
|
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz> |
||||||
|
|
||||||
|
This file is part of Magnum. |
||||||
|
|
||||||
|
Magnum is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU Lesser General Public License version 3 |
||||||
|
only, as published by the Free Software Foundation. |
||||||
|
|
||||||
|
Magnum is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU Lesser General Public License version 3 for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "ObjectData2D.h" |
||||||
|
|
||||||
|
namespace Magnum { namespace Trade { |
||||||
|
|
||||||
|
#ifndef DOXYGEN_GENERATING_OUTPUT |
||||||
|
Debug operator<<(Debug debug, ObjectData2D::InstanceType value) { |
||||||
|
switch(value) { |
||||||
|
#define _c(value) case ObjectData2D::InstanceType::value: return debug << "Trade::ObjectData2D::InstanceType::" #value; |
||||||
|
_c(Camera) |
||||||
|
_c(Mesh) |
||||||
|
_c(Empty) |
||||||
|
#undef _c |
||||||
|
} |
||||||
|
|
||||||
|
return debug << "ObjectData2D::InstanceType::(invalid)"; |
||||||
|
} |
||||||
|
#endif |
||||||
|
|
||||||
|
}} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
/*
|
||||||
|
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz> |
||||||
|
|
||||||
|
This file is part of Magnum. |
||||||
|
|
||||||
|
Magnum is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU Lesser General Public License version 3 |
||||||
|
only, as published by the Free Software Foundation. |
||||||
|
|
||||||
|
Magnum is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU Lesser General Public License version 3 for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "ObjectData3D.h" |
||||||
|
|
||||||
|
namespace Magnum { namespace Trade { |
||||||
|
|
||||||
|
#ifndef DOXYGEN_GENERATING_OUTPUT |
||||||
|
Debug operator<<(Debug debug, ObjectData3D::InstanceType value) { |
||||||
|
switch(value) { |
||||||
|
#define _c(value) case ObjectData3D::InstanceType::value: return debug << "Trade::ObjectData3D::InstanceType::" #value; |
||||||
|
_c(Camera) |
||||||
|
_c(Light) |
||||||
|
_c(Mesh) |
||||||
|
_c(Empty) |
||||||
|
#undef _c |
||||||
|
} |
||||||
|
|
||||||
|
return debug << "ObjectData3D::InstanceType::(invalid)"; |
||||||
|
} |
||||||
|
#endif |
||||||
|
|
||||||
|
}} |
||||||
@ -0,0 +1,2 @@ |
|||||||
|
corrade_add_test(TradeObjectData2DTest ObjectData2DTest.cpp LIBRARIES Magnum) |
||||||
|
corrade_add_test(TradeObjectData3DTest ObjectData3DTest.cpp LIBRARIES Magnum) |
||||||
@ -0,0 +1,42 @@ |
|||||||
|
/*
|
||||||
|
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz> |
||||||
|
|
||||||
|
This file is part of Magnum. |
||||||
|
|
||||||
|
Magnum is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU Lesser General Public License version 3 |
||||||
|
only, as published by the Free Software Foundation. |
||||||
|
|
||||||
|
Magnum is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU Lesser General Public License version 3 for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include <sstream> |
||||||
|
#include <TestSuite/Tester.h> |
||||||
|
|
||||||
|
#include "Trade/ObjectData2D.h" |
||||||
|
|
||||||
|
namespace Magnum { namespace Trade { namespace Test { |
||||||
|
|
||||||
|
class ObjectData2DTest: public Corrade::TestSuite::Tester { |
||||||
|
public: |
||||||
|
explicit ObjectData2DTest(); |
||||||
|
|
||||||
|
void debug(); |
||||||
|
}; |
||||||
|
|
||||||
|
ObjectData2DTest::ObjectData2DTest() { |
||||||
|
addTests(&ObjectData2DTest::debug); |
||||||
|
} |
||||||
|
|
||||||
|
void ObjectData2DTest::debug() { |
||||||
|
std::ostringstream o; |
||||||
|
Debug(&o) << ObjectData2D::InstanceType::Empty; |
||||||
|
CORRADE_COMPARE(o.str(), "Trade::ObjectData2D::InstanceType::Empty\n"); |
||||||
|
} |
||||||
|
|
||||||
|
}}} |
||||||
|
|
||||||
|
CORRADE_TEST_MAIN(Magnum::Trade::Test::ObjectData2DTest) |
||||||
@ -0,0 +1,42 @@ |
|||||||
|
/*
|
||||||
|
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz> |
||||||
|
|
||||||
|
This file is part of Magnum. |
||||||
|
|
||||||
|
Magnum is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU Lesser General Public License version 3 |
||||||
|
only, as published by the Free Software Foundation. |
||||||
|
|
||||||
|
Magnum is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU Lesser General Public License version 3 for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include <sstream> |
||||||
|
#include <TestSuite/Tester.h> |
||||||
|
|
||||||
|
#include "Trade/ObjectData3D.h" |
||||||
|
|
||||||
|
namespace Magnum { namespace Trade { namespace Test { |
||||||
|
|
||||||
|
class ObjectData3DTest: public Corrade::TestSuite::Tester { |
||||||
|
public: |
||||||
|
explicit ObjectData3DTest(); |
||||||
|
|
||||||
|
void debug(); |
||||||
|
}; |
||||||
|
|
||||||
|
ObjectData3DTest::ObjectData3DTest() { |
||||||
|
addTests(&ObjectData3DTest::debug); |
||||||
|
} |
||||||
|
|
||||||
|
void ObjectData3DTest::debug() { |
||||||
|
std::ostringstream o; |
||||||
|
Debug(&o) << ObjectData3D::InstanceType::Light; |
||||||
|
CORRADE_COMPARE(o.str(), "Trade::ObjectData3D::InstanceType::Light\n"); |
||||||
|
} |
||||||
|
|
||||||
|
}}} |
||||||
|
|
||||||
|
CORRADE_TEST_MAIN(Magnum::Trade::Test::ObjectData3DTest) |
||||||
Loading…
Reference in new issue