activeds/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fb3b849321
commit
45399c9c38
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = activeds.dll
|
||||
IMPORTS = ole32 oleaut32 activeds
|
||||
|
||||
|
|
|
@ -41,46 +41,46 @@ static void test_ADsBuildVarArrayStr(void)
|
|||
LONG start, end, idx;
|
||||
|
||||
hr = ADsBuildVarArrayStr(NULL, 0, NULL);
|
||||
ok(hr == E_ADS_BAD_PARAMETER || hr == E_FAIL /* XP */, "got %#x\n", hr);
|
||||
ok(hr == E_ADS_BAD_PARAMETER || hr == E_FAIL /* XP */, "got %#lx\n", hr);
|
||||
|
||||
hr = ADsBuildVarArrayStr(NULL, 0, &var);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(V_VT(&var) == (VT_ARRAY | VT_VARIANT), "got %d\n", V_VT(&var));
|
||||
start = 0xdeadbeef;
|
||||
hr = SafeArrayGetLBound(V_ARRAY(&var), 1, &start);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(start == 0, "got %d\n", start);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(start == 0, "got %ld\n", start);
|
||||
end = 0xdeadbeef;
|
||||
hr = SafeArrayGetUBound(V_ARRAY(&var), 1, &end);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(end == -1, "got %d\n", end);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(end == -1, "got %ld\n", end);
|
||||
VariantClear(&var);
|
||||
|
||||
hr = ADsBuildVarArrayStr((LPWSTR *)props, ARRAY_SIZE(props), &var);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(V_VT(&var) == (VT_ARRAY | VT_VARIANT), "got %d\n", V_VT(&var));
|
||||
start = 0xdeadbeef;
|
||||
hr = SafeArrayGetLBound(V_ARRAY(&var), 1, &start);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(start == 0, "got %d\n", start);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(start == 0, "got %ld\n", start);
|
||||
end = 0xdeadbeef;
|
||||
hr = SafeArrayGetUBound(V_ARRAY(&var), 1, &end);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(end == 1, "got %d\n", end);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(end == 1, "got %ld\n", end);
|
||||
idx = 0;
|
||||
hr = SafeArrayGetElement(V_ARRAY(&var), &idx, &item);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(V_VT(&item) == VT_BSTR, "got %d\n", V_VT(&item));
|
||||
ok(!lstrcmpW(V_BSTR(&item), L"prop1"), "got %s\n", wine_dbgstr_w(V_BSTR(&item)));
|
||||
VariantClear(&item);
|
||||
hr = SafeArrayAccessData(V_ARRAY(&var), (void *)&data);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(V_VT(&data[0]) == VT_BSTR, "got %d\n", V_VT(&data[0]));
|
||||
ok(!lstrcmpW(V_BSTR(&data[0]), L"prop1"), "got %s\n", wine_dbgstr_w(V_BSTR(&data[0])));
|
||||
ok(V_VT(&data[0]) == VT_BSTR, "got %d\n", V_VT(&data[0]));
|
||||
ok(!lstrcmpW(V_BSTR(&data[1]), L"prop2"), "got %s\n", wine_dbgstr_w(V_BSTR(&data[1])));
|
||||
hr = SafeArrayUnaccessData(V_ARRAY(&var));
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
VariantClear(&var);
|
||||
}
|
||||
|
||||
|
@ -93,68 +93,68 @@ static void test_Pathname(void)
|
|||
LONG count, i;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_Pathname, 0, CLSCTX_INPROC_SERVER, &IID_IADsPathname, (void **)&path);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
hr = IADsPathname_GetNumElements(path, &count);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(count == 0, "got %d\n", count);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(count == 0, "got %ld\n", count);
|
||||
|
||||
bstr = NULL;
|
||||
hr = IADsPathname_Retrieve(path, ADS_FORMAT_X500, &bstr);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(bstr && !wcscmp(bstr, L"LDAP://"), "got %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
bstr = SysAllocString(L"LDAP://sample");
|
||||
hr = IADsPathname_Set(path, bstr, ADS_SETTYPE_FULL);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
SysFreeString(bstr);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
hr = IADsPathname_GetNumElements(path, &count);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(count == 0, "got %d\n", count);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(count == 0, "got %ld\n", count);
|
||||
|
||||
hr = IADsPathname_GetElement(path, 0, &bstr);
|
||||
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_INDEX), "got %#x\n", hr);
|
||||
ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_INDEX), "got %#lx\n", hr);
|
||||
SysFreeString(bstr);
|
||||
|
||||
bstr = SysAllocString(L"LDAP://sample:123/a=b,c=d,e=f");
|
||||
hr = IADsPathname_Set(path, bstr, ADS_SETTYPE_FULL);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
SysFreeString(bstr);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
hr = IADsPathname_GetNumElements(path, &count);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(count == 3, "got %d\n", count);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(count == 3, "got %ld\n", count);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
hr = IADsPathname_GetElement(path, i, &bstr);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(!wcscmp(bstr, elem[i]), "%u: %s\n", i, wine_dbgstr_w(bstr));
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(!wcscmp(bstr, elem[i]), "%lu: %s\n", i, wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
}
|
||||
|
||||
hr = IADsPathname_Retrieve(path, ADS_FORMAT_X500, &bstr);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(!wcscmp(bstr, L"LDAP://sample:123/a=b,c=d,e=f"), "got %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
hr = IADsPathname_Retrieve(path, ADS_FORMAT_PROVIDER, &bstr);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(!wcscmp(bstr, L"LDAP"), "got %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
hr = IADsPathname_Retrieve(path, ADS_FORMAT_SERVER, &bstr);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(!wcscmp(bstr, L"sample:123"), "got %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
hr = IADsPathname_Retrieve(path, ADS_FORMAT_LEAF, &bstr);
|
||||
ok(hr == S_OK, "got %#x\n", hr);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(!wcscmp(bstr, L"a=b"), "got %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue