tests: Don't use exact floating point comparisons.
The tests asserting that cd_icc_get_version are exactly equal to 3.4 or
2.09 fail on (at least) i386, armel, and s390x because floating point is
hateful.
Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
Christopher James Halse Rogers authored 3 years ago
Richard Hughes committed 3 years ago
1493 | 1493 | /* check profile properties */ |
1494 | 1494 | g_assert_cmpint (cd_icc_get_size (icc), ==, 25244); |
1495 | 1495 | g_assert_cmpstr (cd_icc_get_checksum (icc), ==, "9ace8cce8baac8d492a93a2a232d7702"); |
1496 | g_assert_cmpfloat (cd_icc_get_version (icc), ==, 3.4); | |
1496 | g_assert_cmpfloat_with_epsilon (cd_icc_get_version (icc), 3.4, 0.01); | |
1497 | 1497 | g_assert (g_str_has_suffix (cd_icc_get_filename (icc), "ibm-t61.icc")); |
1498 | 1498 | g_assert_cmpint (cd_icc_get_kind (icc), ==, CD_PROFILE_KIND_DISPLAY_DEVICE); |
1499 | 1499 | g_assert_cmpint (cd_icc_get_colorspace (icc), ==, CD_COLORSPACE_RGB); |
1726 | 1726 | g_object_unref (file); |
1727 | 1727 | |
1728 | 1728 | /* verify changed values */ |
1729 | g_assert_cmpfloat (cd_icc_get_version (icc), ==, 2.09); | |
1729 | g_assert_cmpfloat_with_epsilon (cd_icc_get_version (icc), 2.09, 0.001); | |
1730 | 1730 | g_assert_cmpint (cd_icc_get_kind (icc), ==, CD_PROFILE_KIND_OUTPUT_DEVICE); |
1731 | 1731 | g_assert_cmpint (cd_icc_get_colorspace (icc), ==, CD_COLORSPACE_XYZ); |
1732 | 1732 | g_assert_cmpstr (cd_icc_get_metadata_item (icc, "SelfTest"), ==, "true"); |