Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6603ad72
Commit
6603ad72
authored
Aug 20, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Add some tests for WinHttpAddRequestHeaders.
parent
70fb4ef5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
winhttp.c
dlls/winhttp/tests/winhttp.c
+37
-1
No files found.
dlls/winhttp/tests/winhttp.c
View file @
6603ad72
...
@@ -204,6 +204,9 @@ static void test_WinHttpAddHeaders(void)
...
@@ -204,6 +204,9 @@ static void test_WinHttpAddHeaders(void)
static
const
WCHAR
test_flag_coalesce_semicolon
[]
=
static
const
WCHAR
test_flag_coalesce_semicolon
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'2'
,
','
,
' '
,
't'
,
'e'
,
's'
,
't'
,
'4'
,
','
,
' '
,
't'
,
'e'
,
's'
,
't'
,
'5'
,
';'
,
' '
,
't'
,
'e'
,
's'
,
't'
,
'6'
,
0
};
{
't'
,
'e'
,
's'
,
't'
,
'2'
,
','
,
' '
,
't'
,
'e'
,
's'
,
't'
,
'4'
,
','
,
' '
,
't'
,
'e'
,
's'
,
't'
,
'5'
,
';'
,
' '
,
't'
,
'e'
,
's'
,
't'
,
'6'
,
0
};
static
const
WCHAR
field
[]
=
{
'f'
,
'i'
,
'e'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
value
[]
=
{
'v'
,
'a'
,
'l'
,
'u'
,
'e'
,
' '
,
0
};
static
const
WCHAR
test_headers
[][
14
]
=
static
const
WCHAR
test_headers
[][
14
]
=
{
{
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'1'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'1'
,
0
},
...
@@ -212,7 +215,14 @@ static void test_WinHttpAddHeaders(void)
...
@@ -212,7 +215,14 @@ static void test_WinHttpAddHeaders(void)
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'4'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'4'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'5'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'5'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'6'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'6'
,
0
},
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'7'
,
0
}
{
'W'
,
'a'
,
'r'
,
'n'
,
'i'
,
'n'
,
'g'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'7'
,
0
},
{
0
},
{
':'
,
0
},
{
'a'
,
':'
,
0
},
{
':'
,
'b'
,
0
},
{
'c'
,
'd'
,
0
},
{
' '
,
'e'
,
' '
,
':'
,
'f'
,
0
},
{
'f'
,
'i'
,
'e'
,
'l'
,
'd'
,
':'
,
' '
,
'v'
,
'a'
,
'l'
,
'u'
,
'e'
,
' '
,
0
}
};
};
static
const
WCHAR
test_indices
[][
6
]
=
static
const
WCHAR
test_indices
[][
6
]
=
{
{
...
@@ -481,6 +491,32 @@ static void test_WinHttpAddHeaders(void)
...
@@ -481,6 +491,32 @@ static void test_WinHttpAddHeaders(void)
test_header_name
,
buffer
,
&
len
,
&
index
);
test_header_name
,
buffer
,
&
len
,
&
index
);
ok
(
ret
==
FALSE
,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.
\n
"
);
ok
(
ret
==
FALSE
,
"WinHttpQueryHeaders succeeded unexpectedly, found third header.
\n
"
);
ret
=
WinHttpAddRequestHeaders
(
request
,
test_headers
[
8
],
~
0UL
,
WINHTTP_ADDREQ_FLAG_ADD
);
ok
(
!
ret
,
"WinHttpAddRequestHeaders failed
\n
"
);
ret
=
WinHttpAddRequestHeaders
(
request
,
test_headers
[
9
],
~
0UL
,
WINHTTP_ADDREQ_FLAG_ADD
);
ok
(
ret
,
"WinHttpAddRequestHeaders failed
\n
"
);
ret
=
WinHttpAddRequestHeaders
(
request
,
test_headers
[
10
],
~
0UL
,
WINHTTP_ADDREQ_FLAG_ADD
);
ok
(
!
ret
,
"WinHttpAddRequestHeaders failed
\n
"
);
ret
=
WinHttpAddRequestHeaders
(
request
,
test_headers
[
11
],
~
0UL
,
WINHTTP_ADDREQ_FLAG_ADD
);
ok
(
!
ret
,
"WinHttpAddRequestHeaders failed
\n
"
);
ret
=
WinHttpAddRequestHeaders
(
request
,
test_headers
[
12
],
~
0UL
,
WINHTTP_ADDREQ_FLAG_ADD
);
ok
(
!
ret
,
"WinHttpAddRequestHeaders failed
\n
"
);
ret
=
WinHttpAddRequestHeaders
(
request
,
test_headers
[
13
],
~
0UL
,
WINHTTP_ADDREQ_FLAG_ADD
);
ok
(
ret
,
"WinHttpAddRequestHeaders failed
\n
"
);
index
=
0
;
buffer
[
0
]
=
0
;
len
=
sizeof
(
buffer
);
ret
=
WinHttpQueryHeaders
(
request
,
WINHTTP_QUERY_CUSTOM
|
WINHTTP_QUERY_FLAG_REQUEST_HEADERS
,
field
,
buffer
,
&
len
,
&
index
);
ok
(
ret
,
"WinHttpQueryHeaders failed: %u
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
buffer
,
value
,
sizeof
(
value
)),
"unexpected result
\n
"
);
ret
=
WinHttpCloseHandle
(
request
);
ret
=
WinHttpCloseHandle
(
request
);
ok
(
ret
==
TRUE
,
"WinHttpCloseHandle failed on closing request, got %d.
\n
"
,
ret
);
ok
(
ret
==
TRUE
,
"WinHttpCloseHandle failed on closing request, got %d.
\n
"
,
ret
);
done:
done:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment