af13ac3983e6a29ab9b1480af2831ef838d39da3
[framework/uifw/elementary.git] / TC / elm_ts / nocontents / utc_UIFW_elm_nocontents_label_set_func.c
1 #include <tet_api.h>\r
2 #include <Elementary.h>\r
3 \r
4 // Definitions\r
5 // For checking the result of the positive test case.\r
6 #define TET_CHECK_PASS(x1, y...) \\r
7 { \\r
8         Evas_Object *err = y; \\r
9         if (err == (x1)) \\r
10                 { \\r
11                         tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
12                         tet_result(TET_FAIL); \\r
13                         return; \\r
14                 } \\r
15 }\r
16 \r
17 // For checking the result of the negative test case.\r
18 #define TET_CHECK_FAIL(x1, y...) \\r
19 { \\r
20         Evas_Object *err = y; \\r
21         if (err != (x1)) \\r
22                 { \\r
23                         tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
24                         tet_result(TET_FAIL); \\r
25                         return; \\r
26                 } \\r
27 }\r
28 \r
29 \r
30 Evas_Object *main_win;\r
31 \r
32 static void startup(void);\r
33 static void cleanup(void);\r
34 \r
35 void (*tet_startup)(void) = startup;\r
36 void (*tet_cleanup)(void) = cleanup;\r
37 \r
38 static void utc_UIFW_elm_nocontents_label_set_func_01(void);\r
39 static void utc_UIFW_elm_nocontents_label_set_func_02(void);\r
40 \r
41 enum {\r
42         POSITIVE_TC_nocont = 0x01,\r
43         NEGATIVE_TC_nocont,\r
44 };\r
45 \r
46 struct tet_testlist tet_testlist[] = {\r
47         { utc_UIFW_elm_nocontents_label_set_func_01, POSITIVE_TC_nocont },\r
48         { utc_UIFW_elm_nocontents_label_set_func_02, NEGATIVE_TC_nocont },\r
49 };\r
50 \r
51 static void startup(void)\r
52 {\r
53         tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");\r
54         elm_init(0, NULL);\r
55         main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);\r
56         evas_object_show(main_win);     \r
57 }\r
58 \r
59 static void cleanup(void)\r
60 {\r
61         if ( NULL != main_win ) {\r
62                 evas_object_del(main_win);\r
63                 main_win = NULL;\r
64         }\r
65         elm_shutdown();\r
66         tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");\r
67 }\r
68 \r
69 /**\r
70  * @brief Positive test case of elm_nocontents_label_set()\r
71  */\r
72 static void utc_UIFW_elm_nocontents_label_set_func_01(void)\r
73 {\r
74         Evas_Object *nocont = NULL;
75         const char *ch = "no cotents";
76         const char *char_nocont;\r
77         nocont = elm_nocontents_add(main_win);\r
78         evas_object_show(nocont);
79         elm_nocontents_label_set(nocont, ch);
80         char_nocont = elm_nocontents_label_get(nocont);\r
81         if (!char_nocont) {\r
82                 tet_infoline("elm_nocontents_label_set() failed in positive test case");\r
83                 tet_result(TET_FAIL);\r
84                 return;\r
85         }\r
86         tet_result(TET_PASS);\r
87 }\r
88 \r
89 /**\r
90  * @brief Negative test case of elm_nocontents_label_set()\r
91  */\r
92 static void utc_UIFW_elm_nocontents_label_set_func_02(void)\r
93 {\r
94         Evas_Object *nocont = NULL;
95         const char *ch = "no cotents";
96         const char *char_nocont = NULL;\r
97         nocont = elm_nocontents_add(main_win);\r
98         evas_object_show(nocont);
99         elm_nocontents_label_set(NULL, ch);
100         char_nocont = elm_nocontents_label_get(nocont);\r
101         if (char_nocont) {\r
102                 tet_infoline("elm_nocontents_label_set() failed in positive test case");\r
103                 tet_result(TET_FAIL);\r
104                 return;\r
105         }\r
106         tet_result(TET_PASS);\r
107 }\r