Commit f7c9d08d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

opcservices/uri: Fix IsEqual() to work with OPC URI objects.

parent 06fd9bb3
......@@ -521,7 +521,7 @@ static void test_rel_part_uri(void)
IOpcPartUri *rel_uri2;
IOpcUri *source_uri2;
IUnknown *unk = NULL;
BOOL ret = FALSE;
BOOL ret;
BSTR str;
hr = IOpcPartUri_GetSourceUri(rel_uri, &source_uri);
......@@ -529,11 +529,20 @@ static void test_rel_part_uri(void)
hr = IOpcPartUri_GetSourceUri(rel_uri, &source_uri2);
ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr);
ok(source_uri != source_uri2, "Unexpected instance.\n");
hr = IOpcUri_IsEqual(source_uri, NULL, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
ret = 123;
hr = IOpcUri_IsEqual(source_uri, NULL, &ret);
ok(is_root ? hr == E_POINTER : hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(is_root ? ret == 123 : !ret, "Unexpected result.\n");
ret = FALSE;
hr = IOpcUri_IsEqual(source_uri, (IUri *)source_uri2, &ret);
todo_wine {
ok(SUCCEEDED(hr), "IsEqual failed, hr %#x.\n", hr);
ok(ret, "Expected equal uris.\n");
}
hr = IOpcUri_QueryInterface(source_uri, &IID_IOpcPartUri, (void **)&unk);
ok(hr == (is_root ? E_NOINTERFACE : S_OK), "Unexpected hr %#x, %s.\n", hr, rel_part_uri_tests[i].uri);
if (unk)
......
......@@ -312,7 +312,21 @@ static HRESULT WINAPI opc_uri_IsEqual(IOpcPartUri *iface, IUri *comparand, BOOL
TRACE("iface %p, comparand %p, is_equal %p.\n", iface, comparand, is_equal);
return IUri_IsEqual(uri->uri, comparand, is_equal);
if (!is_equal)
return E_POINTER;
if (!comparand)
{
if (uri->is_part_uri)
{
*is_equal = FALSE;
return S_OK;
}
return E_POINTER;
}
return IUri_IsEqual(comparand, uri->uri, is_equal);
}
static HRESULT WINAPI opc_uri_GetRelationshipsPartUri(IOpcPartUri *iface, IOpcPartUri **part_uri)
......
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