]> git.localhorst.tv Git - blank.git/blobdiff - tst/geometry/LocationTest.hpp
unified location handling
[blank.git] / tst / geometry / LocationTest.hpp
diff --git a/tst/geometry/LocationTest.hpp b/tst/geometry/LocationTest.hpp
new file mode 100644 (file)
index 0000000..d46be0b
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef BLANK_TEST_GEOMETRY_LOCATIONTEST_HPP_
+#define BLANK_TEST_GEOMETRY_LOCATIONTEST_HPP_
+
+#include "geometry/Location.hpp"
+
+#include <string>
+#include <glm/glm.hpp>
+#include <cppunit/extensions/HelperMacros.h>
+
+
+namespace blank {
+namespace test {
+
+class LocationTest
+: public CppUnit::TestFixture {
+
+CPPUNIT_TEST_SUITE(LocationTest);
+
+CPPUNIT_TEST(testSanitize);
+CPPUNIT_TEST(testAbsolute);
+CPPUNIT_TEST(testRelative);
+CPPUNIT_TEST(testDifference);
+
+CPPUNIT_TEST_SUITE_END();
+
+public:
+       void setUp();
+       void tearDown();
+
+       void testSanitize();
+       void testAbsolute();
+       void testRelative();
+       void testDifference();
+
+private:
+       static void AssertEqual(
+               const std::string &msg,
+               const glm::ivec3 &expected,
+               const glm::ivec3 &actual);
+       static void AssertEqual(
+               const std::string &msg,
+               const glm::vec3 &expected,
+               const glm::vec3 &actual);
+       static void AssertEqual(
+               const std::string &msg,
+               const RoughLocation &expected,
+               const RoughLocation &actual);
+       static void AssertEqual(
+               const std::string &msg,
+               const ExactLocation &expected,
+               const ExactLocation &actual);
+
+};
+
+}
+}
+
+#endif