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
71511c9f
Commit
71511c9f
authored
Sep 24, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added tests for entries with identical hash key.
parent
122daa50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
urlcache.c
dlls/wininet/tests/urlcache.c
+39
-0
No files found.
dlls/wininet/tests/urlcache.c
View file @
71511c9f
...
...
@@ -31,6 +31,8 @@
#define TEST_URL "http://urlcachetest.winehq.org/index.html"
#define TEST_URL1 "Visited: user@http://urlcachetest.winehq.org/index.html"
#define TEST_HASH_COLLISIONS1 "Visited: http://winehq.org/doc0.html"
#define TEST_HASH_COLLISIONS2 "Visited: http://winehq.org/doc75651909.html"
static
BOOL
(
WINAPI
*
pDeleteUrlCacheEntryA
)(
LPCSTR
);
static
BOOL
(
WINAPI
*
pUnlockUrlCacheEntryFileA
)(
LPCSTR
,
DWORD
);
...
...
@@ -751,6 +753,43 @@ static void test_urlcacheA(void)
ok
(
ret
,
"DeleteUrlCacheEntryA failed with error %d
\n
"
,
GetLastError
());
check_file_not_exists
(
filenameA
);
}
/* Test if files with identical hash keys are handled correctly */
ret
=
CommitUrlCacheEntryA
(
TEST_HASH_COLLISIONS1
,
NULL
,
filetime_zero
,
filetime_zero
,
NORMAL_CACHE_ENTRY
,
NULL
,
0
,
"html"
,
NULL
);
ok
(
ret
,
"CommitUrlCacheEntry failed with error %d
\n
"
,
GetLastError
());
ret
=
CommitUrlCacheEntryA
(
TEST_HASH_COLLISIONS2
,
NULL
,
filetime_zero
,
filetime_zero
,
NORMAL_CACHE_ENTRY
,
NULL
,
0
,
"html"
,
NULL
);
ok
(
ret
,
"CommitUrlCacheEntry failed with error %d
\n
"
,
GetLastError
());
cbCacheEntryInfo
=
0
;
ret
=
GetUrlCacheEntryInfo
(
TEST_HASH_COLLISIONS1
,
NULL
,
&
cbCacheEntryInfo
);
ok
(
!
ret
,
"GetUrlCacheEntryInfo should have failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
lpCacheEntryInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbCacheEntryInfo
);
ret
=
GetUrlCacheEntryInfo
(
TEST_HASH_COLLISIONS1
,
lpCacheEntryInfo
,
&
cbCacheEntryInfo
);
ok
(
ret
,
"GetUrlCacheEntryInfo failed with error %d
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
lpCacheEntryInfo
->
lpszSourceUrlName
,
TEST_HASH_COLLISIONS1
),
"got incorrect entry: %s
\n
"
,
lpCacheEntryInfo
->
lpszSourceUrlName
);
HeapFree
(
GetProcessHeap
(),
0
,
lpCacheEntryInfo
);
cbCacheEntryInfo
=
0
;
ret
=
GetUrlCacheEntryInfo
(
TEST_HASH_COLLISIONS2
,
NULL
,
&
cbCacheEntryInfo
);
ok
(
!
ret
,
"GetUrlCacheEntryInfo should have failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
lpCacheEntryInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbCacheEntryInfo
);
ret
=
GetUrlCacheEntryInfo
(
TEST_HASH_COLLISIONS2
,
lpCacheEntryInfo
,
&
cbCacheEntryInfo
);
ok
(
ret
,
"GetUrlCacheEntryInfo failed with error %d
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
lpCacheEntryInfo
->
lpszSourceUrlName
,
TEST_HASH_COLLISIONS2
),
"got incorrect entry: %s
\n
"
,
lpCacheEntryInfo
->
lpszSourceUrlName
);
HeapFree
(
GetProcessHeap
(),
0
,
lpCacheEntryInfo
);
if
(
pDeleteUrlCacheEntryA
)
{
ret
=
pDeleteUrlCacheEntryA
(
TEST_HASH_COLLISIONS1
);
ok
(
ret
,
"DeleteUrlCacheEntry failed: %d
\n
"
,
GetLastError
());
ret
=
pDeleteUrlCacheEntryA
(
TEST_HASH_COLLISIONS2
);
ok
(
ret
,
"DeleteUrlCacheEntry failed: %d
\n
"
,
GetLastError
());
}
}
static
void
test_FindCloseUrlCache
(
void
)
...
...
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