Hi Alexandre,
On Sun, May 27, 2012 at 6:22 AM, GOUJON Alexandre ale.goujon@gmail.com wrote:
Some tests call directly the function by its name (i.e. GetWindowsDirectory, CreateFileA, CloseHandle...) while others declare a pointer to the function (prefixing its name by 'p' and followed by a capital letter) retrieved via GetProcAddress.
I know that tests have been written by lots of different people at different times and the general rule is "follow the style of the test file to be consistent" but here, both styles exist in the same file (kernel32/tests/volume.c).
Is there any rule concerning using func over pFunc ? Is it related to the module it comes from ?
Basically, if the function is available on all versions of Windows that the test bot runs on, use func. If it's not available on some versions, and you need to test whether it's available to avoid a non-running test, use pFunc instead.
Regarding the history, a lot of the usage of pFunc in the tests is for Windows 95/98/ME, which we no longer test on, so their continued use is "legacy." That's not true in all cases, e.g. often a function wasn't available in Windows NT 4.0 either. --Juan