From 971aeff5be714c2fce478dc970605f57a6dcb6fc Mon Sep 17 00:00:00 2001 From: Felipe Erias Morandeira Date: Fri, 19 Jul 2013 16:02:15 +0100 Subject: Tests for "label-position" in EosActionButton [endlessm/eos-sdk#108] --- test/test-action-button.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test/test-action-button.c') diff --git a/test/test-action-button.c b/test/test-action-button.c index ba30be5..7e4ad15 100644 --- a/test/test-action-button.c +++ b/test/test-action-button.c @@ -156,6 +156,34 @@ test_ab_prop_icon_name (ActionButtonFixture *fixture, g_free (icon_name); } +static void +test_ab_get_set_label_position (ActionButtonFixture *fixture, + gconstpointer unused) +{ + GtkPositionType label_pos; + + label_pos = eos_action_button_get_label_position (fixture->button); + g_assert (label_pos == GTK_POS_BOTTOM); + + eos_action_button_set_label_position (fixture->button, GTK_POS_TOP); + label_pos = eos_action_button_get_label_position (fixture->button); + g_assert (label_pos == GTK_POS_TOP); +} + +static void +test_ab_prop_label_position (ActionButtonFixture *fixture, + gconstpointer unused) +{ + GtkPositionType label_pos; + + g_object_get (fixture->button, "label-position", &label_pos, NULL); + g_assert (label_pos == GTK_POS_BOTTOM); + + g_object_set (fixture->button, "label-position", GTK_POS_TOP, NULL); + g_object_get (fixture->button, "label-position", &label_pos, NULL); + g_assert (label_pos == GTK_POS_TOP); +} + static void test_ab_label_agrees (ActionButtonFixture *fixture, gconstpointer unused) @@ -189,5 +217,9 @@ add_action_button_tests (void) test_ab_get_set_icon_name); ADD_ACTION_BUTTON_TEST ("/action-button/prop-icon-name", test_ab_prop_icon_name); + ADD_ACTION_BUTTON_TEST ("/action-button/get-set-label-position", + test_ab_get_set_label_position); + ADD_ACTION_BUTTON_TEST ("/action-button/prop-label-position", + test_ab_prop_label_position); ADD_ACTION_BUTTON_TEST ("/action-button/label-agrees", test_ab_label_agrees); } -- cgit v1.2.3