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
f55afa8a
Commit
f55afa8a
authored
Oct 02, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Oct 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move internet time tests from http.c to internet.c.
parent
fa066c74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
125 deletions
+130
-125
http.c
dlls/wininet/tests/http.c
+0
-120
internet.c
dlls/wininet/tests/internet.c
+130
-5
No files found.
dlls/wininet/tests/http.c
View file @
f55afa8a
...
...
@@ -105,10 +105,6 @@ static CHAR status_string[MAX_INTERNET_STATUS][MAX_STATUS_NAME];
static
HANDLE
hCompleteEvent
;
static
INTERNET_STATUS_CALLBACK
(
WINAPI
*
pInternetSetStatusCallbackA
)(
HINTERNET
,
INTERNET_STATUS_CALLBACK
);
static
BOOL
(
WINAPI
*
pInternetTimeFromSystemTimeA
)(
CONST
SYSTEMTIME
*
,
DWORD
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pInternetTimeFromSystemTimeW
)(
CONST
SYSTEMTIME
*
,
DWORD
,
LPWSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pInternetTimeToSystemTimeA
)(
LPCSTR
,
SYSTEMTIME
*
,
DWORD
);
static
BOOL
(
WINAPI
*
pInternetTimeToSystemTimeW
)(
LPCWSTR
,
SYSTEMTIME
*
,
DWORD
);
static
VOID
WINAPI
callback
(
...
...
@@ -783,109 +779,6 @@ static void InternetOpenUrlA_test(void)
InternetCloseHandle
(
myhinternet
);
}
static
void
InternetTimeFromSystemTimeA_test
(
void
)
{
BOOL
ret
;
static
const
SYSTEMTIME
time
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
char
string
[
INTERNET_RFC1123_BUFSIZE
];
static
const
char
expect
[]
=
"Fri, 07 Jan 2005 12:06:35 GMT"
;
DWORD
error
;
ret
=
pInternetTimeFromSystemTimeA
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
);
ok
(
ret
,
"InternetTimeFromSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
string
,
expect
,
sizeof
(
expect
)
),
"InternetTimeFromSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pInternetTimeFromSystemTimeA
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
0
);
error
=
GetLastError
();
ok
(
!
ret
,
"InternetTimeFromSystemTimeA should have returned FALSE
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"InternetTimeFromSystemTimeA failed with ERROR_INSUFFICIENT_BUFFER instead of %u
\n
"
,
error
);
}
static
void
InternetTimeFromSystemTimeW_test
(
void
)
{
BOOL
ret
;
static
const
SYSTEMTIME
time
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
WCHAR
string
[
INTERNET_RFC1123_BUFSIZE
+
1
];
static
const
WCHAR
expect
[]
=
{
'F'
,
'r'
,
'i'
,
','
,
' '
,
'0'
,
'7'
,
' '
,
'J'
,
'a'
,
'n'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
' '
,
'1'
,
'2'
,
':'
,
'0'
,
'6'
,
':'
,
'3'
,
'5'
,
' '
,
'G'
,
'M'
,
'T'
,
0
};
DWORD
error
;
ret
=
pInternetTimeFromSystemTimeW
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
);
ok
(
ret
,
"InternetTimeFromSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
string
,
expect
,
sizeof
(
expect
)
),
"InternetTimeFromSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pInternetTimeFromSystemTimeW
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
/
sizeof
(
string
[
0
])
);
error
=
GetLastError
();
ok
(
!
ret
,
"InternetTimeFromSystemTimeW should have returned FALSE
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"InternetTimeFromSystemTimeW failed with ERROR_INSUFFICIENT_BUFFER instead of %u
\n
"
,
error
);
}
static
void
InternetTimeToSystemTimeA_test
(
void
)
{
BOOL
ret
;
SYSTEMTIME
time
;
static
const
SYSTEMTIME
expect
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
static
const
char
string
[]
=
"Fri, 07 Jan 2005 12:06:35 GMT"
;
static
const
char
string2
[]
=
" fri 7 jan 2005 12 06 35"
;
ret
=
pInternetTimeToSystemTimeA
(
string
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeA
(
string2
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
}
static
void
InternetTimeToSystemTimeW_test
(
void
)
{
BOOL
ret
;
SYSTEMTIME
time
;
static
const
SYSTEMTIME
expect
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
static
const
WCHAR
string
[]
=
{
'F'
,
'r'
,
'i'
,
','
,
' '
,
'0'
,
'7'
,
' '
,
'J'
,
'a'
,
'n'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
' '
,
'1'
,
'2'
,
':'
,
'0'
,
'6'
,
':'
,
'3'
,
'5'
,
' '
,
'G'
,
'M'
,
'T'
,
0
};
static
const
WCHAR
string2
[]
=
{
' '
,
'f'
,
'r'
,
'i'
,
' '
,
'7'
,
' '
,
'j'
,
'a'
,
'n'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
' '
,
'1'
,
'2'
,
' '
,
'0'
,
'6'
,
' '
,
'3'
,
'5'
,
0
};
static
const
WCHAR
string3
[]
=
{
'F'
,
'r'
,
0
};
ret
=
pInternetTimeToSystemTimeW
(
NULL
,
NULL
,
0
);
ok
(
!
ret
,
"InternetTimeToSystemTimeW succeeded (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
NULL
,
&
time
,
0
);
ok
(
!
ret
,
"InternetTimeToSystemTimeW succeeded (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string
,
NULL
,
0
);
ok
(
!
ret
,
"InternetTimeToSystemTimeW succeeded (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string2
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string3
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
}
static
void
HttpSendRequestEx_test
(
void
)
{
HINTERNET
hSession
;
...
...
@@ -2175,10 +2068,6 @@ START_TEST(http)
HMODULE
hdll
;
hdll
=
GetModuleHandleA
(
"wininet.dll"
);
pInternetSetStatusCallbackA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetSetStatusCallbackA"
);
pInternetTimeFromSystemTimeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeFromSystemTimeA"
);
pInternetTimeFromSystemTimeW
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeFromSystemTimeW"
);
pInternetTimeToSystemTimeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeToSystemTimeA"
);
pInternetTimeToSystemTimeW
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeToSystemTimeW"
);
if
(
!
pInternetSetStatusCallbackA
)
skip
(
"skipping the InternetReadFile tests
\n
"
);
...
...
@@ -2193,15 +2082,6 @@ START_TEST(http)
InternetOpenRequest_test
();
test_http_cache
();
InternetOpenUrlA_test
();
if
(
!
pInternetTimeFromSystemTimeA
)
skip
(
"skipping the InternetTime tests
\n
"
);
else
{
InternetTimeFromSystemTimeA_test
();
InternetTimeFromSystemTimeW_test
();
InternetTimeToSystemTimeA_test
();
InternetTimeToSystemTimeW_test
();
}
HttpSendRequestEx_test
();
HttpHeaders_test
();
test_http_connection
();
...
...
dlls/wininet/tests/internet.c
View file @
f55afa8a
...
...
@@ -27,6 +27,11 @@
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pInternetTimeFromSystemTimeA
)(
CONST
SYSTEMTIME
*
,
DWORD
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pInternetTimeFromSystemTimeW
)(
CONST
SYSTEMTIME
*
,
DWORD
,
LPWSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pInternetTimeToSystemTimeA
)(
LPCSTR
,
SYSTEMTIME
*
,
DWORD
);
static
BOOL
(
WINAPI
*
pInternetTimeToSystemTimeW
)(
LPCWSTR
,
SYSTEMTIME
*
,
DWORD
);
/* ############################### */
static
void
test_InternetCanonicalizeUrlA
(
void
)
...
...
@@ -362,13 +367,133 @@ static void test_version(void)
ok
(
version
.
dwMinorVersion
==
2
,
"dwMinorVersion=%d, expected 2
\n
"
,
version
.
dwMinorVersion
);
}
static
void
InternetTimeFromSystemTimeA_test
(
void
)
{
BOOL
ret
;
static
const
SYSTEMTIME
time
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
char
string
[
INTERNET_RFC1123_BUFSIZE
];
static
const
char
expect
[]
=
"Fri, 07 Jan 2005 12:06:35 GMT"
;
DWORD
error
;
ret
=
pInternetTimeFromSystemTimeA
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
);
ok
(
ret
,
"InternetTimeFromSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
string
,
expect
,
sizeof
(
expect
)
),
"InternetTimeFromSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pInternetTimeFromSystemTimeA
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
0
);
error
=
GetLastError
();
ok
(
!
ret
,
"InternetTimeFromSystemTimeA should have returned FALSE
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"InternetTimeFromSystemTimeA failed with ERROR_INSUFFICIENT_BUFFER instead of %u
\n
"
,
error
);
}
static
void
InternetTimeFromSystemTimeW_test
(
void
)
{
BOOL
ret
;
static
const
SYSTEMTIME
time
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
WCHAR
string
[
INTERNET_RFC1123_BUFSIZE
+
1
];
static
const
WCHAR
expect
[]
=
{
'F'
,
'r'
,
'i'
,
','
,
' '
,
'0'
,
'7'
,
' '
,
'J'
,
'a'
,
'n'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
' '
,
'1'
,
'2'
,
':'
,
'0'
,
'6'
,
':'
,
'3'
,
'5'
,
' '
,
'G'
,
'M'
,
'T'
,
0
};
DWORD
error
;
ret
=
pInternetTimeFromSystemTimeW
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
);
ok
(
ret
,
"InternetTimeFromSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
string
,
expect
,
sizeof
(
expect
)
),
"InternetTimeFromSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pInternetTimeFromSystemTimeW
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
/
sizeof
(
string
[
0
])
);
error
=
GetLastError
();
ok
(
!
ret
,
"InternetTimeFromSystemTimeW should have returned FALSE
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"InternetTimeFromSystemTimeW failed with ERROR_INSUFFICIENT_BUFFER instead of %u
\n
"
,
error
);
}
static
void
InternetTimeToSystemTimeA_test
(
void
)
{
BOOL
ret
;
SYSTEMTIME
time
;
static
const
SYSTEMTIME
expect
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
static
const
char
string
[]
=
"Fri, 07 Jan 2005 12:06:35 GMT"
;
static
const
char
string2
[]
=
" fri 7 jan 2005 12 06 35"
;
ret
=
pInternetTimeToSystemTimeA
(
string
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeA
(
string2
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeA failed (%u)
\n
"
,
GetLastError
()
);
}
static
void
InternetTimeToSystemTimeW_test
(
void
)
{
BOOL
ret
;
SYSTEMTIME
time
;
static
const
SYSTEMTIME
expect
=
{
2005
,
1
,
5
,
7
,
12
,
6
,
35
,
0
};
static
const
WCHAR
string
[]
=
{
'F'
,
'r'
,
'i'
,
','
,
' '
,
'0'
,
'7'
,
' '
,
'J'
,
'a'
,
'n'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
' '
,
'1'
,
'2'
,
':'
,
'0'
,
'6'
,
':'
,
'3'
,
'5'
,
' '
,
'G'
,
'M'
,
'T'
,
0
};
static
const
WCHAR
string2
[]
=
{
' '
,
'f'
,
'r'
,
'i'
,
' '
,
'7'
,
' '
,
'j'
,
'a'
,
'n'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
' '
,
'1'
,
'2'
,
' '
,
'0'
,
'6'
,
' '
,
'3'
,
'5'
,
0
};
static
const
WCHAR
string3
[]
=
{
'F'
,
'r'
,
0
};
ret
=
pInternetTimeToSystemTimeW
(
NULL
,
NULL
,
0
);
ok
(
!
ret
,
"InternetTimeToSystemTimeW succeeded (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
NULL
,
&
time
,
0
);
ok
(
!
ret
,
"InternetTimeToSystemTimeW succeeded (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string
,
NULL
,
0
);
ok
(
!
ret
,
"InternetTimeToSystemTimeW succeeded (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string2
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ok
(
!
memcmp
(
&
time
,
&
expect
,
sizeof
(
expect
)
),
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
ret
=
pInternetTimeToSystemTimeW
(
string3
,
&
time
,
0
);
ok
(
ret
,
"InternetTimeToSystemTimeW failed (%u)
\n
"
,
GetLastError
()
);
}
/* ############################### */
START_TEST
(
internet
)
{
test_InternetCanonicalizeUrlA
();
test_InternetQueryOptionA
();
test_get_cookie
();
test_version
();
test_null
();
HMODULE
hdll
;
hdll
=
GetModuleHandleA
(
"wininet.dll"
);
pInternetTimeFromSystemTimeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeFromSystemTimeA"
);
pInternetTimeFromSystemTimeW
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeFromSystemTimeW"
);
pInternetTimeToSystemTimeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeToSystemTimeA"
);
pInternetTimeToSystemTimeW
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeToSystemTimeW"
);
test_InternetCanonicalizeUrlA
();
test_InternetQueryOptionA
();
test_get_cookie
();
test_version
();
test_null
();
if
(
!
pInternetTimeFromSystemTimeA
)
skip
(
"skipping the InternetTime tests
\n
"
);
else
{
InternetTimeFromSystemTimeA_test
();
InternetTimeFromSystemTimeW_test
();
InternetTimeToSystemTimeA_test
();
InternetTimeToSystemTimeW_test
();
}
}
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