Nikolay Sivov : oleaut32/tests: Fix a test crash on some XP SP1 VM.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 23 11:21:02 CDT 2016


Module: wine
Branch: master
Commit: 1c3127c68d52c431011d1d9ce5213bae5763adf0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1c3127c68d52c431011d1d9ce5213bae5763adf0

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Mar 23 13:06:37 2016 +0300

oleaut32/tests: Fix a test crash on some XP SP1 VM.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/tests/typelib.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index fcce92e..b795d52 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -5710,19 +5710,23 @@ static void test_LoadRegTypeLib(void)
     hr = LoadRegTypeLib(&LIBID_TestTypelib, 1, 7, LOCALE_NEUTRAL, &tl);
     ok(hr == TYPE_E_LIBNOTREGISTERED, "got 0x%08x\n", hr);
 
+    tl = NULL;
     hr = LoadRegTypeLib(&LIBID_TestTypelib, 0xffff, 0xffff, LOCALE_NEUTRAL, &tl);
     ok(hr == S_OK, "got 0x%08x\n", hr);
 
-    hr = ITypeLib_GetLibAttr(tl, &attr);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    if (tl)
+    {
+        hr = ITypeLib_GetLibAttr(tl, &attr);
+        ok(hr == S_OK, "got 0x%08x\n", hr);
 
-    ok(attr->lcid == 0, "got %x\n", attr->lcid);
-    ok(attr->wMajorVerNum == 2, "got %d\n", attr->wMajorVerNum);
-    ok(attr->wMinorVerNum == 5, "got %d\n", attr->wMinorVerNum);
-    ok(attr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "got %x\n", attr->wLibFlags);
+        ok(attr->lcid == 0, "got %x\n", attr->lcid);
+        ok(attr->wMajorVerNum == 2, "got %d\n", attr->wMajorVerNum);
+        ok(attr->wMinorVerNum == 5, "got %d\n", attr->wMinorVerNum);
+        ok(attr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "got %x\n", attr->wLibFlags);
 
-    ITypeLib_ReleaseTLibAttr(tl, attr);
-    ITypeLib_Release(tl);
+        ITypeLib_ReleaseTLibAttr(tl, attr);
+        ITypeLib_Release(tl);
+    }
 
     DeleteFileA("test_actctx_tlb.tlb");
     DeleteFileA("test_actctx_tlb2.tlb");




More information about the wine-cvs mailing list