Hi,
I'm planning to add a test in the wine test suite and I noticed a difference.
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 ?
Thanks
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
On 05/27/2012 05:08 PM, Juan Lang wrote:
<snip> 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.
So my plan is to submit my test to the WineTestBot and see if some Windows version complain.
FYI, I've read [1] from [2] and the content seems to be a bit outdated / not complete. Documenting is not funniest part but would also help GSoC people.
Anyway, thanks for the explanation and the historical part, it makes sense now. --- [1] : http://www.winehq.org/docs/winedev-guide/testing [2] : http://wiki.winehq.org/ConformanceTests