2 * Tested interface: AtkObject
4 * Tested AtkObject: EailSeparator
6 * Description: Test whether accessible object is successfully registered
7 * in GObject type system and is visible in AtkObject tree.
9 * Test input: accessible object representing EailSeparator
11 * Expected test result: test should return 0 (success)
14 #include <Elementary.h>
17 #include "eail_test_utils.h"
19 INIT_TEST("EailSeparator")
22 _init_separator(Evas_Object *win)
24 Evas_Object *bg, *bxh, *bxv, *spv, *sph, *bt;
27 elm_win_resize_object_add(win, bg);
28 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31 bxh = elm_box_add(win);
32 evas_object_size_hint_weight_set(bxh, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33 elm_box_horizontal_set(bxh, EINA_TRUE);
34 elm_win_resize_object_add(win, bxh);
35 evas_object_show(bxh);
37 bxv = elm_box_add(win);
38 evas_object_size_hint_weight_set(bxv, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
39 elm_box_pack_end(bxh, bxv);
40 evas_object_show(bxv);
42 // horizontal separator
43 bt = elm_button_add(win);
44 elm_object_text_set(bt, "Top button");
45 elm_box_pack_end(bxv, bt);
48 sph = elm_separator_add(win);
49 elm_separator_horizontal_set(sph, EINA_TRUE);
50 elm_box_pack_end(bxv, sph);
51 evas_object_show(sph);
53 bt = elm_button_add(win);
54 elm_object_text_set(bt, "Bottom button");
55 elm_box_pack_end(bxv, bt);
59 bt = elm_button_add(win);
60 elm_object_text_set(bt, "Left button");
61 elm_box_pack_end(bxh, bt);
64 spv = elm_separator_add(win);
65 elm_box_pack_end(bxh, spv);
66 evas_object_show(spv);
68 bt = elm_button_add(win);
69 elm_object_text_set(bt, "Right button");
70 elm_box_pack_end(bxh, bt);
75 _do_test(AtkObject *obj)
77 AtkStateSet *state_set = atk_object_ref_state_set(obj);
78 static int test_count, test_vertical_count, test_horizontal_count;
82 g_assert(atk_object_get_role(obj) == ATK_ROLE_SEPARATOR);
83 g_assert(!atk_state_set_is_empty(state_set));
84 atk_object_set_description(obj, "test");
85 g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
87 atk_object_set_name(obj, "test name");
88 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
90 if (atk_state_set_contains_state(state_set, ATK_STATE_VERTICAL))
92 test_vertical_count++;
93 _printf("atk_object_ref_state_set: vertical\n");
96 if (atk_state_set_contains_state(state_set, ATK_STATE_HORIZONTAL))
98 test_horizontal_count++;
99 _printf("atk_object_ref_state_set: horizontal\n");
102 g_assert((test_vertical_count + test_horizontal_count) == test_count);
105 g_assert(1 == test_vertical_count && 1 == test_horizontal_count);
107 eailu_test_code_called = 1;
111 elm_main(int argc, char **argv)
115 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
116 _init_separator(win);
118 evas_object_show(win);