[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH v2] kernel32/tests: Add more tests for GetConsoleFontInfo
From:       Hugh McMaster <hugh.mcmaster () outlook ! com>
Date:       2016-04-29 13:55:33
Message-ID: HK2PR03MB0242D606AFE11872B2046B6AF2660 () HK2PR03MB0242 ! apcprd03 ! prod ! outlook ! com
[Download RAW message or body]

On Friday, 29 April 2016 11:40 PM, Hugh McMaster wrote:

>On Friday, 29 April 2016 11:07 PM, Sebastian Lackner wrote:
>
>On 29.04.2016 13:29, Hugh McMaster wrote:
>>>      SetLastError(0xdeadbeef);
>>>      ret = pGetConsoleFontInfo(NULL, FALSE, 0, cfi);
>>>      ok(!ret, "got %d, expected zero\n", ret);
>>>      todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
>>> +    ok(!cfi[0].nFont, "got %d, expected 0\n", cfi[0].nFont);
>>> +    ok(!cfi[0].dwFontSize.X, "got %d, expected 0\n", cfi[0].dwFontSize.X);
>>> +    ok(!cfi[0].dwFontSize.Y, "got %d, expected 0\n", cfi[0].dwFontSize.Y);
>>
>> Those tests do not add much value. Without initializing cfi before each call,
>> its impossible to tell if GetConsoleFontInfo() nulled the struct or if it wasn't
>> touched at all. However, I'm also not sure if we have to care about the struct
>> content in case of a failure.
>
>The values in the struct weren't altered from zero after the first failed call. But I take your point.
>I'll try memset-ing another value and checking the returned values.

I tried doing a memset with values 1, 5 and 10. Each test returned junk values.
Only a memset with zero did not return a junk value (as in the original patch).

So it definitely looks as though GetConsoleFontInfo does not null the struct on error or before
performing an operation. In this case, I'll remove those !cfi[0].element tests.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic