rect: Add test for rect_round
@@ -185,6 +185,20 @@ GRAPHENE_TEST_UNIT_BEGIN (rect_inset)
}
GRAPHENE_TEST_UNIT_END
+GRAPHENE_TEST_UNIT_BEGIN (rect_round)
+{
+ graphene_rect_t r = GRAPHENE_RECT_INIT (0.5f, 1.9f, 9.3f, 8.7f);
+ graphene_rect_t e = GRAPHENE_RECT_INIT (0.0f, 1.0f, 10.0f, 9.0f);
+ graphene_rect_t rounded;
+
+ graphene_rect_round (&r, &rounded);
+ g_assert_cmpfloat (rounded.size.width * rounded.size.height,
+ >=,
+ r.size.width * r.size.height);
+ g_assert_true (graphene_rect_equal (&rounded, &e));
+}
+GRAPHENE_TEST_UNIT_END
+
GRAPHENE_TEST_UNIT_BEGIN (rect_round_to_pixel)
{
graphene_rect_t r = GRAPHENE_RECT_INIT (0.5f, 1.9f, 9.3f, 8.7f);
@@ -301,6 +315,7 @@ GRAPHENE_TEST_SUITE (
GRAPHENE_TEST_UNIT ("/rect/union", rect_union)
GRAPHENE_TEST_UNIT ("/rect/offset", rect_offset)
GRAPHENE_TEST_UNIT ("/rect/inset", rect_inset)
+ GRAPHENE_TEST_UNIT ("/rect/round", rect_round)
GRAPHENE_TEST_UNIT ("/rect/round-to-pixel", rect_round_to_pixel)
GRAPHENE_TEST_UNIT ("/rect/expand", rect_expand)
GRAPHENE_TEST_UNIT ("/rect/interpolate", rect_interpolate)
