tizen 2.3 release
[framework/api/url-download.git] / TC / testcase / utc_download_get_network_bonding_positive.c
1 /*\r
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the License);\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  * http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an AS IS BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 #include <tet_api.h>\r
18 #include <download.h>\r
19 \r
20 static void startup(void);\r
21 static void cleanup(void);\r
22 \r
23 void (*tet_startup)(void) = startup;\r
24 void (*tet_cleanup)(void) = cleanup;\r
25 \r
26 static void utc_download_get_network_bonding_positive1(void);\r
27 \r
28 struct tet_testlist tet_testlist[] = {\r
29         {utc_download_get_network_bonding_positive1, 1},\r
30         {NULL, 0},\r
31 };\r
32 \r
33 static void startup(void)\r
34 {\r
35 \r
36 }\r
37 \r
38 static void cleanup(void)\r
39 {\r
40         /* end of TC */\r
41 }\r
42 \r
43 void utc_download_get_network_bonding_positive1(void)\r
44 {\r
45         const char *TC_NAME = __FUNCTION__;\r
46         int retcode = 0;\r
47         bool enable = true;\r
48         bool getenable = false;\r
49         int id = 0;\r
50 \r
51         download_create(&id);\r
52         download_set_network_bonding(id, enable);\r
53         retcode = download_get_network_bonding(id, &getenable);\r
54         download_destroy(id);\r
55 \r
56         if (retcode == DOWNLOAD_ERROR_NONE && (enable == getenable))\r
57                 dts_pass(TC_NAME, "retcode has no error and the network bonding status of set API is same as of get API ");\r
58         else\r
59                 dts_fail(TC_NAME, "retcode has error or the network bonding status of set API is not same as of get API");\r
60 }\r
61 \r