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
d2d26205
Commit
d2d26205
authored
Feb 17, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Complicated cookie value set/get tests.
parent
a253a376
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
internet.c
dlls/wininet/tests/internet.c
+97
-0
No files found.
dlls/wininet/tests/internet.c
View file @
d2d26205
...
@@ -244,6 +244,102 @@ static void test_get_cookie(void)
...
@@ -244,6 +244,102 @@ static void test_get_cookie(void)
ret
?
"TRUE"
:
"FALSE"
,
GetLastError
());
ret
?
"TRUE"
:
"FALSE"
,
GetLastError
());
}
}
static
void
test_complicated_cookie
(
void
)
{
DWORD
len
;
BOOL
ret
;
CHAR
buffer
[
1024
];
ret
=
InternetSetCookie
(
"http://www.example.com/bar"
,
NULL
,
"A=B; domain=.example.com"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
ret
=
InternetSetCookie
(
"http://www.example.com/bar"
,
NULL
,
"C=D; domain=.example.com; path=/"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
/* Technically illegal! domain should require 2 dots, but native wininet accepts it */
ret
=
InternetSetCookie
(
"http://www.example.com"
,
NULL
,
"E=F; domain=example.com"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
ret
=
InternetSetCookie
(
"http://www.example.com"
,
NULL
,
"G=H; domain=.example.com; path=/foo"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
ret
=
InternetSetCookie
(
"http://www.example.com/bar.html"
,
NULL
,
"I=J; domain=.example.com"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
ret
=
InternetSetCookie
(
"http://www.example.com/bar/"
,
NULL
,
"K=L; domain=.example.com"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
ret
=
InternetSetCookie
(
"http://www.example.com/bar/"
,
NULL
,
"M=N; domain=.example.com; path=/foo/"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
==
NULL
,
"G=H present
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
==
NULL
,
"K=L present
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com/foobar"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
==
NULL
,
"G=H present
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
==
NULL
,
"K=L present
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com/foobar/"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
!=
NULL
,
"G=H missing
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
==
NULL
,
"K=L present
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com/foo/bar"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
!=
NULL
,
"G=H missing
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
==
NULL
,
"K=L present
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
!=
NULL
,
"M=N missing
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com/barfoo"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
==
NULL
,
"G=H present
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
==
NULL
,
"K=L present
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com/barfoo/"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
==
NULL
,
"G=H present
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
==
NULL
,
"K=L present
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
len
=
1024
;
ret
=
InternetGetCookie
(
"http://testing.example.com/bar/foo"
,
NULL
,
buffer
,
&
len
);
ok
(
strstr
(
buffer
,
"A=B"
)
!=
NULL
,
"A=B missing
\n
"
);
ok
(
strstr
(
buffer
,
"C=D"
)
!=
NULL
,
"C=D missing
\n
"
);
ok
(
strstr
(
buffer
,
"E=F"
)
!=
NULL
,
"E=F missing
\n
"
);
ok
(
strstr
(
buffer
,
"G=H"
)
==
NULL
,
"G=H present
\n
"
);
ok
(
strstr
(
buffer
,
"I=J"
)
!=
NULL
,
"I=J missing
\n
"
);
ok
(
strstr
(
buffer
,
"K=L"
)
!=
NULL
,
"K=L missing
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
}
static
void
test_null
(
void
)
static
void
test_null
(
void
)
{
{
HINTERNET
hi
,
hc
;
HINTERNET
hi
,
hc
;
...
@@ -683,6 +779,7 @@ START_TEST(internet)
...
@@ -683,6 +779,7 @@ START_TEST(internet)
test_InternetCanonicalizeUrlA
();
test_InternetCanonicalizeUrlA
();
test_InternetQueryOptionA
();
test_InternetQueryOptionA
();
test_get_cookie
();
test_get_cookie
();
test_complicated_cookie
();
test_version
();
test_version
();
test_null
();
test_null
();
...
...
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