From: Hugh McMaster hugh.mcmaster@outlook.com
The Windows versions of [Read|Write]ConsoleOutput[Attribute|Character] appear to assign an uninitialized internal DWORD to the given pointer address before returning.
As the functions fail (intentionally) in these tests, the value of the DWORD is never set, so the tests end up comparing the expected value of zero with random values.
This value of this test is very limited and is best removed.
Fixes https://bugs.winehq.org/show_bug.cgi?id=53686 --- dlls/kernel32/tests/console.c | 36 ----------------------------------- 1 file changed, 36 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index c145aa4cb59..9eabd887f2c 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2347,12 +2347,6 @@ static void test_WriteConsoleOutputCharacterA(HANDLE output_handle) invalid_table[i].coord, invalid_table[i].lpNumCharsWritten); ok(!ret, "[%d] Expected WriteConsoleOutputCharacterA to return FALSE, got %d\n", i, ret); - if (invalid_table[i].lpNumCharsWritten) - { - ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %lu, got %lu\n", - i, invalid_table[i].expected_count, count); - } ok(GetLastError() == invalid_table[i].last_error, "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); @@ -2437,12 +2431,6 @@ static void test_WriteConsoleOutputCharacterW(HANDLE output_handle) invalid_table[i].coord, invalid_table[i].lpNumCharsWritten); ok(!ret, "[%d] Expected WriteConsoleOutputCharacterW to return FALSE, got %d\n", i, ret); - if (invalid_table[i].lpNumCharsWritten) - { - ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %lu, got %lu\n", - i, invalid_table[i].expected_count, count); - } ok(GetLastError() == invalid_table[i].last_error, "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); @@ -2527,12 +2515,6 @@ static void test_WriteConsoleOutputAttribute(HANDLE output_handle) invalid_table[i].coord, invalid_table[i].lpNumAttrsWritten); ok(!ret, "[%d] Expected WriteConsoleOutputAttribute to return FALSE, got %d\n", i, ret); - if (invalid_table[i].lpNumAttrsWritten) - { - ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %lu, got %lu\n", - i, invalid_table[i].expected_count, count); - } ok(GetLastError() == invalid_table[i].last_error, "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); @@ -2943,12 +2925,6 @@ static void test_ReadConsoleOutputCharacterA(HANDLE output_handle) invalid_table[i].coord, invalid_table[i].read_count); ok(!ret, "[%d] Expected ReadConsoleOutputCharacterA to return FALSE, got %d\n", i, ret); - if (invalid_table[i].read_count) - { - ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %lu, got %lu\n", - i, invalid_table[i].expected_count, count); - } ok(GetLastError() == invalid_table[i].last_error, "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); @@ -3033,12 +3009,6 @@ static void test_ReadConsoleOutputCharacterW(HANDLE output_handle) invalid_table[i].coord, invalid_table[i].read_count); ok(!ret, "[%d] Expected ReadConsoleOutputCharacterW to return FALSE, got %d\n", i, ret); - if (invalid_table[i].read_count) - { - ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %lu, got %lu\n", - i, invalid_table[i].expected_count, count); - } ok(GetLastError() == invalid_table[i].last_error, "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError()); @@ -3122,12 +3092,6 @@ static void test_ReadConsoleOutputAttribute(HANDLE output_handle) invalid_table[i].coord, invalid_table[i].read_count); ok(!ret, "[%d] Expected ReadConsoleOutputAttribute to return FALSE, got %d\n", i, ret); - if (invalid_table[i].read_count) - { - ok(count == invalid_table[i].expected_count, - "[%d] Expected count to be %lu, got %lu\n", - i, invalid_table[i].expected_count, count); - } ok(GetLastError() == invalid_table[i].last_error, "[%d] Expected last error to be %lu, got %lu\n", i, invalid_table[i].last_error, GetLastError());