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.
23 static void startup(void);
24 static void cleanup(void);
26 void (*tet_startup)(void) = startup;
27 void (*tet_cleanup)(void) = cleanup;
29 static void utc_notification_create_positive(void);
30 static void utc_notification_create_negative(void);
32 static void utc_notification_create_ongoing_positive(void);
33 static void utc_notification_create_ongoing_negative(void);
35 static void utc_notification_destroy_positive(void);
36 static void utc_notification_destroy_negative(void);
38 static void utc_notification_is_ongoing_positive1(void);
39 static void utc_notification_is_ongoing_positive2(void);
40 static void utc_notification_is_ongoing_negative1(void);
41 static void utc_notification_is_ongoing_negative2(void);
43 static void utc_notification_set_icon_positive1(void);
44 static void utc_notification_set_icon_positive2(void);
45 static void utc_notification_set_icon_negative1(void);
47 static void utc_notification_get_icon_positive(void);
48 static void utc_notification_get_icon_negative1(void);
49 static void utc_notification_get_icon_negative2(void);
51 static void utc_notification_set_time_positive1(void);
52 static void utc_notification_set_time_positive2(void);
53 static void utc_notification_set_time_negative1(void);
55 static void utc_notification_get_time_positive(void);
56 static void utc_notification_get_time_negative1(void);
57 static void utc_notification_get_time_negative2(void);
59 static void utc_notification_set_title_positive1(void);
60 static void utc_notification_set_title_positive2(void);
61 static void utc_notification_set_title_negative1(void);
63 static void utc_notification_get_title_positive(void);
64 static void utc_notification_get_title_negative1(void);
65 static void utc_notification_get_title_negative2(void);
67 static void utc_notification_set_content_positive1(void);
68 static void utc_notification_set_content_positive2(void);
69 static void utc_notification_set_content_negative1(void);
71 static void utc_notification_get_content_positive(void);
72 static void utc_notification_get_content_negative1(void);
73 static void utc_notification_get_content_negative2(void);
75 static void utc_notification_set_service_positive1(void);
76 static void utc_notification_set_service_positive2(void);
77 static void utc_notification_set_service_negative1(void);
79 static void utc_notification_get_service_positive(void);
80 static void utc_notification_get_service_negative1(void);
81 static void utc_notification_get_service_negative2(void);
83 static void utc_notification_set_sound_positive1(void);
84 static void utc_notification_set_sound_positive2(void);
85 static void utc_notification_set_sound_negative1(void);
87 static void utc_notification_get_sound_positive(void);
88 static void utc_notification_get_sound_negative1(void);
89 static void utc_notification_get_sound_negative2(void);
91 static void utc_notification_set_vibration_positive1(void);
92 static void utc_notification_set_vibration_positive2(void);
93 static void utc_notification_set_vibration_negative1(void);
95 static void utc_notification_get_vibration_positive(void);
96 static void utc_notification_get_vibration_negative1(void);
97 static void utc_notification_get_vibration_negative2(void);
99 static void utc_notification_post_negative1(void);
101 static void utc_notification_cancel_negative1(void);
103 static void utc_notification_cancel_all_positive(void);
105 static void utc_notification_cancel_all_by_type_positive1(void);
106 static void utc_notification_cancel_all_by_type_positive2(void);
108 static void utc_notification_update_negative1(void);
110 static void utc_notification_update_progress_negative1(void);
112 static void utc_notification_foreach_notification_posted_positive1(void);
113 static void utc_notification_foreach_notification_posted_positive2(void);
114 static void utc_notification_foreach_notification_posted_negative1(void);
115 static void utc_notification_foreach_notification_posted_negative2(void);
117 static void utc_notification_clone_positive1(void);
118 static void utc_notification_clone_positive2(void);
119 static void utc_notification_clone_positive3(void);
120 static void utc_notification_clone_positive4(void);
121 static void utc_notification_clone_negative1(void);
122 static void utc_notification_clone_negative2(void);
124 struct tet_testlist tet_testlist[] = {
125 {utc_notification_create_positive, 1},
126 {utc_notification_create_negative, 1},
127 {utc_notification_create_ongoing_positive, 1},
128 {utc_notification_create_ongoing_negative, 1},
129 {utc_notification_destroy_positive, 1},
130 {utc_notification_destroy_negative, 1},
131 {utc_notification_is_ongoing_positive1, 1},
132 {utc_notification_is_ongoing_positive2, 1},
133 {utc_notification_is_ongoing_negative1, 1},
134 {utc_notification_is_ongoing_negative2, 1},
135 {utc_notification_set_icon_positive1, 1},
136 {utc_notification_set_icon_positive2, 1},
137 {utc_notification_set_icon_negative1, 1},
138 {utc_notification_get_icon_positive, 1},
139 {utc_notification_get_icon_negative1, 1},
140 {utc_notification_get_icon_negative2, 1},
141 {utc_notification_set_time_positive1, 1},
142 {utc_notification_set_time_positive2, 1},
143 {utc_notification_set_time_negative1, 1},
144 {utc_notification_get_time_positive, 1},
145 {utc_notification_get_time_negative1, 1},
146 {utc_notification_get_time_negative2, 1},
147 {utc_notification_set_title_positive1, 1},
148 {utc_notification_set_title_positive2, 1},
149 {utc_notification_set_title_negative1, 1},
150 {utc_notification_get_title_positive, 1},
151 {utc_notification_get_title_negative1, 1},
152 {utc_notification_get_title_negative2, 1},
153 {utc_notification_set_content_positive1, 1},
154 {utc_notification_set_content_positive2, 1},
155 {utc_notification_set_content_negative1, 1},
156 {utc_notification_get_content_positive, 1},
157 {utc_notification_get_content_negative1, 1},
158 {utc_notification_get_content_negative2, 1},
159 {utc_notification_set_service_positive1, 1},
160 {utc_notification_set_service_positive2, 1},
161 {utc_notification_set_service_negative1, 1},
162 {utc_notification_get_service_positive, 1},
163 {utc_notification_get_service_negative1, 1},
164 {utc_notification_get_service_negative2, 1},
165 {utc_notification_set_sound_positive1, 1},
166 {utc_notification_set_sound_positive2, 1},
167 {utc_notification_set_sound_negative1, 1},
168 {utc_notification_get_sound_positive, 1},
169 {utc_notification_get_sound_negative1, 1},
170 {utc_notification_get_sound_negative2, 1},
171 {utc_notification_set_vibration_positive1, 1},
172 {utc_notification_set_vibration_positive2, 1},
173 {utc_notification_set_vibration_negative1, 1},
174 {utc_notification_get_vibration_positive, 1},
175 {utc_notification_get_vibration_negative1, 1},
176 {utc_notification_get_vibration_negative2, 1},
177 {utc_notification_post_negative1, 1},
178 {utc_notification_cancel_negative1, 1},
179 {utc_notification_cancel_all_positive, 1},
180 {utc_notification_cancel_all_by_type_positive1, 1},
181 {utc_notification_cancel_all_by_type_positive2, 1},
182 {utc_notification_update_negative1, 1},
183 {utc_notification_update_progress_negative1, 1},
184 {utc_notification_foreach_notification_posted_positive1, 1},
185 {utc_notification_foreach_notification_posted_positive2, 1},
186 {utc_notification_foreach_notification_posted_negative1, 1},
187 {utc_notification_foreach_notification_posted_negative2, 1},
188 {utc_notification_clone_positive1, 1},
189 {utc_notification_clone_positive2, 1},
190 {utc_notification_clone_positive3, 1},
191 {utc_notification_clone_positive4, 1},
192 {utc_notification_clone_negative1, 1},
193 {utc_notification_clone_negative2, 1},
197 static void startup(void)
203 static void cleanup(void)
208 static void utc_notification_create_positive(void)
210 const char *API_NAME = __FUNCTION__;
211 int retcode = UI_NOTIFICATION_ERROR_NONE;
213 ui_notification_h notification;
215 retcode = ui_notification_create(false, ¬ification);
217 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
218 dts_pass(API_NAME, "passed");
220 dts_fail(API_NAME, "failed");
224 static void utc_notification_create_negative(void)
226 const char *API_NAME = __FUNCTION__;
227 int retcode = UI_NOTIFICATION_ERROR_NONE;
229 retcode = ui_notification_create(false, NULL);
231 if (retcode != UI_NOTIFICATION_ERROR_NONE) {
232 dts_pass(API_NAME, "passed");
234 dts_fail(API_NAME, "failed");
238 static void utc_notification_create_ongoing_positive(void)
240 const char *API_NAME = __FUNCTION__;
241 int retcode = UI_NOTIFICATION_ERROR_NONE;
243 ui_notification_h notification;
245 retcode = ui_notification_create(true, ¬ification);
247 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
248 dts_pass(API_NAME, "passed");
250 dts_fail(API_NAME, "failed");
254 static void utc_notification_create_ongoing_negative(void)
256 const char *API_NAME = __FUNCTION__;
257 int retcode = UI_NOTIFICATION_ERROR_NONE;
259 retcode = ui_notification_create(true, NULL);
261 if (retcode != UI_NOTIFICATION_ERROR_NONE) {
262 dts_pass(API_NAME, "passed");
264 dts_fail(API_NAME, "failed");
268 static void utc_notification_destroy_positive(void)
270 const char *API_NAME = __FUNCTION__;
271 int retcode = UI_NOTIFICATION_ERROR_NONE;
273 ui_notification_h notification;
275 ui_notification_create(true, ¬ification);
277 retcode = ui_notification_destroy(notification);
279 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
280 dts_pass(API_NAME, "passed");
282 dts_fail(API_NAME, "failed");
286 static void utc_notification_destroy_negative(void)
288 const char *API_NAME = __FUNCTION__;
289 int retcode = UI_NOTIFICATION_ERROR_NONE;
291 retcode = ui_notification_destroy(NULL);
293 if (retcode != UI_NOTIFICATION_ERROR_NONE) {
294 dts_pass(API_NAME, "passed");
296 dts_fail(API_NAME, "failed");
300 static void utc_notification_is_ongoing_positive1()
302 const char *API_NAME = __FUNCTION__;
303 int retcode = UI_NOTIFICATION_ERROR_NONE;
305 ui_notification_h notification;
308 ui_notification_create(true, ¬ification);
310 retcode = ui_notification_is_ongoing(notification, &value);
312 if (retcode == UI_NOTIFICATION_ERROR_NONE && value == true) {
313 dts_pass(API_NAME, "passed");
315 dts_fail(API_NAME, "failed");
319 static void utc_notification_is_ongoing_positive2()
321 const char *API_NAME = __FUNCTION__;
322 int retcode = UI_NOTIFICATION_ERROR_NONE;
324 ui_notification_h notification;
327 ui_notification_create(false, ¬ification);
329 retcode = ui_notification_is_ongoing(notification, &value);
331 if (retcode == UI_NOTIFICATION_ERROR_NONE && value == false) {
332 dts_pass(API_NAME, "passed");
334 dts_fail(API_NAME, "failed");
338 static void utc_notification_is_ongoing_negative1()
340 const char *API_NAME = __FUNCTION__;
341 int retcode = UI_NOTIFICATION_ERROR_NONE;
343 ui_notification_h notification;
345 ui_notification_create(true, ¬ification);
347 retcode = ui_notification_is_ongoing(notification, NULL);
349 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
350 dts_pass(API_NAME, "passed");
352 dts_fail(API_NAME, "failed");
356 static void utc_notification_is_ongoing_negative2()
358 const char *API_NAME = __FUNCTION__;
359 int retcode = UI_NOTIFICATION_ERROR_NONE;
361 ui_notification_h notification;
364 retcode = ui_notification_is_ongoing(NULL, &value);
366 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
367 dts_pass(API_NAME, "passed");
369 dts_fail(API_NAME, "failed");
373 static void utc_notification_set_icon_positive1(void)
375 const char *API_NAME = __FUNCTION__;
376 int retcode = UI_NOTIFICATION_ERROR_NONE;
378 ui_notification_h notification;
380 ui_notification_create(false, ¬ification);
382 retcode = ui_notification_set_icon(notification, "ICON");
384 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
385 dts_pass(API_NAME, "passed");
387 dts_fail(API_NAME, "failed");
391 static void utc_notification_set_icon_positive2(void)
393 const char *API_NAME = __FUNCTION__;
394 int retcode = UI_NOTIFICATION_ERROR_NONE;
396 ui_notification_h notification;
398 ui_notification_create(false, ¬ification);
400 ui_notification_set_icon(notification, "ICON");
402 retcode = ui_notification_set_icon(notification, NULL);
404 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
405 dts_pass(API_NAME, "passed");
407 dts_fail(API_NAME, "failed");
411 static void utc_notification_set_icon_negative1(void)
413 const char *API_NAME = __FUNCTION__;
414 int retcode = UI_NOTIFICATION_ERROR_NONE;
416 retcode = ui_notification_set_icon(NULL, "ICON");
418 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
419 dts_pass(API_NAME, "passed");
421 dts_fail(API_NAME, "failed");
425 static void utc_notification_get_icon_positive(void)
427 const char *API_NAME = __FUNCTION__;
428 int retcode = UI_NOTIFICATION_ERROR_NONE;
430 ui_notification_h notification;
433 ui_notification_create(false, ¬ification);
435 ui_notification_set_icon(notification, "ICON");
437 retcode = ui_notification_get_icon(notification, &value);
439 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
440 dts_pass(API_NAME, "passed");
442 dts_fail(API_NAME, "failed");
446 static void utc_notification_get_icon_negative1(void)
448 const char *API_NAME = __FUNCTION__;
449 int retcode = UI_NOTIFICATION_ERROR_NONE;
453 retcode = ui_notification_get_icon(NULL, &value);
455 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
456 dts_pass(API_NAME, "passed");
458 dts_fail(API_NAME, "failed");
462 static void utc_notification_get_icon_negative2(void)
464 const char *API_NAME = __FUNCTION__;
465 int retcode = UI_NOTIFICATION_ERROR_NONE;
467 ui_notification_h notification;
469 ui_notification_create(false, ¬ification);
471 ui_notification_set_icon(notification, "ICON");
473 retcode = ui_notification_get_icon(notification, NULL);
475 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
476 dts_pass(API_NAME, "passed");
478 dts_fail(API_NAME, "failed");
482 static void utc_notification_set_time_positive1(void)
484 const char *API_NAME = __FUNCTION__;
485 int retcode = UI_NOTIFICATION_ERROR_NONE;
487 ui_notification_h notification;
491 ui_notification_create(false, ¬ification);
494 localtime_r(&t, &tm_t);
496 retcode = ui_notification_set_time(notification, &tm_t);
498 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
499 dts_pass(API_NAME, "passed");
501 dts_fail(API_NAME, "failed");
505 static void utc_notification_set_time_positive2(void)
507 const char *API_NAME = __FUNCTION__;
508 int retcode = UI_NOTIFICATION_ERROR_NONE;
510 ui_notification_h notification;
514 ui_notification_create(false, ¬ification);
517 localtime_r(&t, &tm_t);
519 ui_notification_set_time(notification, &tm_t);
521 retcode = ui_notification_set_time(notification, NULL);
523 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
524 dts_pass(API_NAME, "passed");
526 dts_fail(API_NAME, "failed");
530 static void utc_notification_set_time_negative1(void)
532 const char *API_NAME = __FUNCTION__;
533 int retcode = UI_NOTIFICATION_ERROR_NONE;
539 localtime_r(&t, &tm_t);
541 retcode = ui_notification_set_time(NULL, NULL);
543 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
544 dts_pass(API_NAME, "passed");
546 dts_fail(API_NAME, "failed");
550 static void utc_notification_get_time_positive(void)
552 const char *API_NAME = __FUNCTION__;
553 int retcode = UI_NOTIFICATION_ERROR_NONE;
555 ui_notification_h notification;
560 ui_notification_create(false, ¬ification);
563 localtime_r(&t, &tm_t);
565 ui_notification_set_time(notification, &tm_t);
567 retcode = ui_notification_get_time(notification, &value);
569 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
570 dts_pass(API_NAME, "passed");
572 dts_fail(API_NAME, "failed");
576 static void utc_notification_get_time_negative1(void)
578 const char *API_NAME = __FUNCTION__;
579 int retcode = UI_NOTIFICATION_ERROR_NONE;
583 retcode = ui_notification_get_time(NULL, &value);
585 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
586 dts_pass(API_NAME, "passed");
588 dts_fail(API_NAME, "failed");
592 static void utc_notification_get_time_negative2(void)
594 const char *API_NAME = __FUNCTION__;
595 int retcode = UI_NOTIFICATION_ERROR_NONE;
597 ui_notification_h notification;
601 ui_notification_create(false, ¬ification);
604 localtime_r(&t, &tm_t);
606 ui_notification_set_time(notification, &tm_t);
608 retcode = ui_notification_get_time(notification, NULL);
610 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
611 dts_pass(API_NAME, "passed");
613 dts_fail(API_NAME, "failed");
617 static void utc_notification_set_title_positive1(void)
619 const char *API_NAME = __FUNCTION__;
620 int retcode = UI_NOTIFICATION_ERROR_NONE;
622 ui_notification_h notification;
624 ui_notification_create(false, ¬ification);
626 retcode = ui_notification_set_title(notification, "TITLE");
628 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
629 dts_pass(API_NAME, "passed");
631 dts_fail(API_NAME, "failed");
635 static void utc_notification_set_title_positive2(void)
637 const char *API_NAME = __FUNCTION__;
638 int retcode = UI_NOTIFICATION_ERROR_NONE;
640 ui_notification_h notification;
642 ui_notification_create(false, ¬ification);
644 ui_notification_set_title(notification, "TITLE");
646 retcode = ui_notification_set_title(notification, NULL);
648 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
649 dts_pass(API_NAME, "passed");
651 dts_fail(API_NAME, "failed");
655 static void utc_notification_set_title_negative1(void)
657 const char *API_NAME = __FUNCTION__;
658 int retcode = UI_NOTIFICATION_ERROR_NONE;
660 retcode = ui_notification_set_title(NULL, "TITLE");
662 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
663 dts_pass(API_NAME, "passed");
665 dts_fail(API_NAME, "failed");
669 static void utc_notification_get_title_positive(void)
671 const char *API_NAME = __FUNCTION__;
672 int retcode = UI_NOTIFICATION_ERROR_NONE;
674 ui_notification_h notification;
677 ui_notification_create(false, ¬ification);
679 ui_notification_set_title(notification, "TITLE");
681 retcode = ui_notification_get_title(notification, &value);
683 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
684 dts_pass(API_NAME, "passed");
686 dts_fail(API_NAME, "failed");
690 static void utc_notification_get_title_negative1(void)
692 const char *API_NAME = __FUNCTION__;
693 int retcode = UI_NOTIFICATION_ERROR_NONE;
697 retcode = ui_notification_get_title(NULL, &value);
699 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
700 dts_pass(API_NAME, "passed");
702 dts_fail(API_NAME, "failed");
706 static void utc_notification_get_title_negative2(void)
708 const char *API_NAME = __FUNCTION__;
709 int retcode = UI_NOTIFICATION_ERROR_NONE;
711 ui_notification_h notification;
713 ui_notification_create(false, ¬ification);
715 ui_notification_set_title(notification, "TITLE");
717 retcode = ui_notification_get_title(notification, NULL);
719 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
720 dts_pass(API_NAME, "passed");
722 dts_fail(API_NAME, "failed");
726 static void utc_notification_set_content_positive1(void)
728 const char *API_NAME = __FUNCTION__;
729 int retcode = UI_NOTIFICATION_ERROR_NONE;
731 ui_notification_h notification;
733 ui_notification_create(false, ¬ification);
735 retcode = ui_notification_set_content(notification, "CONTENT");
737 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
738 dts_pass(API_NAME, "passed");
740 dts_fail(API_NAME, "failed");
744 static void utc_notification_set_content_positive2(void)
746 const char *API_NAME = __FUNCTION__;
747 int retcode = UI_NOTIFICATION_ERROR_NONE;
749 ui_notification_h notification;
751 ui_notification_create(false, ¬ification);
753 ui_notification_set_content(notification, "CONTENT");
755 retcode = ui_notification_set_content(notification, NULL);
757 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
758 dts_pass(API_NAME, "passed");
760 dts_fail(API_NAME, "failed");
764 static void utc_notification_set_content_negative1(void)
766 const char *API_NAME = __FUNCTION__;
767 int retcode = UI_NOTIFICATION_ERROR_NONE;
769 retcode = ui_notification_set_content(NULL, "CONTENT");
771 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
772 dts_pass(API_NAME, "passed");
774 dts_fail(API_NAME, "failed");
778 static void utc_notification_get_content_positive(void)
780 const char *API_NAME = __FUNCTION__;
781 int retcode = UI_NOTIFICATION_ERROR_NONE;
783 ui_notification_h notification;
786 ui_notification_create(false, ¬ification);
788 ui_notification_set_content(notification, "CONTENT");
790 retcode = ui_notification_get_content(notification, &value);
792 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
793 dts_pass(API_NAME, "passed");
795 dts_fail(API_NAME, "failed");
799 static void utc_notification_get_content_negative1(void)
801 const char *API_NAME = __FUNCTION__;
802 int retcode = UI_NOTIFICATION_ERROR_NONE;
806 retcode = ui_notification_get_content(NULL, &value);
808 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
809 dts_pass(API_NAME, "passed");
811 dts_fail(API_NAME, "failed");
815 static void utc_notification_get_content_negative2(void)
817 const char *API_NAME = __FUNCTION__;
818 int retcode = UI_NOTIFICATION_ERROR_NONE;
820 ui_notification_h notification;
822 ui_notification_create(false, ¬ification);
824 ui_notification_set_content(notification, "CONTENT");
826 retcode = ui_notification_get_content(notification, NULL);
828 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
829 dts_pass(API_NAME, "passed");
831 dts_fail(API_NAME, "failed");
835 static void utc_notification_set_service_positive1(void)
837 const char *API_NAME = __FUNCTION__;
838 int retcode = UI_NOTIFICATION_ERROR_NONE;
840 ui_notification_h notification;
843 ui_notification_create(false, ¬ification);
845 service_create(&service);
847 retcode = ui_notification_set_service(notification, service);
849 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
850 dts_pass(API_NAME, "passed");
852 dts_fail(API_NAME, "failed");
856 static void utc_notification_set_service_positive2(void)
858 const char *API_NAME = __FUNCTION__;
859 int retcode = UI_NOTIFICATION_ERROR_NONE;
861 ui_notification_h notification;
864 ui_notification_create(false, ¬ification);
866 service_create(&service);
868 ui_notification_set_service(notification, service);
870 retcode = ui_notification_set_service(notification, NULL);
872 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
873 dts_pass(API_NAME, "passed");
875 dts_fail(API_NAME, "failed");
879 static void utc_notification_set_service_negative1(void)
881 const char *API_NAME = __FUNCTION__;
882 int retcode = UI_NOTIFICATION_ERROR_NONE;
885 service_create(&service);
887 retcode = ui_notification_set_service(NULL, service);
889 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
890 dts_pass(API_NAME, "passed");
892 dts_fail(API_NAME, "failed");
896 static void utc_notification_get_service_positive(void)
898 const char *API_NAME = __FUNCTION__;
899 int retcode = UI_NOTIFICATION_ERROR_NONE;
901 ui_notification_h notification;
905 ui_notification_create(false, ¬ification);
907 service_create(&service);
909 ui_notification_set_service(notification, service);
911 retcode = ui_notification_get_service(notification, &value);
913 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
914 dts_pass(API_NAME, "passed");
916 dts_fail(API_NAME, "failed");
920 static void utc_notification_get_service_negative1(void)
922 const char *API_NAME = __FUNCTION__;
923 int retcode = UI_NOTIFICATION_ERROR_NONE;
927 retcode = ui_notification_get_service(NULL, &value);
929 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
930 dts_pass(API_NAME, "passed");
932 dts_fail(API_NAME, "failed");
936 static void utc_notification_get_service_negative2(void)
938 const char *API_NAME = __FUNCTION__;
939 int retcode = UI_NOTIFICATION_ERROR_NONE;
941 ui_notification_h notification;
944 ui_notification_create(false, ¬ification);
946 service_create(&service);
948 ui_notification_set_service(notification, service);
950 retcode = ui_notification_get_service(notification, NULL);
952 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
953 dts_pass(API_NAME, "passed");
955 dts_fail(API_NAME, "failed");
959 static void utc_notification_set_sound_positive1(void)
961 const char *API_NAME = __FUNCTION__;
962 int retcode = UI_NOTIFICATION_ERROR_NONE;
964 ui_notification_h notification;
966 ui_notification_create(false, ¬ification);
968 retcode = ui_notification_set_sound(notification, "/usr/share/svi/sound/operation/new_chat.wav");
970 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
971 dts_pass(API_NAME, "passed");
973 dts_fail(API_NAME, "failed");
977 static void utc_notification_set_sound_positive2(void)
979 const char *API_NAME = __FUNCTION__;
980 int retcode = UI_NOTIFICATION_ERROR_NONE;
982 ui_notification_h notification;
984 ui_notification_create(false, ¬ification);
986 ui_notification_set_sound(notification, "/usr/share/svi/sound/operation/new_chat.wav");
988 retcode = ui_notification_set_sound(notification, NULL);
990 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
991 dts_pass(API_NAME, "passed");
993 dts_fail(API_NAME, "failed");
997 static void utc_notification_set_sound_negative1(void)
999 const char *API_NAME = __FUNCTION__;
1000 int retcode = UI_NOTIFICATION_ERROR_NONE;
1002 retcode = ui_notification_set_sound(NULL, "/usr/share/svi/sound/operation/new_chat.wav");
1004 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1005 dts_pass(API_NAME, "passed");
1007 dts_fail(API_NAME, "failed");
1011 static void utc_notification_get_sound_positive(void)
1013 const char *API_NAME = __FUNCTION__;
1014 int retcode = UI_NOTIFICATION_ERROR_NONE;
1016 ui_notification_h notification;
1019 ui_notification_create(false, ¬ification);
1021 ui_notification_set_sound(notification, "/usr/share/svi/sound/operation/new_chat.wav");
1023 retcode = ui_notification_get_sound(notification, &value);
1025 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1026 dts_pass(API_NAME, "passed");
1028 dts_fail(API_NAME, "failed");
1032 static void utc_notification_get_sound_negative1(void)
1034 const char *API_NAME = __FUNCTION__;
1035 int retcode = UI_NOTIFICATION_ERROR_NONE;
1039 retcode = ui_notification_get_sound(NULL, &value);
1041 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1042 dts_pass(API_NAME, "passed");
1044 dts_fail(API_NAME, "failed");
1048 static void utc_notification_get_sound_negative2(void)
1050 const char *API_NAME = __FUNCTION__;
1051 int retcode = UI_NOTIFICATION_ERROR_NONE;
1053 ui_notification_h notification;
1055 ui_notification_create(false, ¬ification);
1057 ui_notification_set_sound(notification, "/usr/share/svi/sound/operation/new_chat.wav");
1059 retcode = ui_notification_get_sound(notification, NULL);
1061 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1062 dts_pass(API_NAME, "passed");
1064 dts_fail(API_NAME, "failed");
1068 static void utc_notification_set_vibration_positive1(void)
1070 const char *API_NAME = __FUNCTION__;
1071 int retcode = UI_NOTIFICATION_ERROR_NONE;
1073 ui_notification_h notification;
1075 ui_notification_create(false, ¬ification);
1077 retcode = ui_notification_set_vibration(notification, true);
1079 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1080 dts_pass(API_NAME, "passed");
1082 dts_fail(API_NAME, "failed");
1086 static void utc_notification_set_vibration_positive2(void)
1088 const char *API_NAME = __FUNCTION__;
1089 int retcode = UI_NOTIFICATION_ERROR_NONE;
1091 ui_notification_h notification;
1093 ui_notification_create(false, ¬ification);
1095 ui_notification_set_vibration(notification, true);
1097 retcode = ui_notification_set_vibration(notification, false);
1099 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1100 dts_pass(API_NAME, "passed");
1102 dts_fail(API_NAME, "failed");
1106 static void utc_notification_set_vibration_negative1(void)
1108 const char *API_NAME = __FUNCTION__;
1109 int retcode = UI_NOTIFICATION_ERROR_NONE;
1111 retcode = ui_notification_set_vibration(NULL, false);
1113 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1114 dts_pass(API_NAME, "passed");
1116 dts_fail(API_NAME, "failed");
1120 static void utc_notification_get_vibration_positive(void)
1122 const char *API_NAME = __FUNCTION__;
1123 int retcode = UI_NOTIFICATION_ERROR_NONE;
1125 ui_notification_h notification;
1128 ui_notification_create(false, ¬ification);
1130 ui_notification_set_vibration(notification, true);
1132 retcode = ui_notification_get_vibration(notification, &value);
1134 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1135 dts_pass(API_NAME, "passed");
1137 dts_fail(API_NAME, "failed");
1141 static void utc_notification_get_vibration_negative1(void)
1143 const char *API_NAME = __FUNCTION__;
1144 int retcode = UI_NOTIFICATION_ERROR_NONE;
1148 retcode = ui_notification_get_vibration(NULL, &value);
1150 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1151 dts_pass(API_NAME, "passed");
1153 dts_fail(API_NAME, "failed");
1157 static void utc_notification_get_vibration_negative2(void)
1159 const char *API_NAME = __FUNCTION__;
1160 int retcode = UI_NOTIFICATION_ERROR_NONE;
1162 ui_notification_h notification;
1164 ui_notification_create(false, ¬ification);
1166 ui_notification_set_vibration(notification, true);
1168 retcode = ui_notification_get_vibration(notification, NULL);
1170 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1171 dts_pass(API_NAME, "passed");
1173 dts_fail(API_NAME, "failed");
1177 static void utc_notification_post_negative1(void)
1179 const const char *API_NAME = __FUNCTION__;
1180 int retcode = UI_NOTIFICATION_ERROR_NONE;
1182 retcode = ui_notification_post(NULL);
1184 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1185 dts_pass(API_NAME, "passed");
1187 dts_fail(API_NAME, "failed");
1191 static void utc_notification_cancel_negative1(void)
1193 const const char *API_NAME = __FUNCTION__;
1194 int retcode = UI_NOTIFICATION_ERROR_NONE;
1196 retcode = ui_notification_cancel(NULL);
1198 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1199 dts_pass(API_NAME, "passed");
1201 dts_fail(API_NAME, "failed");
1205 static void utc_notification_cancel_all_positive(void)
1207 const const char *API_NAME = __FUNCTION__;
1209 ui_notification_cancel_all();
1211 dts_pass(API_NAME, "passed");
1214 static void utc_notification_cancel_all_by_type_positive1(void)
1216 const const char *API_NAME = __FUNCTION__;
1218 ui_notification_cancel_all_by_type(false);
1220 dts_pass(API_NAME, "passed");
1223 static void utc_notification_cancel_all_by_type_positive2(void)
1225 const const char *API_NAME = __FUNCTION__;
1227 ui_notification_cancel_all_by_type(true);
1229 dts_pass(API_NAME, "passed");
1232 static void utc_notification_update_negative1(void)
1234 const const char *API_NAME = __FUNCTION__;
1235 int retcode = UI_NOTIFICATION_ERROR_NONE;
1237 retcode = ui_notification_update(NULL);
1239 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1240 dts_pass(API_NAME, "passed");
1242 dts_fail(API_NAME, "failed");
1246 static void utc_notification_update_progress_negative1(void)
1248 const const char *API_NAME = __FUNCTION__;
1249 int retcode = UI_NOTIFICATION_ERROR_NONE;
1251 retcode = ui_notification_update_progress(NULL, UI_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE, 0);
1253 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1254 dts_pass(API_NAME, "passed");
1256 dts_fail(API_NAME, "failed");
1260 static bool utc_ui_notification_cb(ui_notification_h notification, void *user_data)
1265 static void utc_notification_foreach_notification_posted_positive1(void)
1267 const char *API_NAME = __FUNCTION__;
1268 int retcode = UI_NOTIFICATION_ERROR_NONE;
1270 retcode = ui_notification_foreach_notification_posted(true, utc_ui_notification_cb, NULL);
1272 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1273 dts_pass(API_NAME, "passed");
1275 dts_fail(API_NAME, "failed");
1279 static void utc_notification_foreach_notification_posted_positive2(void)
1281 const char *API_NAME = __FUNCTION__;
1282 int retcode = UI_NOTIFICATION_ERROR_NONE;
1284 retcode = ui_notification_foreach_notification_posted(false, utc_ui_notification_cb, NULL);
1286 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1287 dts_pass(API_NAME, "passed");
1289 dts_fail(API_NAME, "failed");
1293 static void utc_notification_foreach_notification_posted_negative1(void)
1295 const const char *API_NAME = __FUNCTION__;
1296 int retcode = UI_NOTIFICATION_ERROR_NONE;
1298 retcode = ui_notification_foreach_notification_posted(true, NULL, NULL);
1300 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1301 dts_pass(API_NAME, "passed");
1303 dts_fail(API_NAME, "failed");
1307 static void utc_notification_foreach_notification_posted_negative2(void)
1309 const const char *API_NAME = __FUNCTION__;
1310 int retcode = UI_NOTIFICATION_ERROR_NONE;
1312 retcode = ui_notification_foreach_notification_posted(true, NULL, NULL);
1314 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1315 dts_pass(API_NAME, "passed");
1317 dts_fail(API_NAME, "failed");
1321 static void utc_notification_clone_positive1(void)
1323 const char *API_NAME = __FUNCTION__;
1324 int retcode = UI_NOTIFICATION_ERROR_NONE;
1326 ui_notification_h notification;
1327 ui_notification_h clone;
1329 ui_notification_create(true, ¬ification);
1331 retcode = ui_notification_clone(&clone, notification);
1333 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1334 dts_pass(API_NAME, "passed");
1336 dts_fail(API_NAME, "failed");
1340 static void utc_notification_clone_positive2(void)
1342 const char *API_NAME = __FUNCTION__;
1343 int retcode = UI_NOTIFICATION_ERROR_NONE;
1345 ui_notification_h notification;
1346 ui_notification_h clone;
1348 ui_notification_create(false, ¬ification);
1350 retcode = ui_notification_clone(&clone, notification);
1352 if (retcode == UI_NOTIFICATION_ERROR_NONE) {
1353 dts_pass(API_NAME, "passed");
1355 dts_fail(API_NAME, "failed");
1359 static void utc_notification_clone_positive3(void)
1361 const char *API_NAME = __FUNCTION__;
1362 int retcode = UI_NOTIFICATION_ERROR_NONE;
1364 ui_notification_h notification;
1365 ui_notification_h clone;
1366 bool ongoing = true;
1367 bool ongoing_clone = false;
1368 char *title = "TITLE";
1369 char *content = "CONTENT";
1370 char *icon = "ICON_PATH";
1371 char *title_clone = NULL;
1372 char *content_clone = NULL;
1373 char *icon_clone = NULL;
1376 ui_notification_create(ongoing, ¬ification);
1378 ui_notification_set_title(notification, title);
1379 ui_notification_set_content(notification, content);
1380 ui_notification_set_icon(notification, icon);
1382 retcode = ui_notification_clone(&clone, notification);
1384 if (!ui_notification_is_ongoing(clone, &ongoing_clone))
1386 if (ongoing == ongoing_clone)
1392 if (!ui_notification_get_title(clone, &title_clone))
1394 if (!strcmp(title, title_clone))
1400 if (!ui_notification_get_content(clone, &content_clone))
1402 if (!strcmp(content, content_clone))
1408 if (!ui_notification_get_icon(clone, &icon_clone))
1410 if (!strcmp(icon, icon_clone))
1416 if (retcode == UI_NOTIFICATION_ERROR_NONE && equal == 4) {
1417 dts_pass(API_NAME, "passed");
1419 dts_fail(API_NAME, "failed");
1423 static void utc_notification_clone_positive4(void)
1425 const char *API_NAME = __FUNCTION__;
1426 int retcode = UI_NOTIFICATION_ERROR_NONE;
1428 ui_notification_h notification;
1429 ui_notification_h clone;
1430 bool ongoing = false;
1431 bool ongoing_clone = false;
1432 char *title = "TITLE";
1433 char *content = "CONTENT";
1434 char *icon = "ICON_PATH";
1435 char *title_clone = NULL;
1436 char *content_clone = NULL;
1437 char *icon_clone = NULL;
1440 ui_notification_create(ongoing, ¬ification);
1442 ui_notification_set_title(notification, title);
1443 ui_notification_set_content(notification, content);
1444 ui_notification_set_icon(notification, icon);
1446 retcode = ui_notification_clone(&clone, notification);
1448 if (!ui_notification_is_ongoing(clone, &ongoing_clone))
1450 if (ongoing == ongoing_clone)
1456 if (!ui_notification_get_title(clone, &title_clone))
1458 if (!strcmp(title, title_clone))
1464 if (!ui_notification_get_content(clone, &content_clone))
1466 if (!strcmp(content, content_clone))
1472 if (!ui_notification_get_icon(clone, &icon_clone))
1474 if (!strcmp(icon, icon_clone))
1480 if (retcode == UI_NOTIFICATION_ERROR_NONE && equal == 4) {
1481 dts_pass(API_NAME, "passed");
1483 dts_fail(API_NAME, "failed");
1488 static void utc_notification_clone_negative1(void)
1490 const const char *API_NAME = __FUNCTION__;
1491 int retcode = UI_NOTIFICATION_ERROR_NONE;
1493 ui_notification_h notification;
1494 ui_notification_create(true, ¬ification);
1496 retcode = ui_notification_clone(NULL, notification);
1498 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1499 dts_pass(API_NAME, "passed");
1501 dts_fail(API_NAME, "failed");
1505 static void utc_notification_clone_negative2(void)
1507 const const char *API_NAME = __FUNCTION__;
1508 int retcode = UI_NOTIFICATION_ERROR_NONE;
1510 ui_notification_h clone;
1512 retcode = ui_notification_clone(&clone, NULL);
1514 if (retcode == UI_NOTIFICATION_ERROR_INVALID_PARAMETER) {
1515 dts_pass(API_NAME, "passed");
1517 dts_fail(API_NAME, "failed");