ole32/tests: Avoid depending on the heap allocation order for the CoGetObjectContext test.
This commit is contained in:
parent
ee59879da0
commit
d617642999
|
@ -1351,18 +1351,18 @@ static void test_CoGetContextToken(void)
|
||||||
refs = IUnknown_AddRef((IUnknown *)token);
|
refs = IUnknown_AddRef((IUnknown *)token);
|
||||||
ok(refs == 1, "Expected 1, got %u\n", refs);
|
ok(refs == 1, "Expected 1, got %u\n", refs);
|
||||||
|
|
||||||
refs = IUnknown_Release((IUnknown *)token);
|
|
||||||
ok(refs == 0, "Expected 0, got %u\n", refs);
|
|
||||||
|
|
||||||
hr = pCoGetObjectContext(&IID_IObjContext, (void **)&ctx);
|
hr = pCoGetObjectContext(&IID_IObjContext, (void **)&ctx);
|
||||||
ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", hr);
|
ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", hr);
|
||||||
todo_wine ok(ctx == (IObjContext *)token, "Expected interface pointers to be the same\n");
|
todo_wine ok(ctx == (IObjContext *)token, "Expected interface pointers to be the same\n");
|
||||||
|
|
||||||
refs = IUnknown_AddRef((IUnknown *)ctx);
|
refs = IUnknown_AddRef((IUnknown *)ctx);
|
||||||
ok(refs == 2, "Expected 1, got %u\n", refs);
|
todo_wine ok(refs == 3, "Expected 3, got %u\n", refs);
|
||||||
|
|
||||||
refs = IUnknown_Release((IUnknown *)ctx);
|
refs = IUnknown_Release((IUnknown *)ctx);
|
||||||
ok(refs == 1, "Expected 0, got %u\n", refs);
|
todo_wine ok(refs == 2, "Expected 2, got %u\n", refs);
|
||||||
|
|
||||||
|
refs = IUnknown_Release((IUnknown *)token);
|
||||||
|
todo_wine ok(refs == 1, "Expected 1, got %u\n", refs);
|
||||||
|
|
||||||
/* CoGetContextToken does not add a reference */
|
/* CoGetContextToken does not add a reference */
|
||||||
token = 0;
|
token = 0;
|
||||||
|
@ -1377,6 +1377,9 @@ static void test_CoGetContextToken(void)
|
||||||
refs = IUnknown_Release((IUnknown *)ctx);
|
refs = IUnknown_Release((IUnknown *)ctx);
|
||||||
ok(refs == 1, "Expected 0, got %u\n", refs);
|
ok(refs == 1, "Expected 0, got %u\n", refs);
|
||||||
|
|
||||||
|
refs = IUnknown_Release((IUnknown *)ctx);
|
||||||
|
ok(refs == 0, "Expected 0, got %u\n", refs);
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue