Commit d6176429 authored by Alexandre Julliard's avatar Alexandre Julliard

ole32/tests: Avoid depending on the heap allocation order for the CoGetObjectContext test.

parent ee59879d
...@@ -1351,18 +1351,18 @@ static void test_CoGetContextToken(void) ...@@ -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) ...@@ -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();
} }
......
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