summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-11-16 08:37:16 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-11-16 08:37:16 +0100
commitf9d75458f626ca51f1b10076db8ea1df3e411c6a (patch)
tree52f2dd8ef81f87ef7f26d9df879e3d2bdd560bd0 /tests
parent5388e4c0e5810e2634e3d7054298f9bfdf645d85 (diff)
Use more relaxed float comparison
See #98.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/test-buffer.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4eb6e84..d750f37 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -16,7 +16,7 @@ endif ()
add_executable(${SUITE_BIN} ${TEST_SRCS})
-target_link_libraries(${SUITE_BIN} ufo ${UFOCORE_DEPS})
+target_link_libraries(${SUITE_BIN} ufo m ${UFOCORE_DEPS})
add_test(${SUITE_BIN} ${SUITE_BIN})
diff --git a/tests/test-buffer.c b/tests/test-buffer.c
index 3f6bd8a..9821211 100644
--- a/tests/test-buffer.c
+++ b/tests/test-buffer.c
@@ -18,6 +18,7 @@
*/
#include <string.h>
+#include <math.h>
#include <ufo/ufo.h>
#include "test-suite.h"
@@ -136,7 +137,7 @@ test_insert_metadata (Fixture *fixture,
other = ufo_buffer_get_metadata (fixture->buffer, "foo");
g_assert (other != NULL);
- g_assert (g_value_get_float (other) == 3.14f);
+ g_assert (fabs (g_value_get_float (other) - 3.14f) < 0.0001f);
}
static void