summaryrefslogtreecommitdiff
path: root/tests/libtracker-sparql
diff options
context:
space:
mode:
authorFabián Heredia Montiel <fabianhjr@protonmail.com>2021-10-15 15:50:58 -0500
committerFabián Heredia Montiel <fabianhjr@protonmail.com>2021-10-15 16:10:29 -0500
commitaf707181a2c492a794daec7ce3f3062d67ffd9dc (patch)
treedcba37d8a046687aafe66107b339b71fff3b0ed8 /tests/libtracker-sparql
parent14bad8081141ca58237ea3894ed3bb3a5ce31de9 (diff)
downloadtracker-af707181a2c492a794daec7ce3f3062d67ffd9dc.tar.gz
[test] Refactor double comparison
Fixes https://gitlab.gnome.org/GNOME/tracker/-/issues/332 There were some issues downstreams were the equality comparison failed on some platforms like i686
Diffstat (limited to 'tests/libtracker-sparql')
-rw-r--r--tests/libtracker-sparql/tracker-resource-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/libtracker-sparql/tracker-resource-test.c b/tests/libtracker-sparql/tracker-resource-test.c
index eb22fa927..dfd7ab188 100644
--- a/tests/libtracker-sparql/tracker-resource-test.c
+++ b/tests/libtracker-sparql/tracker-resource-test.c
@@ -58,7 +58,7 @@ test_resource_get_set_simple (void)
tracker_resource_set_uri (resource, "http://example.com/5", "http://example.com/");
tracker_resource_set_datetime (resource, "http://example.com/6", date_time);
- g_assert_true (tracker_resource_get_first_double (resource, "http://example.com/1") == 0.6);
+ g_assert_cmpfloat_with_epsilon (tracker_resource_get_first_double (resource, "http://example.com/1"), 0.6, DBL_EPSILON);
g_assert_cmpint (tracker_resource_get_first_int (resource, "http://example.com/2"), ==, 60);
g_assert_true (tracker_resource_get_first_int64 (resource, "http://example.com/3") == 123456789);
g_assert_cmpstr (tracker_resource_get_first_string (resource, "http://example.com/4"), ==, "Hello");