[PATCH try2 1/3] setupapi/tests: Add rudimentary tests for InstallHinfSectionA/W.

James Hawkins truiken at gmail.com
Tue Jun 12 01:10:57 CDT 2007


On 6/11/07, Misha Koshelev <mk144210 at bcm.edu> wrote:
> Changes from previous version in patch 1:
> * Comments to explain why this conformance test cannot be quite standard - see Notes comment @ beginning
> * Try A function first - I decided that since the A function works on Win98 but not WinXP it is the one
>   "broken" (reminder: W works on XP but not 98)
> * Added asserts in helper _InstallHinfSection function to verify A/W function pointers to make sure that
>   in the future useW is not misassigned (currently it is assigned properly in START_TEST(install) section as
>   it was in previous version).
> * Changed test_install to ok_install to make its purpose more clear. Specifically, the idea is that
>   ok_install does the actual install and checks that everything is installed properly, whereas
>   test_InstallHinfSection allows us to try using the _InstallHinfSection functions (through ok_install) in
>   various ways to test effects of parameters on the installation (e.g., see patch 2)
> * Use property of the "stub" functions of not changing last error to determine which function is stub instead
>   of using registry checks
>
> Hopefully this patchset is clearer.
>

This would still be clearer and more efficient if you set up a
function pointer at the beginning of the tests, and just use that
function for the rest of the tests.  You make a helper function that
tests which version (A or W) works, and assign the working version to
the function pointer.  This way, you don't have to deal with a useW
variable, or any of that mess, and other people can write direct tests
without having to use ok_install (which really shouldn't be needed if
you use a function pointer).  Keep in mind you'll have to use void
pointers for the string parameters when declaring the function pointer
type.

-- 
James Hawkins



More information about the wine-devel mailing list