4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
27 static void startup(void);
28 static void cleanup(void);
30 void (*tet_startup)(void) = startup;
31 void (*tet_cleanup)(void) = cleanup;
33 static void utc_ApplicationFW_heynoti_poll_event_func_01(void);
34 static void utc_ApplicationFW_heynoti_poll_event_func_02(void);
37 POSITIVE_TC_IDX = 0x01,
41 struct tet_testlist tet_testlist[] = {
42 { utc_ApplicationFW_heynoti_poll_event_func_01, POSITIVE_TC_IDX },
43 { utc_ApplicationFW_heynoti_poll_event_func_02, NEGATIVE_TC_IDX },
49 void callback(void *data)
55 void * thread_event(void *data)
59 heynoti_publish("test_testnoti");
64 static void startup(void)
72 err = "Error init heynoti";
74 tet_delete(POSITIVE_TC_IDX, err);
75 tet_delete(NEGATIVE_TC_IDX, err);
78 r = heynoti_subscribe(fd, "test_testnoti", callback, NULL);
80 err = "Error init heynoti";
82 tet_delete(POSITIVE_TC_IDX, err);
83 tet_delete(NEGATIVE_TC_IDX, err);
87 static void cleanup(void)
90 heynoti_unsubscribe(fd, "test_testnoti", callback);
95 * @brief Positive test case of heynoti_poll_event()
97 static void utc_ApplicationFW_heynoti_poll_event_func_01(void)
102 pthread_create(&tid, NULL, thread_event, NULL);
104 r = heynoti_poll_event(fd);
107 tet_infoline("heynoti_poll_event() failed in positive test case");
108 tet_result(TET_FAIL);
111 tet_result(TET_PASS);
115 * @brief Negative test case of ug_init heynoti_poll_event()
117 static void utc_ApplicationFW_heynoti_poll_event_func_02(void)
121 r = heynoti_poll_event(-1);
124 tet_infoline("heynoti_poll_event() failed in negative test case");
125 tet_result(TET_FAIL);
128 tet_result(TET_PASS);