2 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * This file is part of the UI Gadget
5 * Written by Jayoun Lee <airjany@samsung.com>, Jinwoo Nam <jwoo.nam@samsung.com>
7 * PROPRIETARY/CONFIDENTIAL
9 * This software is the confidential and proprietary information of
10 * SAMSUNG ELECTRONICS (Confidential Information).
11 * You shall not disclose such Confidential Information and shall
12 * use it only in accordance with the terms of the license agreement
13 * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
14 * representations or warranties about the suitability
15 * of the software, either express or implied, including but not
16 * limited to the implied warranties of merchantability, fitness for a particular purpose, or non-
17 * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as
18 * a result of using, modifying or distributing this software or its derivatives.
22 #include <ui-gadget.h>
23 #include <Elementary.h>
26 static void startup(void);
27 static void cleanup(void);
29 void (*tet_startup)(void) = startup;
30 void (*tet_cleanup)(void) = cleanup;
32 static void utc_ApplicationFW_ug_send_message_func_01(void);
33 static void utc_ApplicationFW_ug_send_message_func_02(void);
36 POSITIVE_TC_IDX = 0x01,
40 struct tet_testlist tet_testlist[] = {
41 { utc_ApplicationFW_ug_send_message_func_01, POSITIVE_TC_IDX },
42 { utc_ApplicationFW_ug_send_message_func_02, NEGATIVE_TC_IDX },
46 #define TESTUG "helloUG-efl"
48 static void startup(void)
53 static void cleanup(void)
61 win = elm_win_add(NULL, "UI gadget test", ELM_WIN_BASIC);
63 tet_infoline("Cannot create window");
67 if (UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE)) {
68 tet_infoline("ug_init() failed");
74 static Eina_Bool tst01(void *data)
78 struct ui_gadget *ug = data;
80 msg = bundle_create();
82 tet_infoline("bundle_create() failed");
83 tet_result(TET_UNINITIATED);
86 bundle_add(msg, "test", "case");
88 r = ug_send_message(ug, msg);
90 tet_infoline("ug_send_message() failed in positive test case");
102 * @brief Positive test case of ug_send_message()
104 static void utc_ApplicationFW_ug_send_message_func_01(void)
106 struct ui_gadget *ug;
109 tet_result(TET_UNINITIATED);
113 ug = ug_create(NULL, TESTUG, UG_MODE_FULLVIEW, NULL, NULL);
115 tet_infoline("ug_create() failed");
116 tet_result(TET_UNINITIATED);
119 ecore_idler_add(tst01, ug);
123 static Eina_Bool tst02(void *data)
127 struct ui_gadget *ug = data;
129 msg = bundle_create();
131 tet_infoline("bundle_create() failed");
132 tet_result(TET_UNINITIATED);
135 bundle_add(msg, "test", "case");
137 r = ug_send_message(NULL, NULL);
139 tet_infoline("ug_send_message() failed in negative test case");
140 tet_result(TET_FAIL);
144 r = ug_send_message(ug, NULL);
146 tet_infoline("ug_send_message() failed in negative test case");
147 tet_result(TET_FAIL);
151 r = ug_send_message(NULL, msg);
153 tet_infoline("ug_send_message() failed in negative test case");
154 tet_result(TET_FAIL);
158 tet_result(TET_PASS);
166 * @brief Negative test case of ug_init ug_send_message()
168 static void utc_ApplicationFW_ug_send_message_func_02(void)
170 struct ui_gadget *ug;
173 tet_result(TET_UNINITIATED);
177 ug = ug_create(NULL, TESTUG, UG_MODE_FULLVIEW, NULL, NULL);
179 tet_infoline("ug_create() failed");
180 tet_result(TET_UNINITIATED);
183 ecore_idler_add(tst02, ug);