Zebediah Figura : msi/tests: Improve COM test.

Alexandre Julliard julliard at winehq.org
Thu Apr 19 16:54:19 CDT 2018


Module: wine
Branch: master
Commit: fdb9bdc88b27ffdaea5ad31256f250b66bdf6b78
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fdb9bdc88b27ffdaea5ad31256f250b66bdf6b78

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Apr 18 18:40:01 2018 -0500

msi/tests: Improve COM test.

Test for a class that Wine actually supports, and also make sure our
apartment is uninitialized.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/tests/custom.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 9cf90dc..8d32348 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -24,8 +24,7 @@
 #include <windef.h>
 #include <winbase.h>
 #define COBJMACROS
-#include <objbase.h>
-#include <unknwn.h>
+#include <msxml.h>
 #include <msi.h>
 #include <msiquery.h>
 
@@ -248,14 +247,19 @@ UINT WINAPI main_test(MSIHANDLE hinst)
 {
     UINT res;
     IUnknown *unk = NULL;
-    HRESULT hres;
+    HRESULT hr;
 
     /* Test for an MTA apartment */
-    hres = CoCreateInstance(&CLSID_Picture_Metafile, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
-    todo_wine_ok(hinst, hres == S_OK, "CoCreateInstance failed with %08x\n", hres);
+    hr = CoCreateInstance(&CLSID_XMLDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
+    todo_wine_ok(hinst, hr == S_OK, "CoCreateInstance failed with %08x\n", hr);
 
     if (unk) IUnknown_Release(unk);
 
+    /* but ours is uninitialized */
+    hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+    ok(hinst, hr == S_OK, "got %#x\n", hr);
+    CoUninitialize();
+
     /* Test MsiGetDatabaseState() */
     res = MsiGetDatabaseState(hinst);
     todo_wine_ok(hinst, res == MSIDBSTATE_ERROR, "expected MSIDBSTATE_ERROR, got %u\n", res);




More information about the wine-cvs mailing list