2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
17 #include <tet_api.h>
\r
18 #include <download.h>
\r
20 static void startup(void);
\r
21 static void cleanup(void);
\r
23 void (*tet_startup)(void) = startup;
\r
24 void (*tet_cleanup)(void) = cleanup;
\r
26 static void utc_download_get_http_header_field_list_negative1(void);
\r
27 static void utc_download_get_http_header_field_list_negative2(void);
\r
28 static void utc_download_get_http_header_field_list_negative3(void);
\r
30 struct tet_testlist tet_testlist[] = {
\r
31 {utc_download_get_http_header_field_list_negative1, 1},
\r
32 {utc_download_get_http_header_field_list_negative2, 2},
\r
33 {utc_download_get_http_header_field_list_negative3, 3},
\r
37 static void startup(void)
\r
42 static void cleanup(void)
\r
47 void utc_download_get_http_header_field_list_negative1(void)
\r
49 const char *TC_NAME = __FUNCTION__;
\r
54 download_create(&id);
\r
55 download_add_http_header_field(id, "field1","value1");
\r
56 retcode = download_get_http_header_field_list(id, NULL, &length);
\r
57 download_destroy(id);
\r
59 if (retcode == DOWNLOAD_ERROR_INVALID_PARAMETER)
\r
60 dts_pass(TC_NAME, "retcode has invalid parameter");
\r
62 dts_fail(TC_NAME, "retcode does not have invalid parameter");
\r
65 void utc_download_get_http_header_field_list_negative2(void)
\r
67 const char *TC_NAME = __FUNCTION__;
\r
70 char **fields = NULL;
\r
72 download_create(&id);
\r
73 download_add_http_header_field(id, "field1","value1");
\r
74 retcode = download_get_http_header_field_list(id, &fields, NULL);
\r
75 download_destroy(id);
\r
77 if (retcode == DOWNLOAD_ERROR_INVALID_PARAMETER)
\r
78 dts_pass(TC_NAME, "retcode has invalid parameter");
\r
80 dts_fail(TC_NAME, "retcode does not have invalid parameter");
\r
83 void utc_download_get_http_header_field_list_negative3(void)
\r
85 const char *TC_NAME = __FUNCTION__;
\r
87 char **fields = NULL;
\r
91 download_create(&id);
\r
92 download_add_http_header_field(id, "field1","value1");
\r
93 retcode = download_get_http_header_field_list(-1, &fields, &length);
\r
94 download_destroy(id);
\r
96 if (retcode == DOWNLOAD_ERROR_INVALID_PARAMETER)
\r
97 dts_pass(TC_NAME, "retcode has invalid parameter");
\r
99 dts_fail(TC_NAME, "retcode does not have invalid parameter");
\r