dlls/oleaut32: add tests for OleLoadPictureFile(Ex)

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Tue Nov 18 02:45:53 CST 2008


Am Montag, den 17.11.2008, 23:48 -0800 schrieb Jeremy Drake:
> Date: Mon, 17 Nov 2008 23:46:34 -0800
> Subject: add tests for behavior of OleLoadPictureFile(Ex) on Windows, and actually
> define OleLoadPictureFile and OleLoadPictureFileEx (returning E_NOTIMPL right now)
> so these tests can build
Looks OK to me, but what happened to your finding about
INET_E_RESOURCE_NOT_FOUND? Was it a red herring?

> I ended up having to add OleLoadPicutreFile and OleLoadPictureFileEx to
> the .spec and .c files as actual functions (for now just returning
> E_NOTIMPL) in order to get the test to even compile.
Might be that they don't appear in the ELF export table otherwise, and
as we don't crossbuild the tests, the imports are done by the ELF
linker/loader. BTW: In general, if you add stubs like this, please add a
FIXME call showing the parameters and saying stub.

> +        if (disp != NULL)
> +        {
> +            pict = NULL;
> +            hr = IDispatch_QueryInterface(disp, &IID_IPicture, (LPVOID*)&pict);
> +            ok(hr == S_OK, "hr %08x\n", hr);
> +            ok(pict != NULL, "pict ptr\n");
> +
> +            if (pict != NULL)
> +            {
> +                hr = IPicture_get_Type(pict, &type);
> +                ok(hr == S_OK, "hr %08x\n", hr);
> +                ok(type == PICTYPE_NONE, "type %d\n", type);
> +
> +                IPicture_Release(pict);
> +            }
> +            IDispatch_Release(disp);
> +        }
This fragment repeats over and over, sometimes with PICTYPE_BITMAP
instead. Might be worth refactoring that into a function. todo_wine
works for function boundaries. If you refactor, you should pass that
function __LINE__ information and print it in your OK calls to know
which of the tests is failing if something fails.

> +            disp = NULL;
> +            todo_wine
> +            {
> +                hr = OleLoadPictureFile(varFilename, &disp);
> +                ok(hr == CTL_E_PATHNOTFOUND, "hr %08x\n", hr);
> +            }
> +            ok(disp == NULL, "dispatch ptr\n");
You do a lot of tests like this. Setting disp to "(void*)0xdeadbeef"
instead before allows you to differentiate between disp unmodified and
disp explicitly set to zero.

> +    V_VT(&varFilename) = VT_I4;
> +    V_I4(&varFilename) = 33;
[...]
> +                ok(type == PICTYPE_BITMAP, "type %d\n", type);
Ah! VariantChangeType, as suspected.

Regards,
  Michael Karcher




More information about the wine-patches mailing list