diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2020-03-31 12:53:10 -0400 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-04-03 17:13:44 +0200 |
commit | 8aaff3ba0771e9fa17abb3325b44eb4940361edd (patch) | |
tree | 743c6cb92be634547b749f21f19bff8af36f759c | |
parent | 39b7069a0ba7dc2d3df2766c83a609ed8299cda5 (diff) | |
download | efl-8aaff3ba0771e9fa17abb3325b44eb4940361edd.tar.gz |
tests/elm: add helper macros for asserting size and position of objects
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11629
-rw-r--r-- | src/tests/elementary/suite_helpers.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index b2a394b981..cf7b1e7490 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -45,4 +45,22 @@ void wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down); void event_callback_single_call_int_data(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); void event_callback_that_quits_the_main_loop_when_called(); void event_callback_that_increments_an_int_when_called(void *data, Evas_Object *obj, void *event_info); + + + +#define assert_object_size_eq(obj, width, height) \ +do \ +{ \ + Eina_Size2D _sz = efl_gfx_entity_size_get((obj)); \ + ck_assert_int_eq(_sz.w, (width)); \ + ck_assert_int_eq(_sz.h, (height)); \ +} while (0) + +#define assert_object_pos_eq(obj, _x, _y) \ +do \ +{ \ + Eina_Position2D _pos = efl_gfx_entity_position_get((obj)); \ + ck_assert_int_eq(_pos.x, (_x)); \ + ck_assert_int_eq(_pos.y, (_y)); \ +} while (0) #endif |