ADVAPI32: Start test for service tests

James Hawkins truiken at gmail.com
Mon May 21 16:58:37 CDT 2007


On 5/21/07, Rolf Kalbermatter <r.kalbermatter at hccnet.nl> wrote:
> James Hawkins [mailto:truiken at gmail.com] wrote:
>
> >+    ok(size <= 1, "size should be <= 1 was %d!", size);
> >
> >This is a bad test.  According to msdn, GetServiceDisplayName does not
> >modify lpcchBuffer on error, so size should be exactly 0.
>
> MSDN says a lot of things. On my XP SP2 it returns 1 as size when passed
> an empty service name. Also failing here is a bit ambigeuos since the
> dunction also fails when a NULL pointer is passed or the buffer is to
> small, but it does change the size into what it expects in these two
> cases.
>

...and msdn is wrong a lot, but that doesn't mean the check is right.
If the value you get is 1, then check exactly for 1.

> >+static BOOL test_service_info(SC_HANDLE hscm)
> >
> >test functions are void, not BOOL.  You're never going to do anything but
> >return, and there's no value >to check by the caller.
>
> I took this more or less directly from registry.c in the same directory.
>

No test function in registry.c returns BOOL, and to save you some time
replying, set_privileges is not a test function.  It's a helper
function.

> >+    ok(size, "size should be returned!");
> >
> >And what is the size?  Tests are supposed to be exact.  If our
> implementation
> >is incorrect, and we return size as 39491, that's certainly not correct,
> but
> >this test won't fail when it should.
>
> This won't work for localized Windows versions. The display name is possibly
> translated. Also, on XP SP2 the A function returns the size in ASCI chars
> that
> the W function will need in bytes. Not a behaviour I feel Wine should
> imitate
> without an app that would need that behaviour.
>

Huh?  The function, A or W, returns the number of TCHARS.  What
behavior should wine not imitate?  We don't ignore expected behavior
just because we doubt an app will depend on it, especiallly a behavior
that is so common.

> I'll be gone for two weeks for vacation. If anyone wants to continue on that
> please feel free. Otherwise I'll be picking this up afterwards.
>
> Rolf Kalbermatter
>
>


-- 
James Hawkins



More information about the wine-devel mailing list