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
e724f6aa
Commit
e724f6aa
authored
Apr 28, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Apr 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Centralize the FormatMessageW skip detection.
parent
5505ae97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
55 deletions
+16
-55
format_msg.c
dlls/kernel32/tests/format_msg.c
+16
-55
No files found.
dlls/kernel32/tests/format_msg.c
View file @
e724f6aa
...
...
@@ -130,15 +130,6 @@ static void test_message_from_string_wide(void)
WCHAR
out
[
0x100
]
=
{
0
};
DWORD
r
,
error
;
SetLastError
(
0xdeadbeef
);
r
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
error
=
GetLastError
();
if
(
!
r
&&
error
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
/* the basics */
r
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
test
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
WCHAR
),
NULL
);
...
...
@@ -802,14 +793,6 @@ static void test_message_ignore_inserts_wide(void)
DWORD
ret
;
WCHAR
out
[
256
];
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_IGNORE_INSERTS
,
test
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
WCHAR
),
NULL
);
ok
(
ret
==
4
,
"Expected FormatMessageW to return 4, got %d
\n
"
,
ret
);
...
...
@@ -902,14 +885,6 @@ static void test_message_insufficient_buffer_wide(void)
WCHAR
out
[
5
];
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
memcpy
(
out
,
init_buf
,
sizeof
(
init_buf
));
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
test
,
0
,
0
,
out
,
0
,
NULL
);
ok
(
ret
==
0
,
"Expected FormatMessageA to return 0, got %u
\n
"
,
ret
);
...
...
@@ -1006,15 +981,6 @@ static void test_message_null_buffer_wide(void)
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_SYSTEM
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
error
=
GetLastError
();
if
(
!
ret
&&
error
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_SYSTEM
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"FormatMessageW returned %u
\n
"
,
ret
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"last error %u
\n
"
,
error
);
...
...
@@ -1144,14 +1110,6 @@ static void test_message_allocate_buffer_wide(void)
DWORD
ret
;
WCHAR
*
buf
;
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
/* While MSDN suggests that FormatMessageW allocates a buffer whose size is
* the larger of the output string and the requested buffer size, the tests
* will not try to determine the actual size of the buffer allocated, as
...
...
@@ -1397,14 +1355,6 @@ static void test_message_invalid_flags_wide(void)
WCHAR
*
ptr
;
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
memcpy
(
out
,
init_buf
,
sizeof
(
init_buf
));
ret
=
FormatMessageW
(
0
,
test
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
WCHAR
),
NULL
);
ok
(
ret
==
0
,
"Expected FormatMessageW to return 0, got %u
\n
"
,
ret
);
...
...
@@ -1482,17 +1432,28 @@ static void test_message_invalid_flags_wide(void)
START_TEST
(
format_msg
)
{
DWORD
ret
;
test_message_from_string
();
test_message_from_string_wide
();
test_message_ignore_inserts
();
test_message_ignore_inserts_wide
();
test_message_insufficient_buffer
();
test_message_insufficient_buffer_wide
();
test_message_null_buffer
();
test_message_null_buffer_wide
();
test_message_allocate_buffer
();
test_message_allocate_buffer_wide
();
test_message_from_hmodule
();
test_message_invalid_flags
();
SetLastError
(
0xdeadbeef
);
ret
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"FormatMessageW is not implemented
\n
"
);
return
;
}
test_message_from_string_wide
();
test_message_ignore_inserts_wide
();
test_message_insufficient_buffer_wide
();
test_message_null_buffer_wide
();
test_message_allocate_buffer_wide
();
test_message_invalid_flags_wide
();
}
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