From ff13146e92e2baa3b6f949143a9bc6ab625f9352 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 28 Dec 2009 17:40:52 -0600 Subject: [PATCH] hlink/tests: Repair test to work as intended. --- dlls/hlink/tests/browse_ctx.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dlls/hlink/tests/browse_ctx.c b/dlls/hlink/tests/browse_ctx.c index e9806b881c9..483f604645d 100644 --- a/dlls/hlink/tests/browse_ctx.c +++ b/dlls/hlink/tests/browse_ctx.c @@ -41,17 +41,23 @@ static void test_SetInitialHlink(void) IMoniker *dummy, *found_moniker; IBindCtx *bindctx; WCHAR one[] = {'1',0}; - WCHAR friend[] = {'f','r','i','e','n','d',0}; - WCHAR *found_name; + WCHAR five[] = {'5',0}; + WCHAR *found_name, *exp_name; HRESULT hres; - hres = CreateItemMoniker(one, one, &dummy); + hres = CreateBindCtx(0, &bindctx); + ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres); + + hres = CreateItemMoniker(one, five, &dummy); ok(hres == S_OK, "CreateItemMoniker failed: 0x%08x\n", hres); + hres = IMoniker_GetDisplayName(dummy, bindctx, NULL, &exp_name); + ok(hres == S_OK, "GetDisplayName failed: 0x%08x\n", hres); + hres = HlinkCreateBrowseContext(NULL, &IID_IHlinkBrowseContext, (void**)&bc); ok(hres == S_OK, "HlinkCreateBrowseContext failed: 0x%08x\n", hres); - hres = IHlinkBrowseContext_SetInitialHlink(bc, dummy, one, friend); + hres = IHlinkBrowseContext_SetInitialHlink(bc, dummy, one, NULL); ok(hres == S_OK, "SetInitialHlink failed: 0x%08x\n", hres); hres = IHlinkBrowseContext_GetHlink(bc, HLID_CURRENT, &found_hlink); @@ -60,12 +66,9 @@ static void test_SetInitialHlink(void) hres = IHlink_GetMonikerReference(found_hlink, HLINKGETREF_DEFAULT, &found_moniker, NULL); ok(hres == S_OK, "GetMonikerReference failed: 0x%08x\n", hres); - hres = CreateBindCtx(0, &bindctx); - ok(hres == S_OK, "CreateBindCtx failed: 0x%08x\n", hres); - hres = IMoniker_GetDisplayName(found_moniker, bindctx, NULL, &found_name); ok(hres == S_OK, "GetDisplayName failed: 0x%08x\n", hres); - ok(strcmp_ww(found_name, friend), "Found display name should not have been %s\n", wine_dbgstr_w(friend)); + ok(!strcmp_ww(found_name, exp_name), "Found display name should have been %s, was: %s\n", wine_dbgstr_w(exp_name), wine_dbgstr_w(found_name)); IBindCtx_Release(bindctx); IMoniker_Release(found_moniker);