Commit ff13146e authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

hlink/tests: Repair test to work as intended.

parent 906c9639
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment