aports/community/gexiv2/float-compare-test.patch

37 lines
1.4 KiB
Diff

diff --git a/test/gexiv2-regression.c b/test/gexiv2-regression.c
index aa1b274..64924d5 100644
--- a/test/gexiv2-regression.c
+++ b/test/gexiv2-regression.c
@@ -158,12 +158,12 @@ static void test_bgo_775249(void)
g_assert_true(result);
g_assert_true(gexiv2_metadata_get_gps_info(meta, &lon, &lat, &alt));
- g_assert_cmpfloat(lon, ==, -1.508425);
+ g_assert_cmpfloat_with_epsilon(lon, -1.508425, 0.0001);
/* Just check if it fits in there; The main issue is that it's not 0 */
g_assert_cmpfloat(lat, >=, 48.631806);
g_assert_cmpfloat(lat, <=, 48.631807);
- g_assert_cmpfloat(alt, ==, -0.926000);
+ g_assert_cmpfloat_with_epsilon(alt, -0.926000, 0.0001);
g_clear_object(&meta);
}
diff --git a/test/python/gexiv2.py b/test/python/gexiv2.py
index fa80f9f..4f2506a 100644
--- a/test/python/gexiv2.py
+++ b/test/python/gexiv2.py
@@ -48,9 +48,9 @@ class TestGexiv2(unittest.TestCase):
md.open_path(self.get_sample_path(sample))
(lo, la, alt) = md.get_gps_info()
- self.assertEqual(lo, -1.508425)
- self.assertEqual(la, 48.631806166666664)
- self.assertEqual(alt, -0.926000)
+ self.assertAlmostEqual(lo, -1.508425)
+ self.assertAlmostEqual(la, 48.631806166666664)
+ self.assertAlmostEqual(alt, -0.926000)
def test_xmp_packet_formatting(self):
sample = 'CaorVN.jpeg'