Testing edge cases and undocumented behavior

Reece Dunn msclrhd at googlemail.com
Fri Aug 26 06:38:39 CDT 2011

On 26 August 2011 11:53,  <Joerg-Cyril.Hoehle at t-systems.com> wrote:
> Vincent Povirk wrote:
>>A test that passes on Windows and fails on Wine is not sufficient to
>>motivate a change to Wine.
> I wished Wine had "wine_dont" beside "todo_wine".  Exact same
> behaviour, it justs reads differently.
> 2 examples:
> mmdevapi has a bug where after Initialize(SHARED, unsupported_format)
> is returned with an error, Initialize(SHARED, supported_format) fails
> with ALREADY_INITIALIZED, yet the device is unusable.  I've written
> tests to detect this, because I want to know if MS fixes that in w8,
> but I don't advise Wine to mimic that behavior now.
> if (mode == SHARED && ...) wine_dont
>    ok(hr == E_ALREADY_INITIALIZED, "Initialize #2 returned %08u\n", hr);
> else
>    ok(hr == S_OK, "Initialize #2 returned %08u\n", hr);
> Should MS fix the apparent bug, remove the 3 topmost lines.
> The MIDI player MCISEQ.DLL was obviously rewritten for NT: my tests
> reveal numerous differences in the details.  Most visible: the
> MCI_RESUME command was dropped.  In w9x, an app could implement:
> if (window_msg == lost_focus)
>  mciSendCommand("Pause all");
> if (window_msg == got_focus)
>  mciSendCommand("Resume all");
> and it would continue playing A/V where it left off.  Since NT/XP,
> it'll loose music after its window is activated again.
> Wine's MCI supports the Resume command, presumably because it was
> written in 1999.  I've put some todo_wine in the MCI tests that should
> read wine_dont instead of todo_wine because I don't want somebody to
> come by and "fix" the deviation from XP by dropping the Resume command.


I like the basic concept behind this idea -- documenting buggy or old
behaviour that wine should not emulate. But isn't that what broken is

if (mode == SHARED && ...)
   ok(broken(hr == E_ALREADY_INITIALIZED) /* Windows mmdevapi is
broken! */ || hr == S_OK, "Initialize #2 returned %08u\n", hr);
   ok(hr == S_OK, "Initialize #2 returned %08u\n", hr);

Similar thing for the resume all tests.

This has advantages over todo_wine in that wine ignores the
broken(...) part so you enforce the other correct behaviour instead of
skipping that test (with todo_wine, wine could support any behaviour
and the test will still be orange; with broken, if wine supports
anything other than the non-broken behaviour the test will fail).

- Reece

More information about the wine-devel mailing list