2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
24 static void startup(void);
25 static void cleanup(void);
28 void (*tet_startup)(void) = startup;
29 void (*tet_cleanup)(void) = cleanup;
31 static void utc_app_control_create_positive(void);
32 static void utc_app_control_create_negative(void);
34 static void utc_app_control_destroy_positive(void);
35 static void utc_app_control_destroy_negative(void);
37 static void utc_app_control_set_operation_positive1(void);
38 static void utc_app_control_set_operation_positive2(void);
39 static void utc_app_control_set_operation_negative(void);
41 static void utc_app_control_get_operation_positive(void);
42 static void utc_app_control_get_operation_negative1(void);
43 static void utc_app_control_get_operation_negative2(void);
44 static void utc_app_control_get_operation_negative3(void);
46 static void utc_app_control_set_uri_positive1(void);
47 static void utc_app_control_set_uri_positive2(void);
48 static void utc_app_control_set_uri_negative(void);
50 static void utc_app_control_get_uri_positive(void);
51 static void utc_app_control_get_uri_negative1(void);
52 static void utc_app_control_get_uri_negative2(void);
53 static void utc_app_control_get_uri_negative3(void);
55 static void utc_app_control_set_mime_positive1(void);
56 static void utc_app_control_set_mime_positive2(void);
57 static void utc_app_control_set_mime_negative(void);
59 static void utc_app_control_get_mime_positive(void);
60 static void utc_app_control_get_mime_negative1(void);
61 static void utc_app_control_get_mime_negative2(void);
62 static void utc_app_control_get_mime_negative3(void);
64 static void utc_app_control_set_package_positive(void);
65 static void utc_app_control_set_package_negative1(void);
66 static void utc_app_control_set_package_negative2(void);
68 static void utc_app_control_get_package_positive(void);
69 static void utc_app_control_get_package_negative1(void);
70 static void utc_app_control_get_package_negative2(void);
71 static void utc_app_control_get_package_negative3(void);
73 static void utc_app_control_set_app_id_positive(void);
74 static void utc_app_control_set_app_id_negative1(void);
75 static void utc_app_control_set_app_id_negative2(void);
77 static void utc_app_control_get_app_id_positive(void);
78 static void utc_app_control_get_app_id_negative1(void);
79 static void utc_app_control_get_app_id_negative2(void);
80 static void utc_app_control_get_app_id_negative3(void);
82 static void utc_app_control_set_category_positive(void);
83 static void utc_app_control_set_category_negative1(void);
84 static void utc_app_control_set_category_negative2(void);
86 static void utc_app_control_get_category_positive(void);
87 static void utc_app_control_get_category_negative1(void);
88 static void utc_app_control_get_category_negative2(void);
89 static void utc_app_control_get_category_negative3(void);
91 static void utc_app_control_set_window_positive(void);
92 static void utc_app_control_set_window_negative1(void);
93 static void utc_app_control_set_window_negative2(void);
95 static void utc_app_control_get_window_positive(void);
96 static void utc_app_control_get_window_negative1(void);
97 static void utc_app_control_get_window_negative2(void);
98 static void utc_app_control_get_window_negative3(void);
100 static void utc_app_control_add_extra_data_positive(void);
101 static void utc_app_control_add_extra_data_negative1(void);
102 static void utc_app_control_add_extra_data_negative2(void);
104 static void utc_app_control_remove_extra_data_positive(void);
105 static void utc_app_control_remove_extra_data_negative1(void);
106 static void utc_app_control_remove_extra_data_negative2(void);
107 static void utc_app_control_remove_extra_data_negative3(void);
109 static void utc_app_control_get_extra_data_positive(void);
110 static void utc_app_control_get_extra_data_negative1(void);
111 static void utc_app_control_get_extra_data_negative2(void);
112 static void utc_app_control_get_extra_data_negative3(void);
113 static void utc_app_control_get_extra_data_negative4(void);
115 static void utc_app_control_foreach_extra_data_positive(void);
116 static void utc_app_control_foreach_extra_data_negative1(void);
117 static void utc_app_control_foreach_extra_data_negative2(void);
119 static void utc_app_control_clone_positive(void);
120 static void utc_app_control_clone_negative1(void);
121 static void utc_app_control_clone_negative2(void);
123 static void utc_app_control_send_launch_request_positive1(void);
124 static void utc_app_control_send_launch_request_positive2(void);
125 static void utc_app_control_send_launch_request_positive3(void);
126 static void utc_app_control_send_launch_request_negative1(void);
127 static void utc_app_control_send_launch_request_negative2(void);
129 static void utc_app_control_reply_to_launch_request_negative1(void);
130 static void utc_app_control_reply_to_launch_request_negative2(void);
132 static void utc_app_control_foreach_app_matched_positive(void);
133 static void utc_app_control_foreach_app_matched_negative1(void);
134 static void utc_app_control_foreach_app_matched_negative2(void);
136 static void utc_app_control_add_extra_data_array_positive(void);
137 static void utc_app_control_add_extra_data_array_negative1(void);
138 static void utc_app_control_add_extra_data_array_negative2(void);
139 static void utc_app_control_add_extra_data_array_negative3(void);
141 static void utc_app_control_get_extra_data_array_positive(void);
142 static void utc_app_control_get_extra_data_array_negative1(void);
143 static void utc_app_control_get_extra_data_array_negative2(void);
144 static void utc_app_control_get_extra_data_array_negative3(void);
145 static void utc_app_control_get_extra_data_array_negative4(void);
146 static void utc_app_control_get_extra_data_array_negative5(void);
148 static void utc_app_control_is_extra_data_array_positive(void);
149 static void utc_app_control_is_extra_data_array_negative1(void);
150 static void utc_app_control_is_extra_data_array_negative2(void);
151 static void utc_app_control_is_extra_data_array_negative3(void);
152 static void utc_app_control_is_extra_data_array_negative4(void);
155 static void utc_app_control_is_reply_requested_positive1(void);
156 static void utc_app_control_is_reply_requested_negative1(void);
157 static void utc_app_control_is_reply_requested_negative2(void);
158 static void utc_app_control_is_reply_requested_negative3(void);
160 static void utc_app_control_get_caller_positive1(void);
161 static void utc_app_control_get_caller_negative1(void);
162 static void utc_app_control_get_caller_negative2(void);
163 static void utc_app_control_get_caller_negative3(void);
165 static void utc_app_control_to_bundle_positive1(void);
166 static void utc_app_control_to_bundle_negative1(void);
167 static void utc_app_control_to_bundle_negative2(void);
168 static void utc_app_control_to_bundle_negative3(void);
171 struct tet_testlist tet_testlist[] = {
172 { utc_app_control_create_positive, 1 },
173 { utc_app_control_create_negative, 1 },
174 { utc_app_control_destroy_positive, 1 },
175 { utc_app_control_destroy_negative, 1 },
176 { utc_app_control_set_operation_positive1, 1 },
177 { utc_app_control_set_operation_positive2, 1 },
178 { utc_app_control_set_operation_negative, 1 },
179 { utc_app_control_get_operation_positive, 1 },
180 { utc_app_control_get_operation_negative1, 1 },
181 { utc_app_control_get_operation_negative2, 1 },
182 { utc_app_control_get_operation_negative3, 1 },
183 { utc_app_control_set_uri_positive1, 1 },
184 { utc_app_control_set_uri_positive2, 1 },
185 { utc_app_control_set_uri_negative, 1 },
186 { utc_app_control_get_uri_positive, 1 },
187 { utc_app_control_get_uri_negative1, 1 },
188 { utc_app_control_get_uri_negative2, 1 },
189 { utc_app_control_get_uri_negative3, 1 },
190 { utc_app_control_set_mime_positive1, 1 },
191 { utc_app_control_set_mime_positive2, 1 },
192 { utc_app_control_set_mime_negative, 1 },
193 { utc_app_control_get_mime_positive, 1 },
194 { utc_app_control_get_mime_negative1, 1 },
195 { utc_app_control_get_mime_negative2, 1 },
196 { utc_app_control_get_mime_negative3, 1 },
197 { utc_app_control_set_package_positive, 1 },
198 { utc_app_control_set_package_negative1, 1 },
199 { utc_app_control_set_package_negative2, 1 },
200 { utc_app_control_get_package_positive, 1 },
201 { utc_app_control_get_package_negative1, 1 },
202 { utc_app_control_get_package_negative2, 1 },
203 { utc_app_control_get_package_negative3, 1 },
204 { utc_app_control_set_app_id_positive, 1 },
205 { utc_app_control_set_app_id_negative1, 1 },
206 { utc_app_control_set_app_id_negative2, 1 },
207 { utc_app_control_get_app_id_positive, 1 },
208 { utc_app_control_get_app_id_negative1, 1 },
209 { utc_app_control_get_app_id_negative2, 1 },
210 { utc_app_control_get_app_id_negative3, 1 },
211 { utc_app_control_set_category_positive, 1 },
212 { utc_app_control_set_category_negative1, 1 },
213 { utc_app_control_set_category_negative2, 1 },
214 { utc_app_control_get_category_positive, 1 },
215 { utc_app_control_get_category_negative1, 1 },
216 { utc_app_control_get_category_negative2, 1 },
217 { utc_app_control_get_category_negative3, 1 },
218 { utc_app_control_set_window_positive, 1 },
219 { utc_app_control_set_window_negative1, 1 },
220 { utc_app_control_set_window_negative2, 1 },
221 { utc_app_control_get_window_positive, 1 },
222 { utc_app_control_get_window_negative1, 1 },
223 { utc_app_control_get_window_negative2, 1 },
224 { utc_app_control_get_window_negative3, 1 },
225 { utc_app_control_add_extra_data_positive, 1 },
226 { utc_app_control_add_extra_data_negative1, 1 },
227 { utc_app_control_add_extra_data_negative2, 1 },
228 { utc_app_control_remove_extra_data_positive, 1 },
229 { utc_app_control_remove_extra_data_negative1, 1 },
230 { utc_app_control_remove_extra_data_negative2, 1 },
231 { utc_app_control_remove_extra_data_negative3, 1 },
232 { utc_app_control_get_extra_data_positive, 1 },
233 { utc_app_control_get_extra_data_negative1, 1 },
234 { utc_app_control_get_extra_data_negative2, 1 },
235 { utc_app_control_get_extra_data_negative3, 1 },
236 { utc_app_control_get_extra_data_negative4, 1 },
237 { utc_app_control_foreach_extra_data_positive, 1 },
238 { utc_app_control_foreach_extra_data_negative1, 1 },
239 { utc_app_control_foreach_extra_data_negative2, 1 },
240 { utc_app_control_clone_positive, 1 },
241 { utc_app_control_clone_negative1, 1 },
242 { utc_app_control_clone_negative2, 1 },
243 { utc_app_control_send_launch_request_positive1, 1 },
244 { utc_app_control_send_launch_request_positive2, 1 },
245 { utc_app_control_send_launch_request_positive3, 1 },
246 { utc_app_control_send_launch_request_negative1, 1 },
247 { utc_app_control_send_launch_request_negative2, 1 },
248 { utc_app_control_reply_to_launch_request_negative1, 1 },
249 { utc_app_control_reply_to_launch_request_negative2, 1 },
250 { utc_app_control_foreach_app_matched_positive, 1 },
251 { utc_app_control_foreach_app_matched_negative1, 1 },
252 { utc_app_control_foreach_app_matched_negative2, 1 },
253 { utc_app_control_add_extra_data_array_positive, 1 },
254 { utc_app_control_add_extra_data_array_negative1, 1 },
255 { utc_app_control_add_extra_data_array_negative2, 1 },
256 { utc_app_control_add_extra_data_array_negative3, 1 },
257 { utc_app_control_get_extra_data_array_positive, 1 },
258 { utc_app_control_get_extra_data_array_negative1, 1 },
259 { utc_app_control_get_extra_data_array_negative2, 1 },
260 { utc_app_control_get_extra_data_array_negative3, 1 },
261 { utc_app_control_get_extra_data_array_negative4, 1 },
262 { utc_app_control_get_extra_data_array_negative5, 1 },
263 { utc_app_control_is_extra_data_array_positive, 1 },
264 { utc_app_control_is_extra_data_array_negative1, 1 },
265 { utc_app_control_is_extra_data_array_negative2, 1 },
266 { utc_app_control_is_extra_data_array_negative3, 1 },
267 { utc_app_control_is_extra_data_array_negative4, 1 },
268 { utc_app_control_is_reply_requested_positive1, 1 },
269 { utc_app_control_is_reply_requested_negative1, 1 },
270 { utc_app_control_is_reply_requested_negative2, 1 },
271 { utc_app_control_is_reply_requested_negative3, 1 },
272 { utc_app_control_get_caller_positive1, 1 },
273 { utc_app_control_get_caller_negative1, 1 },
274 { utc_app_control_get_caller_negative2, 1 },
275 { utc_app_control_get_caller_negative3, 1 },
276 { utc_app_control_to_bundle_positive1, 1 },
277 { utc_app_control_to_bundle_negative1, 1 },
278 { utc_app_control_to_bundle_negative2, 1 },
279 { utc_app_control_to_bundle_negative3, 1 },
283 static void startup(void)
288 static void cleanup(void)
294 static void utc_app_control_create_positive(void)
296 const char *API_NAME = __FUNCTION__;
297 int ret = SERVICE_ERROR_NONE;
299 app_control_h app_control;
301 ret = app_control_create(&app_control);
303 dts_message(API_NAME, "ret(%d)", ret);
305 if(ret == SERVICE_ERROR_NONE)
307 dts_pass(API_NAME, "passed");
311 dts_fail(API_NAME, "failed");
315 static void utc_app_control_create_negative(void)
317 const char *API_NAME = __FUNCTION__;
318 int ret = SERVICE_ERROR_NONE;
320 ret = app_control_create(NULL);
322 dts_message(API_NAME, "ret(%d)", ret);
324 if(ret != SERVICE_ERROR_NONE)
326 dts_pass(API_NAME, "passed");
330 dts_fail(API_NAME, "failed");
335 static void utc_app_control_destroy_positive(void)
337 const char *API_NAME = __FUNCTION__;
338 int ret = SERVICE_ERROR_NONE;
340 app_control_h app_control;
342 app_control_create(&app_control);
344 ret = app_control_destroy(app_control);
346 dts_message(API_NAME, "ret(%d)", ret);
348 if(ret == SERVICE_ERROR_NONE)
350 dts_pass(API_NAME, "passed");
354 dts_fail(API_NAME, "failed");
359 static void utc_app_control_destroy_negative(void)
361 const char *API_NAME = __FUNCTION__;
362 int ret = SERVICE_ERROR_NONE;
364 ret = app_control_destroy(NULL);
366 dts_message(API_NAME, "ret(%d)", ret);
368 if(ret != SERVICE_ERROR_NONE)
370 dts_pass(API_NAME, "passed");
374 dts_fail(API_NAME, "failed");
379 static void utc_app_control_set_operation_positive1(void)
381 const char *API_NAME = __FUNCTION__;
382 int ret = SERVICE_ERROR_NONE;
384 const char *input_value = "INPUT_VALUE";
386 app_control_h app_control;
388 app_control_create(&app_control);
390 ret = app_control_set_operation(app_control, input_value);
392 dts_message(API_NAME, "ret(%d)", ret);
394 if(ret == SERVICE_ERROR_NONE)
396 dts_pass(API_NAME, "passed");
400 dts_fail(API_NAME, "failed");
403 app_control_destroy(app_control);
407 static void utc_app_control_set_operation_positive2(void)
409 const char *API_NAME = __FUNCTION__;
410 int ret = SERVICE_ERROR_NONE;
412 app_control_h app_control;
414 app_control_create(&app_control);
416 ret = app_control_set_operation(app_control, NULL);
418 if(ret == SERVICE_ERROR_NONE)
420 dts_pass(API_NAME, "passed");
424 dts_fail(API_NAME, "failed");
427 app_control_destroy(app_control);
430 static void utc_app_control_set_operation_negative(void)
432 const char *API_NAME = __FUNCTION__;
433 int ret = SERVICE_ERROR_NONE;
434 const char *input_value = "INPUT_VALUE";
436 ret = app_control_set_operation(NULL, input_value);
438 if(ret != SERVICE_ERROR_NONE)
440 dts_pass(API_NAME, "passed");
444 dts_fail(API_NAME, "failed");
450 static void utc_app_control_get_operation_positive(void)
452 const char *API_NAME = __FUNCTION__;
453 int ret = SERVICE_ERROR_NONE;
454 const char *input_value = "INPUT_VALUE";
457 app_control_h app_control;
459 app_control_create(&app_control);
461 app_control_set_operation(app_control, input_value);
463 ret = app_control_get_operation(app_control, &output_value);
465 if(ret == SERVICE_ERROR_NONE)
467 if(!strcmp(input_value, output_value))
469 dts_pass(API_NAME, "passed");
473 dts_fail(API_NAME, "failed");
478 dts_fail(API_NAME, "failed");
481 app_control_destroy(app_control);
485 static void utc_app_control_get_operation_negative1(void)
487 const char *API_NAME = __FUNCTION__;
488 int ret = SERVICE_ERROR_NONE;
491 ret = app_control_get_operation(NULL, &output_value);
493 if(ret != SERVICE_ERROR_NONE)
495 dts_pass(API_NAME, "passed");
499 dts_fail(API_NAME, "failed");
503 static void utc_app_control_get_operation_negative2(void)
505 const char *API_NAME = __FUNCTION__;
506 int ret = SERVICE_ERROR_NONE;
508 app_control_h app_control;
510 app_control_create(&app_control);
512 ret = app_control_get_operation(app_control, NULL);
514 if(ret != SERVICE_ERROR_NONE)
516 dts_pass(API_NAME, "passed");
520 dts_fail(API_NAME, "failed");
523 app_control_destroy(app_control);
526 static void utc_app_control_get_operation_negative3(void)
528 const char *API_NAME = __FUNCTION__;
529 int ret = SERVICE_ERROR_NONE;
532 app_control_h app_control;
534 app_control_create(&app_control);
536 ret = app_control_get_operation(app_control, &output_value);
538 if(ret == SERVICE_ERROR_NONE && output_value == NULL)
540 dts_pass(API_NAME, "passed");
544 dts_fail(API_NAME, "failed");
547 app_control_destroy(app_control);
550 static void utc_app_control_set_uri_positive1(void)
552 const char *API_NAME = __FUNCTION__;
553 int ret = SERVICE_ERROR_NONE;
554 const char *input_value = "INPUT_VALUE";
556 app_control_h app_control;
558 app_control_create(&app_control);
560 ret = app_control_set_uri(app_control, input_value);
562 if(ret == SERVICE_ERROR_NONE)
564 dts_pass(API_NAME, "passed");
568 dts_fail(API_NAME, "failed");
571 app_control_destroy(app_control);
575 static void utc_app_control_set_uri_positive2(void)
577 const char *API_NAME = __FUNCTION__;
578 int ret = SERVICE_ERROR_NONE;
580 app_control_h app_control;
582 app_control_create(&app_control);
584 ret = app_control_set_uri(app_control, NULL);
586 if(ret == SERVICE_ERROR_NONE)
588 dts_pass(API_NAME, "passed");
592 dts_fail(API_NAME, "failed");
595 app_control_destroy(app_control);
599 static void utc_app_control_set_uri_negative(void)
601 const char *API_NAME = __FUNCTION__;
602 int ret = SERVICE_ERROR_NONE;
603 const char *input_value = "INPUT_VALUE";
605 ret = app_control_get_uri(NULL, input_value);
607 if(ret != SERVICE_ERROR_NONE)
609 dts_pass(API_NAME, "passed");
613 dts_fail(API_NAME, "failed");
617 static void utc_app_control_get_uri_positive(void)
619 const char *API_NAME = __FUNCTION__;
620 int ret = SERVICE_ERROR_NONE;
621 const char *input_value = "INPUT_VALUE";
624 app_control_h app_control;
626 app_control_create(&app_control);
628 app_control_set_uri(app_control, input_value);
630 app_control_get_uri(app_control, &output_value);
632 if(ret == SERVICE_ERROR_NONE)
634 if(!strcmp(input_value, output_value))
636 dts_pass(API_NAME, "passed");
640 dts_fail(API_NAME, "failed");
645 dts_fail(API_NAME, "failed");
648 app_control_destroy(app_control);
652 static void utc_app_control_get_uri_negative1(void)
654 const char *API_NAME = __FUNCTION__;
655 int ret = SERVICE_ERROR_NONE;
658 app_control_h app_control;
660 app_control_create(&app_control);
662 ret = app_control_get_uri(app_control, &output_value);
664 if(ret == SERVICE_ERROR_NONE && output_value == NULL)
666 dts_pass(API_NAME, "passed");
670 dts_fail(API_NAME, "failed");
673 app_control_destroy(app_control);
677 static void utc_app_control_get_uri_negative2(void)
679 const char *API_NAME = __FUNCTION__;
680 int ret = SERVICE_ERROR_NONE;
683 ret = app_control_get_uri(NULL, &output_value);
685 if(ret != SERVICE_ERROR_NONE)
687 dts_pass(API_NAME, "passed");
691 dts_fail(API_NAME, "failed");
696 static void utc_app_control_get_uri_negative3(void)
698 const char *API_NAME = __FUNCTION__;
699 int ret = SERVICE_ERROR_NONE;
701 app_control_h app_control;
703 app_control_create(&app_control);
705 ret = app_control_get_uri(app_control, NULL);
707 if(ret != SERVICE_ERROR_NONE)
709 dts_pass(API_NAME, "passed");
713 dts_fail(API_NAME, "failed");
716 app_control_destroy(app_control);
720 static void utc_app_control_set_mime_positive1(void)
722 const char *API_NAME = __FUNCTION__;
723 int ret = SERVICE_ERROR_NONE;
724 const char *input_value = "INPUT_VALUE";
726 app_control_h app_control;
728 app_control_create(&app_control);
730 ret = app_control_set_mime(app_control, input_value);
732 if(ret == SERVICE_ERROR_NONE)
734 dts_pass(API_NAME, "passed");
738 dts_fail(API_NAME, "failed");
741 app_control_destroy(app_control);
744 static void utc_app_control_set_mime_positive2(void)
746 const char *API_NAME = __FUNCTION__;
747 int ret = SERVICE_ERROR_NONE;
749 app_control_h app_control;
751 app_control_create(&app_control);
753 ret = app_control_set_mime(app_control, NULL);
755 if(ret == SERVICE_ERROR_NONE)
757 dts_pass(API_NAME, "passed");
761 dts_fail(API_NAME, "failed");
764 app_control_destroy(app_control);
768 static void utc_app_control_set_mime_negative(void)
770 const char *API_NAME = __FUNCTION__;
771 int ret = SERVICE_ERROR_NONE;
772 const char *input_value = "INPUT_VALUE";
774 ret = app_control_set_mime(NULL, input_value);
776 if(ret != SERVICE_ERROR_NONE)
778 dts_pass(API_NAME, "passed");
782 dts_fail(API_NAME, "failed");
786 static void utc_app_control_get_mime_positive(void)
788 const char *API_NAME = __FUNCTION__;
789 int ret = SERVICE_ERROR_NONE;
790 const char *input_value = "INPUT_VALUE";
793 app_control_h app_control;
795 app_control_create(&app_control);
797 app_control_set_mime(app_control, input_value);
799 ret = app_control_get_mime(app_control, &output_value);
801 if(ret == SERVICE_ERROR_NONE)
803 if(!strcmp(input_value, output_value))
805 dts_pass(API_NAME, "passed");
809 dts_fail(API_NAME, "failed");
814 dts_fail(API_NAME, "failed");
817 app_control_destroy(app_control);
820 static void utc_app_control_get_mime_negative1(void)
822 const char *API_NAME = __FUNCTION__;
823 int ret = SERVICE_ERROR_NONE;
826 app_control_h app_control;
828 app_control_create(&app_control);
830 ret = app_control_get_mime(app_control, &output_value);
832 if(ret == SERVICE_ERROR_NONE && output_value == NULL)
834 dts_pass(API_NAME, "passed");
838 dts_fail(API_NAME, "failed");
841 app_control_destroy(app_control);
844 static void utc_app_control_get_mime_negative2(void)
846 const char *API_NAME = __FUNCTION__;
847 int ret = SERVICE_ERROR_NONE;
850 ret = app_control_get_mime(NULL, &output_value);
852 if(ret != SERVICE_ERROR_NONE)
854 dts_pass(API_NAME, "passed");
858 dts_fail(API_NAME, "failed");
862 static void utc_app_control_get_mime_negative3(void)
864 const char *API_NAME = __FUNCTION__;
865 int ret = SERVICE_ERROR_NONE;
867 app_control_h app_control;
869 app_control_create(&app_control);
871 ret = app_control_get_mime(app_control, NULL);
873 if(ret != SERVICE_ERROR_NONE)
875 dts_pass(API_NAME, "passed");
879 dts_fail(API_NAME, "failed");
882 app_control_destroy(app_control);
885 static void utc_app_control_set_package_positive(void)
887 const char *API_NAME = __FUNCTION__;
888 int ret = SERVICE_ERROR_NONE;
889 const char *input_value = "INPUT_VALUE";
891 app_control_h app_control;
893 app_control_create(&app_control);
895 ret = app_control_set_package(app_control, input_value);
897 if(ret == SERVICE_ERROR_NONE)
899 dts_pass(API_NAME, "passed");
903 dts_fail(API_NAME, "failed");
906 app_control_destroy(app_control);
909 static void utc_app_control_set_package_negative1(void)
911 const char *API_NAME = __FUNCTION__;
912 int ret = SERVICE_ERROR_NONE;
913 const char *input_value = "INPUT_VALUE";
915 ret = app_control_set_package(NULL, input_value);
917 if(ret != SERVICE_ERROR_NONE)
919 dts_pass(API_NAME, "passed");
923 dts_fail(API_NAME, "failed");
927 static void utc_app_control_set_package_negative2(void)
929 const char *API_NAME = __FUNCTION__;
930 int ret = SERVICE_ERROR_NONE;
932 ret = app_control_set_package(NULL, NULL);
934 if(ret != SERVICE_ERROR_NONE)
936 dts_pass(API_NAME, "passed");
940 dts_fail(API_NAME, "failed");
944 static void utc_app_control_get_package_positive(void)
946 const char *API_NAME = __FUNCTION__;
947 int ret = SERVICE_ERROR_NONE;
948 const char *input_value = "INPUT_VALUE";
951 app_control_h app_control;
953 app_control_create(&app_control);
955 app_control_set_package(app_control, input_value);
957 ret = app_control_get_package(app_control, &output_value);
959 if(ret == SERVICE_ERROR_NONE)
961 if(!strcmp(input_value, output_value))
963 dts_pass(API_NAME, "passed");
967 dts_fail(API_NAME, "failed");
972 dts_fail(API_NAME, "failed");
975 app_control_destroy(app_control);
978 static void utc_app_control_get_package_negative1(void)
980 const char *API_NAME = __FUNCTION__;
981 int ret = SERVICE_ERROR_NONE;
984 app_control_h app_control;
986 app_control_create(&app_control);
988 ret = app_control_get_package(app_control, &output_value);
990 if(ret == SERVICE_ERROR_NONE && output_value == NULL)
992 dts_pass(API_NAME, "passed");
996 dts_fail(API_NAME, "failed");
999 app_control_destroy(app_control);
1002 static void utc_app_control_get_package_negative2(void)
1004 const char *API_NAME = __FUNCTION__;
1005 int ret = SERVICE_ERROR_NONE;
1008 ret = app_control_get_package(NULL, &output_value);
1010 if(ret != SERVICE_ERROR_NONE)
1012 dts_pass(API_NAME, "passed");
1016 dts_fail(API_NAME, "failed");
1020 static void utc_app_control_get_package_negative3(void)
1022 const char *API_NAME = __FUNCTION__;
1023 int ret = SERVICE_ERROR_NONE;
1025 app_control_h app_control;
1027 app_control_create(&app_control);
1029 ret = app_control_get_package(app_control, NULL);
1031 if(ret != SERVICE_ERROR_NONE)
1033 dts_pass(API_NAME, "passed");
1037 dts_fail(API_NAME, "failed");
1040 app_control_destroy(app_control);
1043 static void utc_app_control_set_app_id_positive(void)
1045 const char *API_NAME = __FUNCTION__;
1046 int ret = SERVICE_ERROR_NONE;
1047 const char *input_value = "INPUT_VALUE";
1049 app_control_h app_control;
1051 app_control_create(&app_control);
1053 ret = app_control_set_app_id(app_control, input_value);
1055 if(ret == SERVICE_ERROR_NONE)
1057 dts_pass(API_NAME, "passed");
1061 dts_fail(API_NAME, "failed");
1064 app_control_destroy(app_control);
1067 static void utc_app_control_set_app_id_negative1(void)
1069 const char *API_NAME = __FUNCTION__;
1070 int ret = SERVICE_ERROR_NONE;
1072 ret = app_control_set_app_id(NULL, NULL);
1074 if(ret != SERVICE_ERROR_NONE)
1076 dts_pass(API_NAME, "passed");
1080 dts_fail(API_NAME, "failed");
1084 static void utc_app_control_set_app_id_negative2(void)
1086 const char *API_NAME = __FUNCTION__;
1087 int ret = SERVICE_ERROR_NONE;
1088 const char *input_value = "INPUT_VALUE";
1090 ret = app_control_set_app_id(NULL, input_value);
1092 if(ret != SERVICE_ERROR_NONE)
1094 dts_pass(API_NAME, "passed");
1098 dts_fail(API_NAME, "failed");
1102 static void utc_app_control_get_app_id_positive(void)
1104 const char *API_NAME = __FUNCTION__;
1105 int ret = SERVICE_ERROR_NONE;
1106 const char *input_value = "INPUT_VALUE";
1109 app_control_h app_control;
1111 app_control_create(&app_control);
1113 app_control_set_app_id(app_control, input_value);
1115 ret = app_control_get_app_id(app_control, &output_value);
1117 if(ret == SERVICE_ERROR_NONE)
1119 if(!strcmp(input_value, output_value))
1121 dts_pass(API_NAME, "passed");
1125 dts_fail(API_NAME, "failed");
1130 dts_fail(API_NAME, "failed");
1133 app_control_destroy(app_control);
1136 static void utc_app_control_get_app_id_negative1(void)
1138 const char *API_NAME = __FUNCTION__;
1139 int ret = SERVICE_ERROR_NONE;
1142 app_control_h app_control;
1144 app_control_create(&app_control);
1146 ret = app_control_get_app_id(app_control, &output_value);
1148 if(ret == SERVICE_ERROR_NONE && output_value == NULL)
1150 dts_pass(API_NAME, "passed");
1154 dts_fail(API_NAME, "failed");
1157 app_control_destroy(app_control);
1160 static void utc_app_control_get_app_id_negative2(void)
1162 const char *API_NAME = __FUNCTION__;
1163 int ret = SERVICE_ERROR_NONE;
1166 ret = app_control_get_app_id(NULL, &output_value);
1168 if(ret != SERVICE_ERROR_NONE)
1170 dts_pass(API_NAME, "passed");
1174 dts_fail(API_NAME, "failed");
1178 static void utc_app_control_get_app_id_negative3(void)
1180 const char *API_NAME = __FUNCTION__;
1181 int ret = SERVICE_ERROR_NONE;
1183 app_control_h app_control;
1185 app_control_create(&app_control);
1187 ret = app_control_get_app_id(app_control, NULL);
1189 if(ret != SERVICE_ERROR_NONE)
1191 dts_pass(API_NAME, "passed");
1195 dts_fail(API_NAME, "failed");
1198 app_control_destroy(app_control);
1201 static void utc_app_control_set_category_positive(void)
1203 const char *API_NAME = __FUNCTION__;
1204 int ret = SERVICE_ERROR_NONE;
1205 const char *input_value = "INPUT_VALUE";
1207 app_control_h app_control;
1209 app_control_create(&app_control);
1211 ret = app_control_set_category(app_control, input_value);
1213 if(ret == SERVICE_ERROR_NONE)
1215 dts_pass(API_NAME, "passed");
1219 dts_fail(API_NAME, "failed");
1222 app_control_destroy(app_control);
1225 static void utc_app_control_set_category_negative1(void)
1227 const char *API_NAME = __FUNCTION__;
1228 int ret = SERVICE_ERROR_NONE;
1230 ret = app_control_set_category(NULL, NULL);
1232 if(ret != SERVICE_ERROR_NONE)
1234 dts_pass(API_NAME, "passed");
1238 dts_fail(API_NAME, "failed");
1242 static void utc_app_control_set_category_negative2(void)
1244 const char *API_NAME = __FUNCTION__;
1245 int ret = SERVICE_ERROR_NONE;
1246 const char *input_value = "INPUT_VALUE";
1248 ret = app_control_set_category(NULL, input_value);
1250 if(ret != SERVICE_ERROR_NONE)
1252 dts_pass(API_NAME, "passed");
1256 dts_fail(API_NAME, "failed");
1260 static void utc_app_control_get_category_positive(void)
1262 const char *API_NAME = __FUNCTION__;
1263 int ret = SERVICE_ERROR_NONE;
1264 const char *input_value = "INPUT_VALUE";
1267 app_control_h app_control;
1269 app_control_create(&app_control);
1271 app_control_set_category(app_control, input_value);
1273 ret = app_control_get_category(app_control, &output_value);
1275 if(ret == SERVICE_ERROR_NONE)
1277 if(!strcmp(input_value, output_value))
1279 dts_pass(API_NAME, "passed");
1283 dts_fail(API_NAME, "failed");
1288 dts_fail(API_NAME, "failed");
1291 app_control_destroy(app_control);
1294 static void utc_app_control_get_category_negative1(void)
1296 const char *API_NAME = __FUNCTION__;
1297 int ret = SERVICE_ERROR_NONE;
1300 app_control_h app_control;
1302 app_control_create(&app_control);
1304 ret = app_control_get_category(app_control, &output_value);
1306 if(ret == SERVICE_ERROR_NONE && output_value == NULL)
1308 dts_pass(API_NAME, "passed");
1312 dts_fail(API_NAME, "failed");
1315 app_control_destroy(app_control);
1318 static void utc_app_control_get_category_negative2(void)
1320 const char *API_NAME = __FUNCTION__;
1321 int ret = SERVICE_ERROR_NONE;
1324 ret = app_control_get_category(NULL, &output_value);
1326 if(ret != SERVICE_ERROR_NONE)
1328 dts_pass(API_NAME, "passed");
1332 dts_fail(API_NAME, "failed");
1336 static void utc_app_control_get_category_negative3(void)
1338 const char *API_NAME = __FUNCTION__;
1339 int ret = SERVICE_ERROR_NONE;
1341 app_control_h app_control;
1343 app_control_create(&app_control);
1345 ret = app_control_get_category(app_control, NULL);
1347 if(ret != SERVICE_ERROR_NONE)
1349 dts_pass(API_NAME, "passed");
1353 dts_fail(API_NAME, "failed");
1356 app_control_destroy(app_control);
1359 static void utc_app_control_set_window_positive(void)
1361 const char *API_NAME = __FUNCTION__;
1362 int ret = SERVICE_ERROR_NONE;
1363 unsigned int wid = 5;
1364 app_control_h app_control;
1366 app_control_create(&app_control);
1368 ret = app_control_set_window(app_control, wid);
1370 if(ret == SERVICE_ERROR_NONE)
1372 dts_pass(API_NAME, "passed");
1376 dts_fail(API_NAME, "failed");
1379 app_control_destroy(app_control);
1382 static void utc_app_control_set_window_negative1(void)
1384 const char *API_NAME = __FUNCTION__;
1385 int ret = SERVICE_ERROR_NONE;
1387 ret = app_control_set_window(NULL, -1);
1389 if(ret != SERVICE_ERROR_NONE)
1391 dts_pass(API_NAME, "passed");
1395 dts_fail(API_NAME, "failed");
1399 static void utc_app_control_set_window_negative2(void)
1401 const char *API_NAME = __FUNCTION__;
1402 int ret = SERVICE_ERROR_NONE;
1403 unsigned int wid = 5;
1405 ret = app_control_set_window(NULL, wid);
1407 if(ret != SERVICE_ERROR_NONE)
1409 dts_pass(API_NAME, "passed");
1413 dts_fail(API_NAME, "failed");
1417 static void utc_app_control_get_window_positive(void)
1419 const char *API_NAME = __FUNCTION__;
1420 int ret = SERVICE_ERROR_NONE;
1421 unsigned int wid = 5;
1422 int output_value = 0;
1424 app_control_h app_control;
1426 app_control_create(&app_control);
1428 app_control_set_window(app_control, wid);
1430 ret = app_control_get_window(app_control, &output_value);
1432 if(ret == SERVICE_ERROR_NONE)
1434 if(wid == output_value)
1436 dts_pass(API_NAME, "passed");
1440 dts_fail(API_NAME, "failed");
1445 dts_fail(API_NAME, "failed");
1448 app_control_destroy(app_control);
1451 static void utc_app_control_get_window_negative1(void)
1453 const char *API_NAME = __FUNCTION__;
1454 int ret = SERVICE_ERROR_NONE;
1455 int output_value = 0;
1457 app_control_h app_control;
1459 app_control_create(&app_control);
1461 ret = app_control_get_window(app_control, &output_value);
1463 if(ret == SERVICE_ERROR_NONE)
1465 dts_pass(API_NAME, "passed");
1469 dts_fail(API_NAME, "failed");
1473 static void utc_app_control_get_window_negative2(void)
1475 const char *API_NAME = __FUNCTION__;
1476 int ret = SERVICE_ERROR_NONE;
1477 int output_value = 0;
1479 ret = app_control_get_window(NULL, &output_value);
1481 if(ret != SERVICE_ERROR_NONE)
1483 dts_pass(API_NAME, "passed");
1487 dts_fail(API_NAME, "failed");
1491 static void utc_app_control_get_window_negative3(void)
1493 const char *API_NAME = __FUNCTION__;
1494 int ret = SERVICE_ERROR_NONE;
1496 app_control_h app_control;
1498 app_control_create(&app_control);
1500 ret = app_control_get_window(app_control, NULL);
1502 if(ret != SERVICE_ERROR_NONE)
1504 dts_pass(API_NAME, "passed");
1508 dts_fail(API_NAME, "failed");
1511 app_control_destroy(app_control);
1514 static void utc_app_control_add_extra_data_positive(void)
1516 const char *API_NAME = __FUNCTION__;
1517 int ret = SERVICE_ERROR_NONE;
1518 char *key = "EXTRA_KEY";
1519 char *value = "EXTRA_VALUE";
1521 app_control_h app_control;
1523 app_control_create(&app_control);
1525 ret = app_control_add_extra_data(app_control, key, value);
1527 if(ret == SERVICE_ERROR_NONE)
1529 dts_pass(API_NAME, "passed");
1533 dts_fail(API_NAME, "failed");
1536 app_control_destroy(app_control);
1539 static void utc_app_control_add_extra_data_negative1(void)
1541 const char *API_NAME = __FUNCTION__;
1543 int ret = SERVICE_ERROR_NONE;
1544 char *key = "EXTRA_KEY";
1545 char *value = "EXTRA_VALUE";
1547 app_control_h app_control;
1549 app_control_create(&app_control);
1553 ret = app_control_add_extra_data(app_control, NULL, value);
1555 if(ret != SERVICE_ERROR_NONE)
1560 // key : zero-length
1561 ret = app_control_add_extra_data(app_control, "", value);
1563 if(ret != SERVICE_ERROR_NONE)
1569 ret = app_control_add_extra_data(app_control, key, NULL);
1571 if(ret != SERVICE_ERROR_NONE)
1576 // value : zero-length
1577 ret = app_control_add_extra_data(app_control, key, "");
1579 if(ret != SERVICE_ERROR_NONE)
1586 dts_pass(API_NAME, "passed");
1590 dts_fail(API_NAME, "failed");
1593 app_control_destroy(app_control);
1596 static void utc_app_control_add_extra_data_negative2(void)
1598 const char *API_NAME = __FUNCTION__;
1599 int ret = SERVICE_ERROR_NONE;
1600 char *key = "EXTRA_KEY";
1601 char *value = "EXTRA_VALUE";
1603 ret = app_control_add_extra_data(NULL, key, value);
1605 if(ret != SERVICE_ERROR_NONE)
1607 dts_pass(API_NAME, "passed");
1611 dts_fail(API_NAME, "failed");
1615 static void utc_app_control_remove_extra_data_positive(void)
1617 const char *API_NAME = __FUNCTION__;
1618 int ret = SERVICE_ERROR_NONE;
1619 char *key = "EXTRA_KEY";
1620 char *value = "EXTRA_VALUE";
1622 app_control_h app_control;
1624 app_control_create(&app_control);
1626 app_control_add_extra_data(app_control, key, value);
1628 ret = app_control_remove_extra_data(app_control, key);
1630 if(ret == SERVICE_ERROR_NONE)
1632 dts_pass(API_NAME, "passed");
1636 dts_fail(API_NAME, "failed");
1639 app_control_destroy(app_control);
1642 static void utc_app_control_remove_extra_data_negative1(void)
1644 const char *API_NAME = __FUNCTION__;
1645 int ret = SERVICE_ERROR_NONE;
1646 char *key = "EXTRA_KEY";
1648 app_control_h app_control;
1650 app_control_create(&app_control);
1652 ret = app_control_remove_extra_data(app_control, key);
1654 if(ret != SERVICE_ERROR_NONE)
1656 dts_pass(API_NAME, "passed");
1660 dts_fail(API_NAME, "failed");
1663 app_control_destroy(app_control);
1666 static void utc_app_control_remove_extra_data_negative2(void)
1668 const char *API_NAME = __FUNCTION__;
1669 int ret = SERVICE_ERROR_NONE;
1670 char *key = "EXTRA_KEY";
1672 ret = app_control_remove_extra_data(NULL, key);
1674 if(ret != SERVICE_ERROR_NONE)
1676 dts_pass(API_NAME, "passed");
1680 dts_fail(API_NAME, "failed");
1684 static void utc_app_control_remove_extra_data_negative3(void)
1686 const char *API_NAME = __FUNCTION__;
1687 int ret = SERVICE_ERROR_NONE;
1689 app_control_h app_control;
1691 app_control_create(&app_control);
1693 ret = app_control_remove_extra_data(app_control, NULL);
1695 if(ret != SERVICE_ERROR_NONE)
1697 dts_pass(API_NAME, "passed");
1701 dts_fail(API_NAME, "failed");
1704 app_control_destroy(app_control);
1707 static void utc_app_control_get_extra_data_positive(void)
1709 const char *API_NAME = __FUNCTION__;
1710 int ret = SERVICE_ERROR_NONE;
1711 char *key = "EXTRA_KEY";
1712 char *value = "EXTRA_VALUE";
1715 app_control_h app_control;
1717 app_control_create(&app_control);
1719 app_control_add_extra_data(app_control, key, value);
1721 ret = app_control_get_extra_data(app_control, key, &ret_value);
1723 if(ret == SERVICE_ERROR_NONE && !strcmp(ret_value, value))
1725 dts_pass(API_NAME, "passed");
1729 dts_fail(API_NAME, "failed");
1732 app_control_destroy(app_control);
1735 static void utc_app_control_get_extra_data_negative1(void)
1737 const char *API_NAME = __FUNCTION__;
1738 int ret = SERVICE_ERROR_NONE;
1739 char *key = "EXTRA_KEY";
1742 app_control_h app_control;
1744 app_control_create(&app_control);
1746 ret = app_control_get_extra_data(app_control, key, &ret_value);
1748 if(ret != SERVICE_ERROR_NONE)
1750 dts_pass(API_NAME, "passed");
1754 dts_fail(API_NAME, "failed");
1757 app_control_destroy(app_control);
1760 static void utc_app_control_get_extra_data_negative2(void)
1762 const char *API_NAME = __FUNCTION__;
1763 int ret = SERVICE_ERROR_NONE;
1764 char *key = "EXTRA_KEY";
1767 ret = app_control_get_extra_data(NULL, key, &ret_value);
1769 if(ret != SERVICE_ERROR_NONE)
1771 dts_pass(API_NAME, "passed");
1775 dts_fail(API_NAME, "failed");
1780 static void utc_app_control_get_extra_data_negative3(void)
1782 const char *API_NAME = __FUNCTION__;
1783 int ret = SERVICE_ERROR_NONE;
1787 app_control_h app_control;
1789 app_control_create(&app_control);
1791 ret = app_control_get_extra_data(app_control, NULL, &ret_value);
1793 if(ret != SERVICE_ERROR_NONE)
1795 dts_pass(API_NAME, "passed");
1799 dts_fail(API_NAME, "failed");
1802 app_control_destroy(app_control);
1805 static void utc_app_control_get_extra_data_negative4(void)
1807 const char *API_NAME = __FUNCTION__;
1808 int ret = SERVICE_ERROR_NONE;
1809 char *key = "EXTRA_KEY";
1811 app_control_h app_control;
1813 app_control_create(&app_control);
1815 ret = app_control_get_extra_data(app_control, key, NULL);
1817 if(ret != SERVICE_ERROR_NONE)
1819 dts_pass(API_NAME, "passed");
1823 dts_fail(API_NAME, "failed");
1826 app_control_destroy(app_control);
1829 #define NUM_EXTRA_DATA 32
1831 bool app_control_extra_data(app_control_h app_control, const char *key, void *user_data)
1833 bool *passed = (bool*)user_data;
1836 app_control_get_extra_data(app_control, key, &value);
1838 if (!strcmp(key, value))
1840 int index = atoi(key);
1841 passed[index] = true;
1847 static void utc_app_control_foreach_extra_data_positive(void)
1849 const char *API_NAME = __FUNCTION__;
1850 int ret = SERVICE_ERROR_NONE;
1852 bool passed[NUM_EXTRA_DATA] = {0, };
1854 char buf[32] = {0, };
1856 app_control_h app_control;
1858 app_control_create(&app_control);
1860 for (i=0; i<NUM_EXTRA_DATA; i++)
1862 snprintf(buf, sizeof(buf), "%d", i);
1863 app_control_add_extra_data(app_control, buf, buf);
1866 ret = app_control_foreach_extra_data(app_control, app_control_extra_data, &passed);
1868 for (i=0; i<NUM_EXTRA_DATA; i++)
1870 if (passed[i] == true)
1876 if(ret == SERVICE_ERROR_NONE && num_passed == NUM_EXTRA_DATA)
1878 dts_pass(API_NAME, "passed");
1882 dts_fail(API_NAME, "failed");
1885 app_control_destroy(app_control);
1888 static void utc_app_control_foreach_extra_data_negative1(void)
1890 const char *API_NAME = __FUNCTION__;
1891 int ret = SERVICE_ERROR_NONE;
1893 app_control_h app_control;
1895 app_control_create(&app_control);
1897 ret = app_control_foreach_extra_data(app_control, NULL, NULL);
1899 if(ret != SERVICE_ERROR_NONE)
1901 dts_pass(API_NAME, "passed");
1905 dts_fail(API_NAME, "failed");
1908 app_control_destroy(app_control);
1911 static void utc_app_control_foreach_extra_data_negative2(void)
1913 const char *API_NAME = __FUNCTION__;
1914 int ret = SERVICE_ERROR_NONE;
1916 ret = app_control_foreach_extra_data(NULL, app_control_extra_data, NULL);
1918 if(ret != SERVICE_ERROR_NONE)
1920 dts_pass(API_NAME, "passed");
1924 dts_fail(API_NAME, "failed");
1928 static void utc_app_control_clone_positive(void)
1930 const char *API_NAME = __FUNCTION__;
1931 int ret = SERVICE_ERROR_NONE;
1933 char *operation = "OPERATION_VALUE";
1934 char *operation_clone;
1936 char *uri = "URI_VALUE";
1939 char *mime = "MIME_VALUE";
1942 char *package = "PACKAGE_VALUE";
1943 char *package_clone;
1945 char *extra_key = "EXTRA_KEY";
1947 char *extra_value = "EXTRA_VALUE";
1948 char *extra_value_clone;
1950 app_control_h app_control;
1951 app_control_h app_control_cloned;
1953 app_control_create(&app_control);
1954 app_control_set_operation(app_control, operation);
1955 app_control_set_uri(app_control, uri);
1956 app_control_set_mime(app_control, mime);
1957 app_control_set_package(app_control, package);
1958 app_control_add_extra_data(app_control, extra_key, extra_value);
1960 ret = app_control_clone(&app_control_cloned, app_control);
1962 app_control_get_operation(app_control_cloned, &operation_clone);
1963 app_control_get_uri(app_control_cloned, &uri_clone);
1964 app_control_get_mime(app_control_cloned, &mime_clone);
1965 app_control_get_package(app_control_cloned, &package_clone);
1966 app_control_get_extra_data(app_control_cloned, extra_key, &extra_value_clone);
1969 if(ret == SERVICE_ERROR_NONE
1970 && !strcmp(operation, operation_clone)
1971 && !strcmp(uri, uri_clone)
1972 && !strcmp(mime, mime_clone)
1973 && !strcmp(package, package_clone)
1974 && !strcmp(extra_value, extra_value_clone))
1976 dts_pass(API_NAME, "passed");
1980 dts_fail(API_NAME, "failed");
1983 app_control_destroy(app_control);
1984 app_control_destroy(app_control_cloned);
1987 static void utc_app_control_clone_negative1(void)
1989 const char *API_NAME = __FUNCTION__;
1990 int ret = SERVICE_ERROR_NONE;
1992 app_control_h app_control_cloned;
1994 ret = app_control_clone(&app_control_cloned, NULL);
1996 if(ret != SERVICE_ERROR_NONE)
1998 dts_pass(API_NAME, "passed");
2002 dts_fail(API_NAME, "failed");
2006 static void utc_app_control_clone_negative2(void)
2008 const char *API_NAME = __FUNCTION__;
2009 int ret = SERVICE_ERROR_NONE;
2011 app_control_h app_control;
2013 app_control_create(&app_control);
2015 ret = app_control_clone(NULL, app_control);
2017 if(ret != SERVICE_ERROR_NONE)
2019 dts_pass(API_NAME, "passed");
2023 dts_fail(API_NAME, "failed");
2028 void dts_app_control_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
2033 static void utc_app_control_send_launch_request_positive1(void)
2035 const char *API_NAME = __FUNCTION__;
2036 int ret = SERVICE_ERROR_NONE;
2038 app_control_h app_control;
2040 app_control_create(&app_control);
2042 app_control_set_operation(app_control, SERVICE_OPERATION_DEFAULT);
2044 app_control_set_package(app_control, "org.tizen.calculator");
2046 // explicit launch without reply callback
2047 ret = app_control_send_launch_request(app_control, NULL, NULL);
2049 if(ret == SERVICE_ERROR_NONE)
2051 dts_pass(API_NAME, "passed");
2055 dts_fail(API_NAME, "failed");
2058 app_control_destroy(app_control);
2062 static void utc_app_control_send_launch_request_positive2(void)
2064 const char *API_NAME = __FUNCTION__;
2065 int ret = SERVICE_ERROR_NONE;
2067 app_control_h app_control;
2069 app_control_create(&app_control);
2071 app_control_set_operation(app_control, SERVICE_OPERATION_DEFAULT);
2073 app_control_set_package(app_control, "org.tizen.calculator");
2075 // explicit launch with reply callback
2076 ret = app_control_send_launch_request(app_control, dts_app_control_reply_cb, NULL);
2078 if(ret == SERVICE_ERROR_NONE)
2080 dts_pass(API_NAME, "passed");
2084 dts_fail(API_NAME, "failed");
2087 app_control_destroy(app_control);
2090 static void utc_app_control_send_launch_request_positive3(void)
2092 const char *API_NAME = __FUNCTION__;
2093 int ret = SERVICE_ERROR_NONE;
2095 app_control_h app_control;
2097 app_control_create(&app_control);
2099 app_control_set_operation(app_control, SERVICE_OPERATION_VIEW);
2101 app_control_set_mime(app_control, "type/custom");
2103 ret = app_control_send_launch_request(app_control, dts_app_control_reply_cb, NULL);
2105 if(ret == SERVICE_ERROR_APP_NOT_FOUND)
2107 dts_pass(API_NAME, "passed");
2111 dts_fail(API_NAME, "failed");
2114 app_control_destroy(app_control);
2117 static void utc_app_control_send_launch_request_negative1(void)
2119 const char *API_NAME = __FUNCTION__;
2120 int ret = SERVICE_ERROR_NONE;
2122 ret = app_control_send_launch_request(NULL, NULL, NULL);
2124 if(ret != SERVICE_ERROR_NONE)
2126 dts_pass(API_NAME, "passed");
2130 dts_fail(API_NAME, "failed");
2134 static void utc_app_control_send_launch_request_negative2(void)
2136 const char *API_NAME = __FUNCTION__;
2137 int ret = SERVICE_ERROR_NONE;
2139 app_control_h app_control;
2141 app_control_create(&app_control);
2143 app_control_set_operation(app_control, SERVICE_OPERATION_DEFAULT);
2145 ret = app_control_send_launch_request(app_control, NULL, NULL);
2147 if(ret == SERVICE_ERROR_APP_NOT_FOUND)
2149 dts_pass(API_NAME, "passed");
2153 dts_fail(API_NAME, "failed");
2156 app_control_destroy(app_control);
2159 static void utc_app_control_reply_to_launch_request_negative1(void)
2161 const char *API_NAME = __FUNCTION__;
2162 int ret = SERVICE_ERROR_NONE;
2164 app_control_h request;
2166 app_control_create(&request);
2168 ret = app_control_reply_to_launch_request(NULL, request, SERVICE_RESULT_CANCELED);
2170 if(ret != SERVICE_ERROR_NONE)
2172 dts_pass(API_NAME, "passed");
2176 dts_fail(API_NAME, "failed");
2180 static void utc_app_control_reply_to_launch_request_negative2(void)
2182 const char *API_NAME = __FUNCTION__;
2183 int ret = SERVICE_ERROR_NONE;
2185 app_control_h app_control;
2187 app_control_create(&app_control);
2189 ret = app_control_reply_to_launch_request(app_control, NULL, SERVICE_RESULT_CANCELED);
2191 if(ret != SERVICE_ERROR_NONE)
2193 dts_pass(API_NAME, "passed");
2197 dts_fail(API_NAME, "failed");
2200 app_control_destroy(app_control);
2203 bool dts_app_control_app_matched_cb(app_control_h app_control, const char *package, void *user_data)
2208 static void utc_app_control_foreach_app_matched_positive(void)
2210 const char *API_NAME = __FUNCTION__;
2211 int ret = SERVICE_ERROR_NONE;
2213 app_control_h app_control;
2215 app_control_create(&app_control);
2217 app_control_set_operation(app_control, SERVICE_OPERATION_VIEW);
2219 ret = app_control_foreach_app_matched(app_control, dts_app_control_app_matched_cb, NULL);
2221 if(ret == SERVICE_ERROR_NONE)
2223 dts_pass(API_NAME, "passed");
2227 dts_fail(API_NAME, "failed");
2230 app_control_destroy(app_control);
2233 static void utc_app_control_foreach_app_matched_negative1(void)
2235 const char *API_NAME = __FUNCTION__;
2236 int ret = SERVICE_ERROR_NONE;
2238 ret = app_control_foreach_app_matched(NULL, dts_app_control_app_matched_cb, NULL);
2240 if(ret != SERVICE_ERROR_NONE)
2242 dts_pass(API_NAME, "passed");
2246 dts_fail(API_NAME, "failed");
2250 static void utc_app_control_foreach_app_matched_negative2(void)
2252 const char *API_NAME = __FUNCTION__;
2253 int ret = SERVICE_ERROR_NONE;
2255 app_control_h app_control;
2257 app_control_create(&app_control);
2259 ret = app_control_foreach_app_matched(app_control, NULL, NULL);
2261 if(ret != SERVICE_ERROR_NONE)
2263 dts_pass(API_NAME, "passed");
2267 dts_fail(API_NAME, "failed");
2270 app_control_destroy(app_control);
2273 static void utc_app_control_add_extra_data_array_positive(void)
2275 const char *API_NAME = __FUNCTION__;
2276 int ret = SERVICE_ERROR_NONE;
2278 const char *array_key = "array_key";
2279 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2280 int array_length = 4;
2282 app_control_h app_control;
2284 app_control_create(&app_control);
2286 ret = app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2288 if(ret == SERVICE_ERROR_NONE)
2290 dts_pass(API_NAME, "passed");
2294 dts_fail(API_NAME, "failed");
2297 app_control_destroy(app_control);
2300 static void utc_app_control_add_extra_data_array_negative1(void)
2302 const char *API_NAME = __FUNCTION__;
2303 int ret = SERVICE_ERROR_NONE;
2305 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2307 app_control_h app_control;
2309 app_control_create(&app_control);
2311 ret = app_control_add_extra_data_array(app_control, NULL, array_value, 4);
2313 if(ret != SERVICE_ERROR_NONE)
2315 dts_pass(API_NAME, "passed");
2319 dts_fail(API_NAME, "failed");
2322 app_control_destroy(app_control);
2326 static void utc_app_control_add_extra_data_array_negative2(void)
2328 const char *API_NAME = __FUNCTION__;
2329 int ret = SERVICE_ERROR_NONE;
2331 const char *array_key = "array_key";
2333 app_control_h app_control;
2335 app_control_create(&app_control);
2337 ret = app_control_add_extra_data_array(app_control, array_key, NULL, 4);
2339 if(ret != SERVICE_ERROR_NONE)
2341 dts_pass(API_NAME, "passed");
2345 dts_fail(API_NAME, "failed");
2348 app_control_destroy(app_control);
2351 static void utc_app_control_add_extra_data_array_negative3(void)
2353 const char *API_NAME = __FUNCTION__;
2354 int ret = SERVICE_ERROR_NONE;
2356 const char *array_key = "array_key";
2357 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2359 app_control_h app_control;
2361 app_control_create(&app_control);
2363 ret = app_control_add_extra_data_array(app_control, array_key, array_value, -1);
2365 if(ret != SERVICE_ERROR_NONE)
2367 dts_pass(API_NAME, "passed");
2371 dts_fail(API_NAME, "failed");
2374 app_control_destroy(app_control);
2377 static void utc_app_control_get_extra_data_array_positive(void)
2379 const char *API_NAME = __FUNCTION__;
2380 int ret = SERVICE_ERROR_NONE;
2382 const char *array_key = "array_key";
2383 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2384 int array_length = 4;
2386 char** array_value_out;
2387 int array_length_out;
2389 app_control_h app_control;
2391 app_control_create(&app_control);
2393 app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2395 ret = app_control_get_extra_data_array(app_control, array_key, &array_value_out, &array_length_out);
2397 if(ret == SERVICE_ERROR_NONE && array_length_out == array_length)
2399 dts_pass(API_NAME, "passed");
2403 dts_fail(API_NAME, "failed");
2406 app_control_destroy(app_control);
2409 static void utc_app_control_get_extra_data_array_negative1(void)
2411 const char *API_NAME = __FUNCTION__;
2412 int ret = SERVICE_ERROR_NONE;
2414 const char *array_key = "array_key";
2415 char** array_value_out;
2416 int array_length_out;
2418 app_control_h app_control;
2420 app_control_create(&app_control);
2422 ret = app_control_get_extra_data_array(app_control, array_key, &array_value_out, &array_length_out);
2424 if(ret != SERVICE_ERROR_NONE)
2426 dts_pass(API_NAME, "passed");
2430 dts_fail(API_NAME, "failed");
2433 app_control_destroy(app_control);
2436 static void utc_app_control_get_extra_data_array_negative2(void)
2438 const char *API_NAME = __FUNCTION__;
2439 int ret = SERVICE_ERROR_NONE;
2441 const char *array_key = "array_key";
2442 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2443 int array_length = 4;
2444 char** array_value_out;
2445 int array_length_out;
2447 app_control_h app_control;
2449 app_control_create(&app_control);
2451 app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2453 ret = app_control_get_extra_data_array(NULL, array_key, &array_value_out, &array_length_out);
2455 if(ret != SERVICE_ERROR_NONE)
2457 dts_pass(API_NAME, "passed");
2461 dts_fail(API_NAME, "failed");
2464 app_control_destroy(app_control);
2467 static void utc_app_control_get_extra_data_array_negative3(void)
2469 const char *API_NAME = __FUNCTION__;
2470 int ret = SERVICE_ERROR_NONE;
2472 const char *array_key = "array_key";
2473 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2474 int array_length = 4;
2475 char** array_value_out;
2476 int array_length_out;
2478 app_control_h app_control;
2480 app_control_create(&app_control);
2482 app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2484 ret = app_control_get_extra_data_array(app_control, NULL, &array_value_out, &array_length_out);
2486 if(ret != SERVICE_ERROR_NONE)
2488 dts_pass(API_NAME, "passed");
2492 dts_fail(API_NAME, "failed");
2495 app_control_destroy(app_control);
2498 static void utc_app_control_get_extra_data_array_negative4(void)
2500 const char *API_NAME = __FUNCTION__;
2501 int ret = SERVICE_ERROR_NONE;
2503 const char *array_key = "array_key";
2504 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2505 int array_length = 4;
2506 int array_length_out;
2508 app_control_h app_control;
2510 app_control_create(&app_control);
2512 app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2514 ret = app_control_get_extra_data_array(app_control, array_key, NULL, &array_length_out);
2516 if(ret != SERVICE_ERROR_NONE)
2518 dts_pass(API_NAME, "passed");
2522 dts_fail(API_NAME, "failed");
2525 app_control_destroy(app_control);
2528 static void utc_app_control_get_extra_data_array_negative5(void)
2530 const char *API_NAME = __FUNCTION__;
2531 int ret = SERVICE_ERROR_NONE;
2533 const char *array_key = "array_key";
2534 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2535 int array_length = 4;
2536 char** array_value_out;
2538 app_control_h app_control;
2540 app_control_create(&app_control);
2542 app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2544 ret = app_control_get_extra_data_array(app_control, array_key, &array_value_out, NULL);
2546 if(ret != SERVICE_ERROR_NONE)
2548 dts_pass(API_NAME, "passed");
2552 dts_fail(API_NAME, "failed");
2557 static void utc_app_control_is_extra_data_array_positive(void)
2559 const char *API_NAME = __FUNCTION__;
2560 int ret = SERVICE_ERROR_NONE;
2562 const char *array_key = "array_key";
2563 const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2564 int array_length = 4;
2567 app_control_h app_control;
2569 app_control_create(&app_control);
2571 app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2573 ret = app_control_is_extra_data_array(app_control, array_key, &is_array);
2575 if(ret == SERVICE_ERROR_NONE && is_array == true)
2577 dts_pass(API_NAME, "passed");
2581 dts_fail(API_NAME, "failed");
2584 app_control_destroy(app_control);
2587 static void utc_app_control_is_extra_data_array_negative1(void)
2589 const char *API_NAME = __FUNCTION__;
2590 int ret = SERVICE_ERROR_NONE;
2592 const char *key = "key";
2596 app_control_h app_control;
2598 app_control_create(&app_control);
2600 ret = app_control_is_extra_data_array(app_control, key, &is_array);
2602 if(ret == SERVICE_ERROR_NONE && is_array == false)
2604 dts_pass(API_NAME, "passed");
2608 dts_fail(API_NAME, "failed");
2611 app_control_destroy(app_control);
2614 static void utc_app_control_is_extra_data_array_negative2(void)
2616 const char *API_NAME = __FUNCTION__;
2617 int ret = SERVICE_ERROR_NONE;
2619 const char *key = "key";
2623 app_control_h app_control;
2625 app_control_create(&app_control);
2627 ret = app_control_is_extra_data_array(NULL, key, &is_array);
2629 if(ret != SERVICE_ERROR_NONE)
2631 dts_pass(API_NAME, "passed");
2635 dts_fail(API_NAME, "failed");
2638 app_control_destroy(app_control);
2641 static void utc_app_control_is_extra_data_array_negative3(void)
2643 const char *API_NAME = __FUNCTION__;
2644 int ret = SERVICE_ERROR_NONE;
2648 app_control_h app_control;
2650 app_control_create(&app_control);
2652 ret = app_control_is_extra_data_array(app_control, NULL, &is_array);
2654 if(ret != SERVICE_ERROR_NONE)
2656 dts_pass(API_NAME, "passed");
2660 dts_fail(API_NAME, "failed");
2663 app_control_destroy(app_control);
2666 static void utc_app_control_is_extra_data_array_negative4(void)
2668 const char *API_NAME = __FUNCTION__;
2669 int ret = SERVICE_ERROR_NONE;
2671 const char *key = "key";
2673 app_control_h app_control;
2675 app_control_create(&app_control);
2677 ret = app_control_is_extra_data_array(app_control, key, NULL);
2679 if(ret != SERVICE_ERROR_NONE)
2681 dts_pass(API_NAME, "passed");
2685 dts_fail(API_NAME, "failed");
2688 app_control_destroy(app_control);
2692 static void utc_app_control_is_reply_requested_positive1(void)
2694 const char *API_NAME = __FUNCTION__;
2695 int ret = SERVICE_ERROR_NONE;
2697 app_control_h app_control;
2700 app_control_create(&app_control);
2702 ret = app_control_is_reply_requested(app_control, &requested);
2704 if(ret != SERVICE_ERROR_NONE)
2706 dts_pass(API_NAME, "passed");
2710 dts_fail(API_NAME, "failed");
2713 app_control_destroy(app_control);
2717 static void utc_app_control_is_reply_requested_negative1(void)
2719 const char *API_NAME = __FUNCTION__;
2720 int ret = SERVICE_ERROR_NONE;
2722 app_control_h app_control;
2724 app_control_create(&app_control);
2726 ret = app_control_is_reply_requested(app_control, NULL);
2728 if(ret != SERVICE_ERROR_NONE)
2730 dts_pass(API_NAME, "passed");
2734 dts_fail(API_NAME, "failed");
2737 app_control_destroy(app_control);
2741 static void utc_app_control_is_reply_requested_negative2(void)
2743 const char *API_NAME = __FUNCTION__;
2744 int ret = SERVICE_ERROR_NONE;
2746 bool requsted = false;
2748 ret = app_control_is_reply_requested(NULL, &requsted);
2750 if(ret != SERVICE_ERROR_NONE)
2752 dts_pass(API_NAME, "passed");
2756 dts_fail(API_NAME, "failed");
2760 static void utc_app_control_is_reply_requested_negative3(void)
2762 const char *API_NAME = __FUNCTION__;
2763 int ret = SERVICE_ERROR_NONE;
2765 ret = app_control_is_reply_requested(NULL, NULL);
2767 if(ret != SERVICE_ERROR_NONE)
2769 dts_pass(API_NAME, "passed");
2773 dts_fail(API_NAME, "failed");
2778 static void utc_app_control_get_caller_positive1(void)
2780 const char *API_NAME = __FUNCTION__;
2781 int ret = SERVICE_ERROR_NONE;
2783 app_control_h app_control;
2786 app_control_create(&app_control);
2788 ret = app_control_get_caller(app_control, &caller);
2790 if(ret != SERVICE_ERROR_NONE)
2792 dts_pass(API_NAME, "passed");
2796 dts_fail(API_NAME, "failed");
2799 app_control_destroy(app_control);
2803 static void utc_app_control_get_caller_negative1(void)
2805 const char *API_NAME = __FUNCTION__;
2806 int ret = SERVICE_ERROR_NONE;
2808 app_control_h app_control;
2810 app_control_create(&app_control);
2812 ret = app_control_get_caller(app_control, NULL);
2814 if(ret != SERVICE_ERROR_NONE)
2816 dts_pass(API_NAME, "passed");
2820 dts_fail(API_NAME, "failed");
2823 app_control_destroy(app_control);
2827 static void utc_app_control_get_caller_negative2(void)
2829 const char *API_NAME = __FUNCTION__;
2830 int ret = SERVICE_ERROR_NONE;
2832 char *caller = NULL;
2834 ret = app_control_get_caller(NULL, &caller);
2836 if(ret != SERVICE_ERROR_NONE)
2838 dts_pass(API_NAME, "passed");
2842 dts_fail(API_NAME, "failed");
2846 static void utc_app_control_get_caller_negative3(void)
2848 const char *API_NAME = __FUNCTION__;
2849 int ret = SERVICE_ERROR_NONE;
2851 ret = app_control_get_caller(NULL, NULL);
2853 if(ret != SERVICE_ERROR_NONE)
2855 dts_pass(API_NAME, "passed");
2859 dts_fail(API_NAME, "failed");
2863 static void utc_app_control_to_bundle_positive1(void)
2865 const char *API_NAME = __FUNCTION__;
2866 int ret = SERVICE_ERROR_NONE;
2867 app_control_h app_control;
2869 const char *input_value = "INPUT_VALUE";
2871 app_control_create(&app_control);
2873 ret = app_control_set_package(app_control, input_value);
2875 ret = app_control_to_bundle(app_control, &data);
2877 if(ret == SERVICE_ERROR_NONE)
2879 dts_pass(API_NAME, "passed");
2883 dts_fail(API_NAME, "failed");
2886 app_control_destroy(app_control);
2890 static void utc_app_control_to_bundle_negative1(void)
2892 const char *API_NAME = __FUNCTION__;
2893 int ret = SERVICE_ERROR_NONE;
2895 app_control_h app_control;
2897 app_control_create(&app_control);
2899 ret = app_control_to_bundle(app_control, NULL);
2901 if(ret != SERVICE_ERROR_NONE)
2903 dts_pass(API_NAME, "passed");
2907 dts_fail(API_NAME, "failed");
2910 app_control_destroy(app_control);
2914 static void utc_app_control_to_bundle_negative2(void)
2916 const char *API_NAME = __FUNCTION__;
2917 int ret = SERVICE_ERROR_NONE;
2919 bundle *data = NULL;
2921 ret = app_control_to_bundle(NULL, &data);
2923 if(ret != SERVICE_ERROR_NONE)
2925 dts_pass(API_NAME, "passed");
2929 dts_fail(API_NAME, "failed");
2933 static void utc_app_control_to_bundle_negative3(void)
2935 const char *API_NAME = __FUNCTION__;
2936 int ret = SERVICE_ERROR_NONE;
2938 ret = app_control_to_bundle(NULL, NULL);
2940 if(ret != SERVICE_ERROR_NONE)
2942 dts_pass(API_NAME, "passed");
2946 dts_fail(API_NAME, "failed");