Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_label_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailLabel
5  *
6  * Description: Test AtkObject interface
7  *
8  * Test input: accessible object representing EailLabel
9  *
10  * Expected test result: test should return 0 (success)
11  */
12
13 #include <Elementary.h>
14
15 #include "eail_test_utils.h"
16
17 INIT_TEST("EailLabel")
18
19 static void
20 _init_label(Evas_Object *win)
21 {
22    Evas_Object *bg, *label;
23
24    bg = elm_bg_add(win);
25    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26    elm_win_resize_object_add(win, bg);
27    evas_object_show(bg);
28
29    label = elm_label_add(win);
30    elm_object_text_set(label, "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
31                        "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
32                        "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris"
33                        "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
34                        "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla"
35                        "pariatur. Excepteur sint occaecat cupidatat non proident, sunt"
36                        "in culpa qui officia deserunt mollit anim id est laborum.");
37    elm_label_line_wrap_set(label, ELM_WRAP_WORD);
38    evas_object_resize(label, 200, 170);
39    evas_object_move(label, 0, 0);
40    evas_object_show(label);
41
42    evas_object_resize(win, 200, 320);
43 }
44
45 static void
46 _do_test(AtkObject *obj)
47 {
48    AtkStateSet *state_set = atk_object_ref_state_set(obj);
49
50    g_assert(ATK_IS_OBJECT(obj));
51    atk_object_set_description(obj, "test");
52    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
53
54    atk_object_set_name(obj, "test name");
55    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
56
57    g_assert(atk_object_get_role(obj) == ATK_ROLE_LABEL);
58
59    g_assert(atk_state_set_contains_state(state_set, ATK_STATE_MULTI_LINE));
60    g_object_unref(state_set);
61
62    eailu_test_code_called = 1;
63 }
64
65 EAPI_MAIN int
66 elm_main(int argc, char **argv)
67 {
68    Evas_Object *win;
69
70    win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
71    g_assert(win);
72    _init_label(win);
73
74    evas_object_show(win);
75    elm_run();
76    elm_shutdown();
77
78    return 0;
79 }
80 ELM_MAIN()
81
82