pdh: add tests for XP variant of api call

Jeff Latimer lats at yless4u.com.au
Tue Sep 25 07:19:34 CDT 2007


Hans Leidekker wrote:
>> From this we should write tests to accept all values.  It would seem 
>> that the wine dll still needs to implement the API accurately, so you 
>> are saying, code the API correctly but make the tests generic?
>>     
>
> Quote from MSDN on PdhLookupPerfNameByIndex:
>
>  PDH_INVALID_ARGUMENT
>  A parameter is not valid or is incorrectly formatted. For example,
>  on some releases you could receive this error if the specified size
>  on input is greater than zero but less than the required size.
>   
I am happy with that though the tests I added relate to the following 
paragraph where it says that XP requires the buffer parameter as well as 
the size at all times and testing shows that it returns 
PDH_INVALID_ARGUMENT.  It also returns PDH_INSUFFICIENT_BUFFER instead 
of PDH_MORE_DATA.
> So we should accept this return value too. Our implemention is fine
> as-is because it still passes the test.
>   
I am not sure that I follow.  Each of the tests in the patch is there 
because they satisfied the returns from XP and failed on my platform.
> Note that there is another problem with the tests which is that
> performance counter names are localized but the tests assume that the
> current locale is English. I intend to fix this in my next batch of
> patches.
Sounds good.

BTW I can see that the tests could be merged into the existing tests so 
that the tests handle multiple situations.   It means that in some ways 
it means that conformance to particular release will not be specifically 
tested in wine and hence conformance will not be assured.  If that is 
the way ist done than thats ok. 

Jeff



More information about the wine-devel mailing list