[PATCH 2/2] urlmon/tests: Make http protocol tests refractory to timing issues.

Misha Koshelev mk144210 at bcm.edu
Fri Jul 27 00:44:33 CDT 2007

Pass on Win98 & WinXP, and are consistent for me on wine as well as wine with native wininet and urlmon.
Hopefully will be consistent on Alexandre's machine as well :)

Basically I believe the event based model is powerful here because we are specifying the exact behavior
we expect (rather than say doing CHECK_EXPECT2 for Switch which does not clear the expect_Switch BOOL
variable and thus states we expect Switch calls to occur but does not exactly narrow it down to when
we expect them).

My only possible timing concerns, which can be addressed if they come up, are the ok's after the
reads check the value of *called but really the value is important exactly at the time of the Read
and not a few milliseconds afterwards when the functions could already have been called; however, the
chances of this occuring I believe are quite small and the added power of the tests I believe is valuable. 
Additionally, the Sleep(100) after the Terminate function I believe is adequately explained with a comment.

Also I tried playing with the structure of all the if (bindf & BINDF_FROMURLMON) ...(Switch) else ...(ReportData)
doing it in plain C with *expect and *called pointers, but at least to me this ended up looking even
uglier than the if else syntax with macros, so I left it as is.
 dlls/urlmon/tests/protocol.c |  220 +++++++++++++++++++-----------------------
 1 files changed, 98 insertions(+), 122 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2e49e686491a2a0e020ab4aa856bc1b202458c23.diff
Type: text/x-patch
Size: 10890 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070727/3c9efc8b/2e49e686491a2a0e020ab4aa856bc1b202458c23-0001.bin

More information about the wine-patches mailing list