Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- v2: Remove errant trace() and call CloseHandle() sooner.
dlls/kernel32/tests/console.c | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 918ecac8ac4..6b723c3d6c8 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -973,6 +973,83 @@ static void testScreenBuffer(HANDLE hConOut) SetConsoleOutputCP(oldcp); }
+static void test_new_screen_buffer_color_attributes(HANDLE hConOut) +{ + CONSOLE_SCREEN_BUFFER_INFOEX csbi, csbi2; + BOOL ret; + HANDLE hConOut2; + WORD orig_attr, orig_popup, attr; + + csbi.cbSize = csbi2.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX); + + ret = GetConsoleScreenBufferInfoEx(hConOut, &csbi); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + orig_attr = csbi.wAttributes; + orig_popup = csbi.wPopupAttributes; + + hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + + ret = GetConsoleScreenBufferInfoEx(hConOut2, &csbi2); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + CloseHandle(hConOut2); + + todo_wine ok(csbi2.wAttributes == orig_attr, "Character Attributes should have been copied: " + "got %#x, expected %#x\n", csbi2.wAttributes, orig_attr); + todo_wine ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n"); + todo_wine ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n"); + + /* Test different Character Attributes */ + attr = FOREGROUND_BLUE|BACKGROUND_GREEN; + ret = SetConsoleTextAttribute(hConOut, attr); + ok(ret, "SetConsoleTextAttribute failed: error %u\n", GetLastError()); + + hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + + memset(&csbi2, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFOEX)); + csbi2.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX); + + ret = GetConsoleScreenBufferInfoEx(hConOut2, &csbi2); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + CloseHandle(hConOut2); + + todo_wine ok(csbi2.wAttributes == attr, "Character Attributes should have been copied: " + "got %#x, expected %#x\n", csbi2.wAttributes, attr); + todo_wine ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n"); + todo_wine ok(csbi2.wPopupAttributes == attr, "Popup Attributes should match Character Attributes\n"); + + ret = SetConsoleTextAttribute(hConOut, orig_attr); + ok(ret, "SetConsoleTextAttribute failed: error %u\n", GetLastError()); + + /* Test inheritance of different Popup Attributes */ + csbi.wPopupAttributes = attr; + ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi); + ok(ret, "SetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + + hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + + memset(&csbi2, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFOEX)); + csbi2.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX); + + ret = GetConsoleScreenBufferInfoEx(hConOut2, &csbi2); + ok(ret, "GetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); + CloseHandle(hConOut2); + + todo_wine ok(csbi2.wAttributes == orig_attr, "Character Attributes should have been copied: " + "got %#x, expected %#x\n", csbi2.wAttributes, orig_attr); + todo_wine ok(csbi2.wPopupAttributes != orig_popup, "Popup Attributes should not match original value\n"); + todo_wine ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n"); + + csbi.wPopupAttributes = orig_popup; + ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi); + ok(ret, "SetConsoleScreenBufferInfoEx failed: error %u\n", GetLastError()); +} + static void CALLBACK signaled_function(void *p, BOOLEAN timeout) { HANDLE event = p; @@ -4506,6 +4583,7 @@ START_TEST(console) testScroll(hConOut, sbi.dwSize); /* will test sb creation / modification / codepage handling */ if (!test_current) testScreenBuffer(hConOut); + test_new_screen_buffer_color_attributes(hConOut); /* Test waiting for a console handle */ testWaitForConsoleInput(hConIn); test_wait(hConIn, hConOut);
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- dlls/kernel32/tests/console.c | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 6b723c3d6c8..9fa0ce06854 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -973,6 +973,58 @@ static void testScreenBuffer(HANDLE hConOut) SetConsoleOutputCP(oldcp); }
+static void test_new_screen_buffer_properties(HANDLE hConOut) +{ + BOOL ret; + HANDLE hConOut2; + CONSOLE_FONT_INFOEX cfi, cfi2; + CONSOLE_SCREEN_BUFFER_INFO csbi, csbi2; + + /* Font information */ + cfi.cbSize = cfi2.cbSize = sizeof(CONSOLE_FONT_INFOEX); + + ret = GetCurrentConsoleFontEx(hConOut, FALSE, &cfi); + ok(ret, "GetCurrentConsoleFontEx failed: error %u\n", GetLastError()); + + hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + + ret = GetCurrentConsoleFontEx(hConOut2, FALSE, &cfi2); + ok(ret, "GetCurrentConsoleFontEx failed: error %u\n", GetLastError()); + CloseHandle(hConOut2); + + ok(cfi2.nFont == cfi.nFont, "Font index should match: " + "got %u, expected %u\n", cfi2.nFont, cfi.nFont); + ok(cfi2.dwFontSize.X == cfi.dwFontSize.X, "Font width should match: " + "got %d, expected %d\n", cfi2.dwFontSize.X, cfi.dwFontSize.X); + ok(cfi2.dwFontSize.Y == cfi.dwFontSize.Y, "Font height should match: " + "got %d, expected %d\n", cfi2.dwFontSize.Y, cfi.dwFontSize.Y); + ok(cfi2.FontFamily == cfi.FontFamily, "Font family should match: " + "got %u, expected %u\n", cfi2.FontFamily, cfi.FontFamily); + ok(cfi2.FontWeight == cfi.FontWeight, "Font weight should match: " + "got %u, expected %u\n", cfi2.FontWeight, cfi.FontWeight); + ok(!lstrcmpW(cfi2.FaceName, cfi.FaceName), "Font name should match: " + "got %s, expected %s\n", wine_dbgstr_w(cfi2.FaceName), wine_dbgstr_w(cfi.FaceName)); + + /* Display window size */ + ret = GetConsoleScreenBufferInfo(hConOut, &csbi); + ok(ret, "GetConsoleScreenBufferInfo failed: error %u\n", GetLastError()); + + hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + ok(hConOut2 != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: error %u\n", GetLastError()); + + ret = GetConsoleScreenBufferInfo(hConOut2, &csbi2); + ok(ret, "GetConsoleScreenBufferInfo failed: error %u\n", GetLastError()); + CloseHandle(hConOut2); + + ok(csbi2.srWindow.Left == csbi.srWindow.Left, "Left coordinate should match\n"); + ok(csbi2.srWindow.Top == csbi.srWindow.Top, "Top coordinate should match\n"); + ok(csbi2.srWindow.Right == csbi.srWindow.Right, "Right coordinate should match\n"); + ok(csbi2.srWindow.Bottom == csbi.srWindow.Bottom, "Bottom coordinate should match\n"); +} + static void test_new_screen_buffer_color_attributes(HANDLE hConOut) { CONSOLE_SCREEN_BUFFER_INFOEX csbi, csbi2; @@ -4583,6 +4635,7 @@ START_TEST(console) testScroll(hConOut, sbi.dwSize); /* will test sb creation / modification / codepage handling */ if (!test_current) testScreenBuffer(hConOut); + test_new_screen_buffer_properties(hConOut); test_new_screen_buffer_color_attributes(hConOut); /* Test waiting for a console handle */ testWaitForConsoleInput(hConIn);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94336
Your paranoid android.
=== w2008s64 (64 bit report) ===
kernel32: console.c:3304: Test failed: expected INVALID_FILE_SIZE, got 0x1000
On Wed, 21 Jul 2021 at 22:48, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94336
Your paranoid android.
=== w2008s64 (64 bit report) ===
kernel32: console.c:3304: Test failed: expected INVALID_FILE_SIZE, got 0x1000
This failure is unrelated to the new tests.
Signed-off-by: Jacek Caban jacek@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94335
Your paranoid android.
=== w2008s64 (64 bit report) ===
kernel32: console.c:3252: Test failed: expected INVALID_FILE_SIZE, got 0x1000
On Wed, 21 Jul 2021 at 22:40, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94335
Your paranoid android.
=== w2008s64 (64 bit report) ===
kernel32: console.c:3252: Test failed: expected INVALID_FILE_SIZE, got 0x1000
This failure is unrelated to the new tests.
On 7/21/21 3:23 PM, Hugh McMaster wrote:
On Wed, 21 Jul 2021 at 22:40, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94335
Your paranoid android.
=== w2008s64 (64 bit report) ===
kernel32: console.c:3252: Test failed: expected INVALID_FILE_SIZE, got 0x1000
This failure is unrelated to the new tests.
Yes. At this point I don't see a point in fixing Vista/win2008 test failures. I'm hoping that we can finally get rid of them from TestBot.
Thanks,
Jacek
On Wed, 21 Jul 2021, Jacek Caban wrote: [...]
=== w2008s64 (64 bit report) ===
kernel32: console.c:3252: Test failed: expected INVALID_FILE_SIZE, got 0x1000
This failure is unrelated to the new tests.
Yes. At this point I don't see a point in fixing Vista/win2008 test failures.
Too bad this failure happens on Windows 7 too then!
console.c:3304: Test failed: expected INVALID_FILE_SIZE, got 0x20000
https://test.winehq.org/data/c518a5362b925379b1a79e8323d60e19863effc1/win7_n...
I'm hoping that we can finally get rid of them from TestBot.
That's out of my hands.
On Fri, 23 Jul 2021, Jacek Caban wrote:
On 7/23/21 1:13 PM, Francois Gouget wrote:
I'm hoping that we can finally get rid of them from TestBot.
That's out of my hands.
Okay, whom should I contact about it then?
I don't know. That does not seem to be documented anywwhere.
In the distant past that decision came in the form of a winetest/dissect patch turning on the 'prediluvian' flag for the obsolete platforms. For instance:
commit 0cbab747e7aed09af9e32d5d7a41b16b69881a72 Author: Michael Stefaniuc mstefani@redhat.de AuthorDate: Wed Feb 5 22:33:56 2014 +0100
winetest: Reject test runs from NT3 and NT4 versions.
If I remember correctly the last time it was in the form of a comment on IRC by Alexandre. (And I think as a result the prediluvian flag was never turned on for XP and 2003 so that such results would presumably still be accepted.)
So in both cases I guess one could say Alexandre is the one who made that kind of decision.
On 7/23/21 4:42 PM, Francois Gouget wrote:
On Fri, 23 Jul 2021, Jacek Caban wrote:
On 7/23/21 1:13 PM, Francois Gouget wrote:
I'm hoping that we can finally get rid of them from TestBot.
That's out of my hands.
Okay, whom should I contact about it then?
I don't know. That does not seem to be documented anywwhere.
In the distant past that decision came in the form of a winetest/dissect patch turning on the 'prediluvian' flag for the obsolete platforms. For instance:
commit 0cbab747e7aed09af9e32d5d7a41b16b69881a72 Author: Michael Stefaniucmstefani@redhat.de AuthorDate: Wed Feb 5 22:33:56 2014 +0100
winetest: Reject test runs from NT3 and NT4 versions.
Thanks for the info. An analogous patch has been committed yesterday. I think that VM roles will need to be adjusted for that now.
Jacek
On Wed, 28 Jul 2021, Jacek Caban wrote: [...]
commit 0cbab747e7aed09af9e32d5d7a41b16b69881a72 Author: Michael Stefaniucmstefani@redhat.de AuthorDate: Wed Feb 5 22:33:56 2014 +0100
winetest: Reject test runs from NT3 and NT4 versions.
Thanks for the info. An analogous patch has been committed yesterday. I think that VM roles will need to be adjusted for that now.
Yes. I saw the commit and updated the VM roles.