]> git.localhorst.tv Git - blobs.git/blobdiff - tst/assert.hpp
randomize creature properties a bit
[blobs.git] / tst / assert.hpp
index 85e43246f67f339fdeb51bb878660e4156632c2c..66a9704d13147703b5e43ae9a3af7db2cdc8355a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef BLOBS_TEST_ASSETS_HPP_
 #define BLOBS_TEST_ASSETS_HPP_
 
-#include "graphics/glm.hpp"
+#include "math/glm.hpp"
 
 #include <string>
 #include <limits>
 namespace blobs {
 namespace test {
 
+template<class T>
+void AssertEqual(
+       const std::string &msg,
+       const glm::tvec2<T> &expected,
+       const glm::tvec2<T> &actual,
+       T epsilon = std::numeric_limits<T>::epsilon()
+) {
+       CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
+               msg + " (X component)",
+               expected.x, actual.x, epsilon
+       );
+       CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
+               msg + " (Y component)",
+               expected.y, actual.y, epsilon
+       );
+}
+
 template<class T>
 void AssertEqual(
        const std::string &msg,