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
341cea51
Commit
341cea51
authored
Jun 01, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Make some sysparams registry key optional, and fix some other…
user32/tests: Make some sysparams registry key optional, and fix some other failures on old Windows platforms.
parent
750fceba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
25 deletions
+34
-25
sysparams.c
dlls/user32/tests/sysparams.c
+34
-25
No files found.
dlls/user32/tests/sysparams.c
View file @
341cea51
...
...
@@ -245,11 +245,11 @@ static BOOL test_error_msg ( int rc, const char *name )
{
if
(
last_error
==
0xdeadbeef
||
last_error
==
ERROR_INVALID_SPI_VALUE
||
last_error
==
ERROR_INVALID_PARAMETER
)
{
trace
(
"%s not supported on this platform. Skipping test
\n
"
,
name
);
skip
(
"%s not supported on this platform
\n
"
,
name
);
}
else
if
(
last_error
==
ERROR_ACCESS_DENIED
)
{
trace
(
"%s does not have privileges to run. Skipping test
\n
"
,
name
);
skip
(
"%s does not have privileges to run
\n
"
,
name
);
}
else
{
...
...
@@ -274,7 +274,7 @@ static BOOL test_error_msg ( int rc, const char *name )
* lpsRegName - registry entry name
* lpsTestValue - value to test
*/
static
void
_test_reg_key
(
LPCSTR
subKey1
,
LPCSTR
subKey2
,
LPCSTR
valName1
,
LPCSTR
valName2
,
LPCSTR
testValue
)
static
void
_test_reg_key
(
LPCSTR
subKey1
,
LPCSTR
subKey2
,
LPCSTR
valName1
,
LPCSTR
valName2
,
LPCSTR
testValue
,
BOOL
optional
)
{
CHAR
value
[
MAX_PATH
];
DWORD
valueLen
;
...
...
@@ -360,16 +360,21 @@ static void _test_reg_key( LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName1, LPCS
}
}
}
ok
(
found
,
"Missing registry values: %s or %s in keys: %s or %s
\n
"
,
ok
(
found
||
optional
,
"Missing registry values: %s or %s in keys: %s or %s
\n
"
,
valName1
,
(
valName2
?
valName2
:
"<n/a>"
),
subKey1
,
(
subKey2
?
subKey2
:
"<n/a>"
)
);
}
#define test_reg_key( subKey, valName, testValue ) \
_test_reg_key( subKey, NULL, valName, NULL, testValue )
_test_reg_key( subKey, NULL, valName, NULL, testValue, FALSE )
#define test_reg_key_optional( subKey, valName, testValue ) \
_test_reg_key( subKey, NULL, valName, NULL, testValue, TRUE )
#define test_reg_key_ex( subKey1, subKey2, valName, testValue ) \
_test_reg_key( subKey1, subKey2, valName, NULL, testValue )
_test_reg_key( subKey1, subKey2, valName, NULL, testValue
, FALSE
)
#define test_reg_key_ex2( subKey1, subKey2, valName1, valName2, testValue ) \
_test_reg_key( subKey1, subKey2, valName1, valName2, testValue )
_test_reg_key( subKey1, subKey2, valName1, valName2, testValue, FALSE )
#define test_reg_key_ex2_optional( subKey1, subKey2, valName1, valName2, testValue ) \
_test_reg_key( subKey1, subKey2, valName1, valName2, testValue, TRUE )
/* get a metric from the registry. If the value is negative
* it is assumed to be in twips and converted to pixels */
...
...
@@ -1800,10 +1805,10 @@ static void test_SPI_SETWORKAREA( void ) /* 47 */
test_change_message
(
SPI_SETWORKAREA
,
0
);
eq
(
area
.
left
,
curr_val
.
left
,
"left"
,
"%d"
);
eq
(
area
.
top
,
curr_val
.
top
,
"top"
,
"%d"
);
/* size may be rounded
up
*/
ok
(
area
.
right
>=
curr_val
.
right
&&
area
.
right
<
curr_val
.
right
+
16
,
/* size may be rounded */
ok
(
area
.
right
>=
curr_val
.
right
-
16
&&
area
.
right
<
curr_val
.
right
+
16
,
"right: got %d instead of %d
\n
"
,
area
.
right
,
curr_val
.
right
);
ok
(
area
.
bottom
>=
curr_val
.
bottom
&&
area
.
bottom
<
curr_val
.
bottom
+
16
,
ok
(
area
.
bottom
>=
curr_val
.
bottom
-
16
&&
area
.
bottom
<
curr_val
.
bottom
+
16
,
"bottom: got %d instead of %d
\n
"
,
area
.
bottom
,
curr_val
.
bottom
);
curr_val
=
area
;
rc
=
SystemParametersInfoA
(
SPI_SETWORKAREA
,
0
,
&
old_area
,
...
...
@@ -1815,10 +1820,10 @@ static void test_SPI_SETWORKAREA( void ) /* 47 */
test_change_message
(
SPI_SETWORKAREA
,
0
);
eq
(
area
.
left
,
old_area
.
left
,
"left"
,
"%d"
);
eq
(
area
.
top
,
old_area
.
top
,
"top"
,
"%d"
);
/* size may be rounded
up
*/
ok
(
area
.
right
>=
old_area
.
right
&&
area
.
right
<
old_area
.
right
+
16
,
/* size may be rounded */
ok
(
area
.
right
>=
old_area
.
right
-
16
&&
area
.
right
<
old_area
.
right
+
16
,
"right: got %d instead of %d
\n
"
,
area
.
right
,
old_area
.
right
);
ok
(
area
.
bottom
>=
old_area
.
bottom
&&
area
.
bottom
<
old_area
.
bottom
+
16
,
ok
(
area
.
bottom
>=
old_area
.
bottom
-
16
&&
area
.
bottom
<
old_area
.
bottom
+
16
,
"bottom: got %d instead of %d
\n
"
,
area
.
bottom
,
old_area
.
bottom
);
}
...
...
@@ -1917,9 +1922,9 @@ static void test_SPI_SETSCREENREADER( void ) /* 71 */
if
(
!
test_error_msg
(
rc
,
"SPI_SETSCREENREADER"
))
return
;
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
test_change_message
(
SPI_SETSCREENREADER
,
1
);
test_reg_key_ex2
(
SPI_SETSCREENREADER_REGKEY
,
SPI_SETSCREENREADER_REGKEY_LEGACY
,
SPI_SETSCREENREADER_VALNAME
,
SPI_SETSCREENREADER_VALNAME_LEGACY
,
vals
[
i
]
?
"1"
:
"0"
);
test_reg_key_ex2
_optional
(
SPI_SETSCREENREADER_REGKEY
,
SPI_SETSCREENREADER_REGKEY_LEGACY
,
SPI_SETSCREENREADER_VALNAME
,
SPI_SETSCREENREADER_VALNAME_LEGACY
,
vals
[
i
]
?
"1"
:
"0"
);
rc
=
SystemParametersInfoA
(
SPI_GETSCREENREADER
,
0
,
&
v
,
0
);
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
...
...
@@ -1988,14 +1993,16 @@ static void test_SPI_SETLOWPOWERACTIVE( void ) /* 85 */
if
(
!
test_error_msg
(
rc
,
"SPI_SETLOWPOWERACTIVE"
))
return
;
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
test_change_message
(
SPI_SETLOWPOWERACTIVE
,
1
);
test_reg_key
(
SPI_SETLOWPOWERACTIVE_REGKEY
,
SPI_SETLOWPOWERACTIVE_VALNAME
,
vals
[
i
]
?
"1"
:
"0"
);
test_reg_key
_optional
(
SPI_SETLOWPOWERACTIVE_REGKEY
,
SPI_SETLOWPOWERACTIVE_VALNAME
,
vals
[
i
]
?
"1"
:
"0"
);
/* SPI_SETLOWPOWERACTIVE is not persistent in win2k3 and above */
v
=
0xdeadbeef
;
rc
=
SystemParametersInfoA
(
SPI_GETLOWPOWERACTIVE
,
0
,
&
v
,
0
);
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
ok
(
v
==
vals
[
i
]
||
broken
(
v
==
(
0xdead0000
|
vals
[
i
]))
||
/* win98 only sets the low word */
v
==
0
,
/* win2k3 */
"SPI_GETLOWPOWERACTIVE: got %d instead of 0 or %d
\n
"
,
v
,
vals
[
i
]);
}
...
...
@@ -2026,14 +2033,16 @@ static void test_SPI_SETPOWEROFFACTIVE( void ) /* 86 */
if
(
!
test_error_msg
(
rc
,
"SPI_SETPOWEROFFACTIVE"
))
return
;
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
test_change_message
(
SPI_SETPOWEROFFACTIVE
,
1
);
test_reg_key
(
SPI_SETPOWEROFFACTIVE_REGKEY
,
SPI_SETPOWEROFFACTIVE_VALNAME
,
vals
[
i
]
?
"1"
:
"0"
);
test_reg_key
_optional
(
SPI_SETPOWEROFFACTIVE_REGKEY
,
SPI_SETPOWEROFFACTIVE_VALNAME
,
vals
[
i
]
?
"1"
:
"0"
);
/* SPI_SETPOWEROFFACTIVE is not persistent in win2k3 and above */
v
=
0xdeadbeef
;
rc
=
SystemParametersInfoA
(
SPI_GETPOWEROFFACTIVE
,
0
,
&
v
,
0
);
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
ok
(
v
==
vals
[
i
]
||
broken
(
v
==
(
0xdead0000
|
vals
[
i
]))
||
/* win98 only sets the low word */
v
==
0
,
/* win2k3 */
"SPI_GETPOWEROFFACTIVE: got %d instead of 0 or %d
\n
"
,
v
,
vals
[
i
]);
}
...
...
@@ -2064,9 +2073,9 @@ static void test_SPI_SETSNAPTODEFBUTTON( void ) /* 95 */
if
(
!
test_error_msg
(
rc
,
"SPI_SETSNAPTODEFBUTTON"
))
return
;
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
test_change_message
(
SPI_SETSNAPTODEFBUTTON
,
0
);
test_reg_key
(
SPI_SETSNAPTODEFBUTTON_REGKEY
,
SPI_SETSNAPTODEFBUTTON_VALNAME
,
vals
[
i
]
?
"1"
:
"0"
);
test_reg_key
_optional
(
SPI_SETSNAPTODEFBUTTON_REGKEY
,
SPI_SETSNAPTODEFBUTTON_VALNAME
,
vals
[
i
]
?
"1"
:
"0"
);
rc
=
SystemParametersInfoA
(
SPI_GETSNAPTODEFBUTTON
,
0
,
&
v
,
0
);
ok
(
rc
!=
0
,
"%d: rc=%d err=%d
\n
"
,
i
,
rc
,
GetLastError
());
...
...
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