Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5e15187f
Commit
5e15187f
authored
Jul 06, 2008
by
Stefan Leichter
Committed by
Alexandre Julliard
Jul 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rasapi32: Added some more tests for RasEnumDevicesA, fix Wine not to crash on the tests.
parent
b8c6d8e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
1 deletion
+65
-1
rasapi.c
dlls/rasapi32/rasapi.c
+1
-1
rasapi.c
dlls/rasapi32/tests/rasapi.c
+64
-0
No files found.
dlls/rasapi32/rasapi.c
View file @
5e15187f
...
...
@@ -249,7 +249,7 @@ DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD l
return
ERROR_INVALID_PARAMETER
;
FIXME
(
"(%p,%p,%p),stub!
\n
"
,
lpRasDevinfo
,
lpcb
,
lpcDevices
);
if
(
*
lpcb
<
sizeof
(
RASDEVINFOA
))
{
if
(
!
lpRasDevinfo
||
(
*
lpcb
<
sizeof
(
RASDEVINFOA
)
))
{
*
lpcb
=
sizeof
(
RASDEVINFOA
);
return
ERROR_BUFFER_TOO_SMALL
;
}
...
...
dlls/rasapi32/tests/rasapi.c
View file @
5e15187f
...
...
@@ -53,14 +53,78 @@ static void test_rasenum(void)
return
;
}
/* test first parameter */
result
=
pRasEnumDevicesA
(
NULL
,
&
cb
,
&
cDevices
);
trace
(
"RasEnumDevicesA: buffersize %d
\n
"
,
cb
);
ok
(
result
==
ERROR_BUFFER_TOO_SMALL
,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d
\n
"
,
result
);
cb
=
sizeof
(
rasDevInfo
);
result
=
pRasEnumDevicesA
(
NULL
,
&
cb
,
&
cDevices
);
ok
(
result
==
ERROR_BUFFER_TOO_SMALL
,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d
\n
"
,
result
);
rasDevInfo
.
dwSize
=
0
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
todo_wine
ok
(
result
==
ERROR_INVALID_SIZE
,
"Expected ERROR_INVALID_SIZE, got %08d
\n
"
,
result
);
rasDevInfo
.
dwSize
=
sizeof
(
rasDevInfo
)
-
1
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
todo_wine
ok
(
result
==
ERROR_INVALID_SIZE
,
"Expected ERROR_INVALID_SIZE, got %08d
\n
"
,
result
);
rasDevInfo
.
dwSize
=
sizeof
(
rasDevInfo
)
+
1
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
todo_wine
ok
(
result
==
ERROR_INVALID_SIZE
,
"Expected ERROR_INVALID_SIZE, got %08d
\n
"
,
result
);
/* test second parameter */
rasDevInfo
.
dwSize
=
sizeof
(
rasDevInfo
);
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
NULL
,
&
cDevices
);
ok
(
result
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08d
\n
"
,
result
);
cb
=
0
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
ok
(
result
==
ERROR_BUFFER_TOO_SMALL
,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d
\n
"
,
result
);
cb
=
sizeof
(
rasDevInfo
)
-
1
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
ok
(
result
==
ERROR_BUFFER_TOO_SMALL
,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d
\n
"
,
result
);
cb
=
sizeof
(
rasDevInfo
)
+
1
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
todo_wine
ok
(
result
==
ERROR_BUFFER_TOO_SMALL
,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d
\n
"
,
result
);
/* test third parameter */
cb
=
sizeof
(
rasDevInfo
);
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
NULL
);
ok
(
result
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08d
\n
"
,
result
);
/* test combinations of invalid parameters */
result
=
pRasEnumDevicesA
(
NULL
,
NULL
,
&
cDevices
);
ok
(
result
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08d
\n
"
,
result
);
result
=
pRasEnumDevicesA
(
NULL
,
&
cb
,
NULL
);
ok
(
result
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08d
\n
"
,
result
);
cb
=
0
;
rasDevInfo
.
dwSize
=
0
;
result
=
pRasEnumDevicesA
(
&
rasDevInfo
,
&
cb
,
&
cDevices
);
todo_wine
ok
(
result
==
ERROR_INVALID_SIZE
,
"Expected ERROR_INVALID_SIZE, got %08d
\n
"
,
result
);
}
START_TEST
(
rasapi
)
...
...
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