2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief test suite for Input Control API
23 #include "ico_syc_common.h"
24 #include "ico_syc_inputctl.h"
26 #include "tst_common.h"
28 /* ----------------------------------------------- */
30 /* ----------------------------------------------- */
33 /* ----------------------------------------------- */
34 /* Define of static function */
35 /* ----------------------------------------------- */
36 static void tst_add_input(const char *appid, const char *device,
37 int input, int fix, int keycode);
38 static void tst_delete_input(const char *appid, const char *device,
40 static void tst_send_input(const char *appid, int surface, int ev_type,
41 int deviceno, int ev_time, int ev_code, int ev_value);
42 static Eina_Bool ico_syc_inputctl_test(void *data);
44 /* ----------------------------------------------- */
46 /* ----------------------------------------------- */
49 tst_add_input(const char *appid, const char *device,
50 int input, int fix, int keycode)
53 char *func = "ico_syc_add_input";
55 ret = ico_syc_add_input(appid, device, input, fix, keycode);
57 print_ng("%s (ret: %d)", func, ret);
65 /* test delete input */
67 tst_delete_input(const char *appid, const char *device, int input)
70 char *func = "ico_syc_delete_input";
72 ret = ico_syc_delete_input(appid, device, input);
74 print_ng("%s (ret: %d)", func, ret);
84 tst_send_input(const char *appid, int surface, int ev_type,
85 int deviceno, int ev_time, int ev_code, int ev_value)
87 #if 0 /* SystemController 0.9.21(with GENIVI ivi-shell) not support send_input */
89 char *func = "ico_syc_send_input";
91 ret = ico_syc_send_input(appid, surface, ev_type, deviceno,
92 ev_time, ev_code, ev_value);
94 print_ng("%s (ret: %d)", func, ret);
104 ico_syc_inputctl_test(void *data)
106 const char *appid = "org.test.app.testapp";
107 const char *device = "input.dev";
109 int fix = ICO_SYC_INPUT_ALLOC_FIX;
112 int ev_type = ICO_SYC_INPUT_TYPE_POINTER;
119 printf("##### ico_syc_inputctl API Test Start #####\n");
121 tst_add_input(appid, device, input, fix, keycode);
123 tst_delete_input(appid, device, input);
125 tst_send_input(appid, surface, ev_type, deviceno, ev_time, ev_code, ev_value);
127 printf("##### ico_syc_inputctl API Test End #####\n");
130 return ECORE_CALLBACK_CANCEL;
132 /* ------------------------ */
133 /* quit test callback */
134 /* ------------------------ */
136 quit_test(void *data)
138 ico_syc_disconnect();
139 ecore_main_loop_quit();
141 return ECORE_CALLBACK_CANCEL;
144 /* ----------------------------------------------- */
146 /* ----------------------------------------------- */
149 main(int argc, char **argv)
153 ico_syc_connect(NULL, NULL);
155 ecore_timer_add(1, ico_syc_inputctl_test, NULL);
156 ecore_timer_add(5, quit_test, NULL);
158 ecore_main_loop_begin();
163 /* vim: set expandtab ts=4 sw=4: */