]> git.localhorst.tv Git - blobs.git/blobdiff - tst/assert.hpp
little better seek ai
[blobs.git] / tst / assert.hpp
index 85e43246f67f339fdeb51bb878660e4156632c2c..5042180915195538e0f5d6d0dde6ccb9e3471cb3 100644 (file)
 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,