tizen 2.3 release
[framework/api/url-download.git] / TC / testcase / utc_download_set_notification_type_negative.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #include <tet_api.h>
18 #include <download.h>
19
20 static void startup(void);
21 static void cleanup(void);
22
23 void (*tet_startup)(void) = startup;
24 void (*tet_cleanup)(void) = cleanup;
25
26 static void utc_download_set_notification_type_negative1(void);
27 static void utc_download_set_notification_type_negative2(void);
28
29 struct tet_testlist tet_testlist[] = {
30         {utc_download_set_notification_type_negative1, 1},
31         {utc_download_set_notification_type_negative2, 2},
32         {NULL, 0},
33 };
34
35 static void startup(void)
36 {
37
38 }
39
40 static void cleanup(void)
41 {
42         /* end of TC */
43 }
44
45 void utc_download_set_notification_type_negative1(void)
46 {
47         const char *TC_NAME = __FUNCTION__;
48         int retcode = 0;
49
50         retcode = download_set_notification_type(-1, DOWNLOAD_NOTIFICATION_TYPE_NONE);
51
52         if (retcode == DOWNLOAD_ERROR_INVALID_PARAMETER)
53                 dts_pass(TC_NAME, "retcode has invalid parameter");
54         else
55                 dts_fail(TC_NAME, "retcode does not have invalid parameter");
56 }
57
58 void utc_download_set_notification_type_negative2(void)
59 {
60         const char *TC_NAME = __FUNCTION__;
61         int retcode = 0;
62         int id = 0;
63
64         download_create(&id);
65         retcode = download_set_notification_type(id, 5);
66         download_destroy(id);
67
68         if (retcode != DOWNLOAD_ERROR_NONE)
69                 dts_pass(TC_NAME, "retcode has error");
70         else
71                 dts_fail(TC_NAME, "retcode does not have error");
72 }