Commit 63bcb0f6 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

adsldp/tests: Enable compilation with long types.

parent 45399c9c
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = adsldp.dll
IMPORTS = ole32 oleaut32 secur32 advapi32 activeds uuid
......
......@@ -48,7 +48,7 @@ static void test_ComputerName(void)
name_size = MAX_COMPUTERNAME_LENGTH + 1;
SetLastError(0xdeadbeef);
ret = GetComputerNameW(name, &name_size);
ok(ret, "GetComputerName error %u\n", GetLastError());
ok(ret, "GetComputerName error %lu\n", GetLastError());
/* Distinguished name (rfc1779) is supposed to look like this:
* "CN=COMPNAME,CN=Computers,DC=domain,DC=com"
......@@ -57,23 +57,23 @@ static void test_ComputerName(void)
size = 1024;
SetLastError(0xdeadbeef);
ret = GetComputerObjectNameW(NameFullyQualifiedDN, buf, &size);
ok(ret || GetLastError() == ERROR_CANT_ACCESS_DOMAIN_INFO, "GetComputerObjectName error %u\n", GetLastError());
ok(ret || GetLastError() == ERROR_CANT_ACCESS_DOMAIN_INFO, "GetComputerObjectName error %lu\n", GetLastError());
if (ret)
{
const WCHAR *p;
ok(size == lstrlenW(buf) + 1, "got %u, expected %u\n", size, lstrlenW(buf) + 1);
ok(size == lstrlenW(buf) + 1, "got %lu, expected %u\n", size, lstrlenW(buf) + 1);
ok(!memcmp(buf, cnW, sizeof(cnW)), "got %s\n", wine_dbgstr_w(buf));
ok(!memcmp(buf + 3, name, name_size), "got %s (name_size = %u)\n", wine_dbgstr_w(buf), name_size);
ok(!memcmp(buf + 3, name, name_size), "got %s (name_size = %lu)\n", wine_dbgstr_w(buf), name_size);
p = wcschr(buf, ',');
ok(p != NULL, "delimiter was not found\n");
ok(p && !memcmp(p + 1, ComputersW, sizeof(ComputersW)), "got %s\n", p ? wine_dbgstr_w(p + 1) : wine_dbgstr_w(buf));
}
hr = CoCreateInstance(&CLSID_ADSystemInfo, 0, CLSCTX_ALL, &IID_IADsADSystemInfo, (void **)&sysinfo);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
hr = IADsADSystemInfo_get_ComputerName(sysinfo, &bstr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_CANT_ACCESS_DOMAIN_INFO), "got %#x\n", hr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_CANT_ACCESS_DOMAIN_INFO), "got %#lx\n", hr);
if (hr == S_OK)
{
ok(!lstrcmpW(bstr, buf), "got %s, expected %s\n", wine_dbgstr_w(bstr), wine_dbgstr_w(buf));
......@@ -98,7 +98,7 @@ static void test_UserName(void)
name_size = 256;
SetLastError(0xdeadbeef);
ret = GetUserNameW(name, &name_size);
ok(ret, "GetUserName error %u\n", GetLastError());
ok(ret, "GetUserName error %lu\n", GetLastError());
/* Distinguished name (rfc1779) is supposed to look like this:
* "CN=username,CN=Users,DC=domain,DC=com"
......@@ -107,24 +107,24 @@ static void test_UserName(void)
size = 1024;
SetLastError(0xdeadbeef);
ret = GetUserNameExW(NameFullyQualifiedDN, buf, &size);
ok(ret || GetLastError() == ERROR_NONE_MAPPED, "GetUserNameEx error %u\n", GetLastError());
ok(ret || GetLastError() == ERROR_NONE_MAPPED, "GetUserNameEx error %lu\n", GetLastError());
if (ret)
{
const WCHAR *p;
ok(size == lstrlenW(buf), "got %u, expected %u\n", size, lstrlenW(buf));
ok(size == lstrlenW(buf), "got %lu, expected %u\n", size, lstrlenW(buf));
ok(!memcmp(buf, cnW, sizeof(cnW)), "got %s\n", wine_dbgstr_w(buf));
ok(!memcmp(buf + 3, name, name_size), "got %s (name_size = %u)\n", wine_dbgstr_w(buf), name_size);
ok(!memcmp(buf + 3, name, name_size), "got %s (name_size = %lu)\n", wine_dbgstr_w(buf), name_size);
p = wcschr(buf, ',');
ok(p != NULL, "delimiter was not found\n");
ok(p && !memcmp(p + 1, UsersW, sizeof(UsersW)), "got %s\n", p ? wine_dbgstr_w(p + 1) : wine_dbgstr_w(buf));
}
hr = CoCreateInstance(&CLSID_ADSystemInfo, 0, CLSCTX_ALL, &IID_IADsADSystemInfo, (void **)&sysinfo);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
hr = IADsADSystemInfo_get_UserName(sysinfo, &bstr);
todo_wine
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NONE_MAPPED), "got %#x\n", hr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NONE_MAPPED), "got %#lx\n", hr);
if (hr == S_OK)
{
ok(!lstrcmpW(bstr, buf), "got %s, expected %s\n", wine_dbgstr_w(bstr), wine_dbgstr_w(buf));
......@@ -144,18 +144,18 @@ static void test_sysinfo(void)
HRESULT hr;
hr = CoCreateInstance(&CLSID_ADSystemInfo, 0, CLSCTX_ALL, &IID_IUnknown, (void **)&sysinfo);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
IADsADSystemInfo_Release(sysinfo);
hr = CoCreateInstance(&CLSID_ADSystemInfo, 0, CLSCTX_ALL, &IID_IADsADSystemInfo, (void **)&sysinfo);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
hr = IADsADSystemInfo_QueryInterface(sysinfo, &IID_IDispatch, (void **)&dispatch);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
IDispatch_Release(dispatch);
hr = IADsADSystemInfo_get_ComputerName(sysinfo, &bstr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_CANT_ACCESS_DOMAIN_INFO), "got %#x\n", hr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_CANT_ACCESS_DOMAIN_INFO), "got %#lx\n", hr);
if (hr != S_OK)
{
skip("Computer is not part of a domain, skipping the tests\n");
......@@ -165,36 +165,36 @@ static void test_sysinfo(void)
hr = IADsADSystemInfo_get_UserName(sysinfo, &bstr);
todo_wine
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NONE_MAPPED), "got %#x\n", hr);
ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NONE_MAPPED), "got %#lx\n", hr);
if (hr != S_OK) goto done;
SysFreeString(bstr);
hr = IADsADSystemInfo_get_SiteName(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) SysFreeString(bstr);
hr = IADsADSystemInfo_get_DomainShortName(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) SysFreeString(bstr);
hr = IADsADSystemInfo_get_DomainDNSName(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) SysFreeString(bstr);
hr = IADsADSystemInfo_get_ForestDNSName(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) SysFreeString(bstr);
hr = IADsADSystemInfo_get_PDCRoleOwner(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) SysFreeString(bstr);
hr = IADsADSystemInfo_get_IsNativeMode(sysinfo, &value);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) ok(value == VARIANT_TRUE, "IsNativeMode: %s\n", value == VARIANT_TRUE ? "yes" : "no");
hr = IADsADSystemInfo_GetAnyDCName(sysinfo, &bstr);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
if (hr == S_OK) SysFreeString(bstr);
done:
IADsADSystemInfo_Release(sysinfo);
......@@ -205,7 +205,7 @@ START_TEST(sysinfo)
HRESULT hr;
hr = CoInitialize(NULL);
ok(hr == S_OK, "got %#x\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
test_ComputerName();
test_UserName();
......
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