summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-10 18:19:38 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-21 08:19:58 -0400
commit26fa82a51cd6d123f3af1cb9b7e3514549eca922 (patch)
treea9a10d1a3e85da0c2a8788d3e0df811cf96aea63
parentcd4dde8a3dee8199c545d7f6a5ca9808d9634e7d (diff)
downloadpango-26fa82a51cd6d123f3af1cb9b7e3514549eca922.tar.gz
tests: Fix an assertion
We were rounding things differently, giving us off-by-one errors on MacOs.
-rw-r--r--tests/test-layout.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 502bc98a..1e531031 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -461,17 +461,18 @@ test_file (const char *filename, GString *string)
/* Some checks on extents - we have to be careful here, since we
* don't want to depend on font metrics.
*/
+ pango_layout_get_size (layout, &width, &height);
pango_layout_get_extents (layout, &ink_rect, &logical_rect);
+ g_assert_cmpint (width, ==, logical_rect.width);
+ g_assert_cmpint (height, ==, logical_rect.height);
+
pango_extents_to_pixels (&ink_rect, NULL);
pango_extents_to_pixels (&logical_rect, NULL);
pango_layout_get_pixel_extents (layout, &ink_rect1, &logical_rect1);
- pango_layout_get_size (layout, &width, &height);
pango_layout_get_pixel_size (layout, &width1, &height1);
assert_rectangle_equal (&ink_rect, &ink_rect1);
assert_rectangle_equal (&logical_rect, &logical_rect1);
- g_assert_cmpint (PANGO_PIXELS (width), ==, logical_rect.width);
- g_assert_cmpint (PANGO_PIXELS (height), ==, logical_rect.height);
g_assert_cmpint (width1, ==, logical_rect1.width);
g_assert_cmpint (height1, ==, logical_rect1.height);