"Austin English" austinenglish@gmail.com wrote:
- /* test FindWindow behavior */
- SetLastError(0xdeadbeef);
- HWND hWnd = FindWindow("SomeWindowThatDoesNotExist", NULL);
- if(hWnd) {
printf("hWnd not NULL");
- }
- else {
todo_wine
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
- }
Why did you remove the comment? Introducing 'hWnd' variable is not needed, there is one already called 'found', besides declaring variables in the code is not allowed in Wine. It would be much simpler to add the last error test to 2 existing FindWindowExA calls instead of introducing something looking as foreign code (in indentation, braces usage and spaces).
On Wed, Aug 13, 2008 at 10:09 PM, Dmitry Timoshkov dmitry@codeweavers.com wrote:
"Austin English" austinenglish@gmail.com wrote:
- /* test FindWindow behavior */
- SetLastError(0xdeadbeef);
- HWND hWnd = FindWindow("SomeWindowThatDoesNotExist", NULL);
- if(hWnd) {
printf("hWnd not NULL");
- }
- else {
todo_wine
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "ERROR_FILE_NOT_FOUND,
got %d\n", GetLastError());
- }
Why did you remove the comment? Introducing 'hWnd' variable is not needed, there is one already called 'found', besides declaring variables in the code is not allowed in Wine. It would be much simpler to add the last error test to 2 existing FindWindowExA calls instead of introducing something looking as foreign code (in indentation, braces usage and spaces).
-- Dmitry.
Thanks for the comments! Here's an updated patch. Passes in Win2K.
Hi Austin,
+ found = FindWindow("SomeWindowThatDoesNotExist", NULL); + if(found) { + printf("found not NULL"); + }
Please don't use printf in the tests. If you must log something, use trace, but I don't think it's that useful in this case, since we really expect it not to be found. --Juan
"Austin English" austinenglish@gmail.com wrote:
Thanks for the comments! Here's an updated patch. Passes in Win2K.
This still doesn't look ok to me (missing SetLastError beforehand, indentation, spacing, braces). There is no need to add a new test, just add the SetLastError(0xdeadbeef) call before an existing FindWindowExA call which is expected to fail and check last error value later on.