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 #include <notification.h>
26 #define TEST_PKG "org.tizen.tetware"
29 POSITIVE_TC_IDX = 0x01,
33 static void startup(void);
34 static void cleanup(void);
36 static void utc_notification_status_message_post_n(void);
37 static void utc_notification_status_message_post_p(void);
38 static void utc_notification_status_monitor_message_cb_set_n(void);
39 static void utc_notification_status_monitor_message_cb_set_p(void);
40 static void utc_notification_status_monitor_message_cb_unset_p(void);
42 void (*tet_startup)(void) = startup;
43 void (*tet_cleanup)(void) = cleanup;
45 struct tet_testlist tet_testlist[] = {
46 {utc_notification_status_message_post_n, NEGATIVE_TC_IDX},
47 {utc_notification_status_message_post_p, POSITIVE_TC_IDX},
48 {utc_notification_status_monitor_message_cb_set_n, NEGATIVE_TC_IDX},
49 {utc_notification_status_monitor_message_cb_set_p, POSITIVE_TC_IDX},
50 {utc_notification_status_monitor_message_cb_unset_p, POSITIVE_TC_IDX},
54 static void startup(void)
57 notification_clear(NOTIFICATION_TYPE_NONE);
58 tet_printf("\n TC start");
62 static void cleanup(void)
65 tet_printf("\n TC end");
68 static void _message_callback(const char *message, void *data)
73 * @brief Negative test case of notification_status_message_post()
75 static void utc_notification_status_message_post_n(void)
79 ret = notification_status_message_post(NULL);
80 dts_check_eq("notification_status_message_post", ret, NOTIFICATION_ERROR_INVALID_DATA,
81 "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
85 * @brief Positive test case of notification_status_message_post()
87 static void utc_notification_status_message_post_p(void)
91 ret = notification_status_message_post("TETWARE-P");
92 /*Invalid parameter test*/
93 dts_check_eq("notification_status_message_post", ret, NOTIFICATION_ERROR_NONE,
94 "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
98 * @brief Negative test case of notification_status_monitor_message_cb_set()
100 static void utc_notification_status_monitor_message_cb_set_n(void)
104 ret = notification_status_monitor_message_cb_set(NULL, NULL);
105 dts_check_eq("notification_status_message_post", ret, NOTIFICATION_ERROR_INVALID_DATA,
106 "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
110 * @brief Positive test case of notification_status_monitor_message_cb_set()
112 static void utc_notification_status_monitor_message_cb_set_p(void)
116 ret = notification_status_monitor_message_cb_set(_message_callback, NULL);
117 dts_check_eq("notification_status_monitor_message_cb_set", ret, NOTIFICATION_ERROR_NONE,
118 "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
122 * @brief Positive test case of notification_status_monitor_message_cb_unset()
124 static void utc_notification_status_monitor_message_cb_unset_p(void)
128 ret = notification_status_monitor_message_cb_unset();
129 dts_check_eq("notification_status_monitor_message_cb_unset", ret, NOTIFICATION_ERROR_NONE,
130 "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");