]> git.localhorst.tv Git - blobs.git/blob - tst/world/PlanetTest.cpp
spherical planets
[blobs.git] / tst / world / PlanetTest.cpp
1 #include "PlanetTest.hpp"
2
3 #include "../assert.hpp"
4
5 #include "world/Planet.hpp"
6
7 #include <limits>
8
9 CPPUNIT_TEST_SUITE_REGISTRATION(blobs::world::test::PlanetTest);
10
11 using blobs::test::AssertEqual;
12
13
14 namespace blobs {
15 namespace world {
16 namespace test {
17
18 void PlanetTest::setUp() {
19 }
20
21 void PlanetTest::tearDown() {
22 }
23
24
25 void PlanetTest::testPositionConversion() {
26         Planet p(5);
27
28         CPPUNIT_ASSERT_EQUAL_MESSAGE(
29                 "wrong sidelength of planet",
30                 5, p.SideLength());
31         CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
32                 "wrong radius of planet",
33                 2.5, p.Radius(), std::numeric_limits<double>::epsilon());
34 }
35
36 }
37 }
38 }