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
189719c1
Commit
189719c1
authored
May 24, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
May 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localui/tests: Add tests for AddPortUI.
parent
70995ed4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
localui.c
dlls/localui/tests/localui.c
+57
-0
No files found.
dlls/localui/tests/localui.c
View file @
189719c1
...
@@ -48,6 +48,7 @@ static WCHAR does_not_existW[] = {'d','o','e','s','_','n','o','t','_','e','x','i
...
@@ -48,6 +48,7 @@ static WCHAR does_not_existW[] = {'d','o','e','s','_','n','o','t','_','e','x','i
static
WCHAR
emptyW
[]
=
{
0
};
static
WCHAR
emptyW
[]
=
{
0
};
static
CHAR
fmt_comA
[]
=
{
'C'
,
'O'
,
'M'
,
'%'
,
'u'
,
':'
,
0
};
static
CHAR
fmt_comA
[]
=
{
'C'
,
'O'
,
'M'
,
'%'
,
'u'
,
':'
,
0
};
static
CHAR
fmt_lptA
[]
=
{
'L'
,
'P'
,
'T'
,
'%'
,
'u'
,
':'
,
0
};
static
CHAR
fmt_lptA
[]
=
{
'L'
,
'P'
,
'T'
,
'%'
,
'u'
,
':'
,
0
};
static
WCHAR
localportW
[]
=
{
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
' '
,
'P'
,
'o'
,
'r'
,
't'
,
0
};
static
WCHAR
portname_fileW
[]
=
{
'F'
,
'I'
,
'L'
,
'E'
,
':'
,
0
};
static
WCHAR
portname_fileW
[]
=
{
'F'
,
'I'
,
'L'
,
'E'
,
':'
,
0
};
static
LPBYTE
pi_buffer
;
static
LPBYTE
pi_buffer
;
...
@@ -123,6 +124,61 @@ static LPWSTR strdupW(LPCWSTR strW)
...
@@ -123,6 +124,61 @@ static LPWSTR strdupW(LPCWSTR strW)
/* ########################### */
/* ########################### */
static
void
test_AddPortUI
(
void
)
{
DWORD
res
;
LPWSTR
new_portname
;
/* not present before w2k */
if
(
!
pAddPortUI
)
{
skip
(
"AddPortUI not found
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
res
=
pAddPortUI
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_UNKNOWN_PORT
),
"got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)
\n
"
,
res
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
res
=
pAddPortUI
(
NULL
,
NULL
,
emptyW
,
NULL
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_UNKNOWN_PORT
),
"got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)
\n
"
,
res
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
res
=
pAddPortUI
(
NULL
,
NULL
,
does_not_existW
,
NULL
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_UNKNOWN_PORT
),
"got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)
\n
"
,
res
,
GetLastError
());
if
(
winetest_interactive
)
{
SetLastError
(
0xdeadbeef
);
new_portname
=
NULL
;
/*
* - On MSDN, you can read, that no dialogs should be displayed, when hWnd
* is NULL, but native localui does not care
* - when the new port already exist,
* TRUE is returned, but new_portname is NULL
* - when the new port starts with "COM" or "LPT",
* FALSE is returned with ERROR_NOT_SUPPORTED in windows
*/
res
=
pAddPortUI
(
NULL
,
NULL
,
localportW
,
&
new_portname
);
ok
(
res
||
(
GetLastError
()
==
ERROR_CANCELLED
)
||
(
GetLastError
()
==
ERROR_ACCESS_DENIED
)
||
(
GetLastError
()
==
ERROR_NOT_SUPPORTED
),
"got %d with %u and %p (expected '!= 0' or '0' with: "
"ERROR_CANCELLED, ERROR_ACCESS_DENIED or ERROR_NOT_SUPPORTED)
\n
"
,
res
,
GetLastError
(),
new_portname
);
GlobalFree
(
new_portname
);
}
}
/* ########################### */
static
void
test_ConfigurePortUI
(
void
)
static
void
test_ConfigurePortUI
(
void
)
{
{
DWORD
res
;
DWORD
res
;
...
@@ -255,6 +311,7 @@ START_TEST(localui)
...
@@ -255,6 +311,7 @@ START_TEST(localui)
/* "FILE:" */
/* "FILE:" */
file_present
=
find_portinfo2
(
portname_fileW
);
file_present
=
find_portinfo2
(
portname_fileW
);
test_AddPortUI
();
test_ConfigurePortUI
();
test_ConfigurePortUI
();
/* cleanup */
/* cleanup */
...
...
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