diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-07-10 18:19:38 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-07-10 18:50:32 -0400 |
commit | 67028430bc246cd5a0dd23d796efb0a72425baed (patch) | |
tree | 3c23f3985a00d732a7b1d226ceb09769bd0dafc9 | |
parent | 5d8694fd3085ce6d870d49f96f9cdd07de151f8e (diff) | |
download | pango-67028430bc246cd5a0dd23d796efb0a72425baed.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.c | 7 |
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); |