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_create_func_01(void);
33 static void utc_ApplicationFW_ug_create_func_02(void);
36 POSITIVE_TC_IDX = 0x01,
40 struct tet_testlist tet_testlist[] = {
41 { utc_ApplicationFW_ug_create_func_01, POSITIVE_TC_IDX },
42 { utc_ApplicationFW_ug_create_func_02, NEGATIVE_TC_IDX },
46 #define TESTUG "helloUG-efl"
47 #define TESTUG_ERR "helloUG-efl0-abacbadsf"
49 static void startup(void)
55 win = elm_win_add(NULL, "UI gadget test", ELM_WIN_BASIC);
57 err = "Cannot create window";
61 if (UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE)) {
62 err = "ug_init() failed";
69 tet_delete(POSITIVE_TC_IDX, err);
70 tet_delete(NEGATIVE_TC_IDX, err);
73 static void cleanup(void)
79 * @brief Positive test case of ug_create()
81 static void utc_ApplicationFW_ug_create_func_01(void)
85 struct ug_cbs cbs = {0, };
86 data = bundle_create();
87 bundle_add(data, "test", "case");
89 ug = ug_create(NULL, TESTUG, UG_MODE_FULLVIEW, data, &cbs);
91 tet_infoline("ug_create() failed in positive test case");
96 ug = ug_create(NULL, TESTUG, UG_MODE_FRAMEVIEW, data, &cbs);
98 tet_infoline("ug_create() failed in positive test case");
103 tet_result(TET_PASS);
107 * @brief Negative test case of ug_init ug_create()
109 static void utc_ApplicationFW_ug_create_func_02(void)
111 struct ui_gadget *ug;
113 struct ug_cbs cbs = {0, };
114 data = bundle_create();
115 bundle_add(data, "test", "case");
117 ug = ug_create(NULL, TESTUG_ERR, -1, data, &cbs);
119 tet_infoline("ug_create() failed in negative test case");
120 tet_result(TET_FAIL);
124 ug = ug_create(NULL, TESTUG_ERR, UG_MODE_INVALID, data, &cbs);
126 tet_infoline("ug_create() failed in negative test case");
127 tet_result(TET_FAIL);
131 ug = ug_create(NULL, TESTUG_ERR, UG_MODE_MAX, data, &cbs);
133 tet_infoline("ug_create() failed in negative test case");
134 tet_result(TET_FAIL);
138 tet_result(TET_PASS);