Commit 93707e93 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

mpr/tests: Enable compilation with long types.

parent b38dbf93
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = mpr.dll
IMPORTS = mpr
......
......@@ -41,51 +41,51 @@ static void test_WNetGetUniversalName(void)
buffer, &info_size);
if(drive_type == DRIVE_REMOTE)
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08lx\n", ret);
else
/* WN_NO_NET_OR_BAD_PATH (DRIVE_FIXED) returned from the virtual drive (usual Q:)
created by the microsoft application virtualization client */
ok((ret == WN_NOT_CONNECTED) || (ret == WN_NO_NET_OR_BAD_PATH),
"WNetGetUniversalNameA(%s, ...) returned %u (drive_type: %u)\n",
"WNetGetUniversalNameA(%s, ...) returned %lu (drive_type: %lu)\n",
driveA, ret, drive_type);
ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
ok(info_size == sizeof(buffer), "Got wrong size: %lu\n", info_size);
fail_size = 1;
ret = WNetGetUniversalNameA(driveA, UNIVERSAL_NAME_INFO_LEVEL,
buffer, &fail_size);
if(drive_type == DRIVE_REMOTE)
{
todo_wine ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(fail_size > 1, "Got %d\n", fail_size);
todo_wine ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08lx\n", ret);
ok(fail_size > 1, "Got %ld\n", fail_size);
}
else
ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH,
"(%s) WNetGetUniversalNameW gave wrong error: %u\n", driveA, ret);
"(%s) WNetGetUniversalNameW gave wrong error: %lu\n", driveA, ret);
fail_size = ARRAY_SIZE(driveA) - 1;
ret = WNetGetUniversalNameA(driveA, UNIVERSAL_NAME_INFO_LEVEL,
buffer, &fail_size);
if(drive_type == DRIVE_REMOTE)
ok(ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08lx\n", ret);
ret = WNetGetUniversalNameA(driveandpathA, UNIVERSAL_NAME_INFO_LEVEL,
buffer, &info_size);
if(drive_type == DRIVE_REMOTE)
todo_wine ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret);
todo_wine ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08lx\n", ret);
info_size = sizeof(buffer);
ret = WNetGetUniversalNameW(driveW, UNIVERSAL_NAME_INFO_LEVEL,
buffer, &info_size);
if(drive_type == DRIVE_REMOTE)
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08x\n", ret);
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08lx\n", ret);
else
ok((ret == WN_NOT_CONNECTED) || (ret == WN_NO_NET_OR_BAD_PATH),
"WNetGetUniversalNameW(%s, ...) returned %u (drive_type: %u)\n",
"WNetGetUniversalNameW(%s, ...) returned %lu (drive_type: %lu)\n",
wine_dbgstr_w(driveW), ret, drive_type);
if(drive_type != DRIVE_REMOTE)
ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
ok(info_size == sizeof(buffer), "Got wrong size: %lu\n", info_size);
}
}
......@@ -106,57 +106,57 @@ static void test_WNetGetRemoteName(void)
buffer, &info_size);
if(drive_type == DRIVE_REMOTE)
todo_wine
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08lx\n", ret);
else
ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH,
"(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret);
ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
"(%s) WNetGetUniversalNameA gave wrong error: %lu\n", driveA, ret);
ok(info_size == sizeof(buffer), "Got wrong size: %lu\n", info_size);
fail_size = 0;
ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL,
buffer, &fail_size);
if(drive_type == DRIVE_REMOTE)
todo_wine
ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08lx\n", ret);
else
ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH,
"(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret);
"(%s) WNetGetUniversalNameA gave wrong error: %lu\n", driveA, ret);
ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL,
buffer, NULL);
todo_wine ok(ret == WN_BAD_POINTER, "WNetGetUniversalNameA failed: %08x\n", ret);
todo_wine ok(ret == WN_BAD_POINTER, "WNetGetUniversalNameA failed: %08lx\n", ret);
ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL,
NULL, &info_size);
if(drive_type == DRIVE_REMOTE)
todo_wine
ok(ret == WN_BAD_POINTER || ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_BAD_POINTER || ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08lx\n", ret);
else
ok(ret == WN_NOT_CONNECTED || ret == WN_BAD_VALUE,
"(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret);
"(%s) WNetGetUniversalNameA gave wrong error: %lu\n", driveA, ret);
fail_size = ARRAY_SIZE(driveA) - 1;
ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL,
buffer, &fail_size);
if(drive_type == DRIVE_REMOTE)
todo_wine ok(ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret);
todo_wine ok(ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08lx\n", ret);
ret = WNetGetUniversalNameA(driveandpathA, REMOTE_NAME_INFO_LEVEL,
buffer, &info_size);
if(drive_type == DRIVE_REMOTE)
todo_wine ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret);
todo_wine ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08lx\n", ret);
info_size = sizeof(buffer);
ret = WNetGetUniversalNameW(driveW, REMOTE_NAME_INFO_LEVEL,
buffer, &info_size);
todo_wine{
if(drive_type == DRIVE_REMOTE)
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08x\n", ret);
ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08lx\n", ret);
else
ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH,
"(%s) WNetGetUniversalNameW gave wrong error: %u\n", driveA, ret);
"(%s) WNetGetUniversalNameW gave wrong error: %lu\n", driveA, ret);
}
ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
ok(info_size == sizeof(buffer), "Got wrong size: %lu\n", info_size);
}
}
......@@ -191,7 +191,7 @@ static BOOL CALLBACK enum_password_proc(PASSWORD_CACHE_ENTRY* pce, DWORD param)
WORD size = 0;
char* buf;
ok(param == m_param, "param, got %d, got %d\n", param, m_param);
ok(param == m_param, "param, got %ld, got %ld\n", param, m_param);
size = offsetof( PASSWORD_CACHE_ENTRY, abResource[pce->cbResource + pce->cbPassword] );
ok(pce->cbEntry == size, "cbEntry, got %d, expected %d\n", pce->cbEntry, size);
......@@ -232,14 +232,14 @@ static void test_WNetCachePassword(void)
strcpy(password_buf, m_password);
password_len = strlen(m_password);
ret = pWNetCachePassword(resource_buf, resource_len, password_buf, password_len, m_type, 0);
ok(ret == WN_SUCCESS, "WNetCachePassword failed: got %d, expected %d\n", ret, WN_SUCCESS);
ok(ret == WN_SUCCESS, "WNetCachePassword failed: got %ld, expected %d\n", ret, WN_SUCCESS);
strcpy(resource_buf, m_resource);
resource_len = strlen(m_resource);
strcpy(password_buf, "------");
password_len = sizeof(password_buf);
ret = pWNetGetCachedPassword(resource_buf, resource_len, password_buf, &password_len, m_type);
ok(ret == WN_SUCCESS, "WNetGetCachedPassword failed: got %d, expected %d\n", ret, WN_SUCCESS);
ok(ret == WN_SUCCESS, "WNetGetCachedPassword failed: got %ld, expected %d\n", ret, WN_SUCCESS);
ok(password_len == strlen(m_password), "password length different, got %d\n", password_len);
ok(strncmp(password_buf, m_password, password_len)==0, "passwords different, got %.*s, expected %s\n", password_len, password_buf, m_password);
......@@ -247,13 +247,13 @@ static void test_WNetCachePassword(void)
strcpy(prefix_buf, m_resource);
prefix_buf[prefix_len] = '0';
ret = pWNetEnumCachedPasswords(prefix_buf, prefix_len, m_type, enum_password_proc, m_param);
ok(ret == WN_SUCCESS, "WNetEnumCachedPasswords failed: got %d, expected %d\n", ret, WN_SUCCESS);
ok(ret == WN_SUCCESS, "WNetEnumCachedPasswords failed: got %ld, expected %d\n", ret, WN_SUCCESS);
ok(m_callback_reached == 1, "callback was not reached\n");
strcpy(resource_buf, m_resource);
resource_len = strlen(m_resource);
ret = pWNetRemoveCachedPassword(resource_buf, resource_len, m_type);
ok(ret == WN_SUCCESS, "WNetRemoveCachedPassword failed: got %d, expected %d\n", ret, WN_SUCCESS);
ok(ret == WN_SUCCESS, "WNetRemoveCachedPassword failed: got %ld, expected %d\n", ret, WN_SUCCESS);
} else {
win_skip("WNetCachePassword() is not supported.\n");
}
......@@ -287,28 +287,28 @@ static void test_WNetUseConnection(void)
if (ret != ERROR_ALREADY_ASSIGNED) break;
}
if (ret == ERROR_ALREADY_ASSIGNED) goto end; /* no drives available */
todo_wine ok(ret == WN_SUCCESS, "Unexpected return: %u\n", ret);
ok(bufSize == 0, "Unexpected buffer size: %u\n", bufSize);
todo_wine ok(ret == WN_SUCCESS, "Unexpected return: %lu\n", ret);
ok(bufSize == 0, "Unexpected buffer size: %lu\n", bufSize);
if (ret == WN_SUCCESS) WNetCancelConnectionA(drive, TRUE);
bufSize = 0;
ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, outBuf, &bufSize, &outRes);
todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return: %u\n", ret);
ok(bufSize == 0, "Unexpected buffer size: %u\n", bufSize);
todo_wine ok(ret == ERROR_INVALID_PARAMETER, "Unexpected return: %lu\n", ret);
ok(bufSize == 0, "Unexpected buffer size: %lu\n", bufSize);
if (ret == WN_SUCCESS) WNetCancelConnectionA(drive, TRUE);
todo_wine {
bufSize = 1;
ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, outBuf, &bufSize, &outRes);
ok(ret == ERROR_MORE_DATA, "Unexpected return: %u\n", ret);
ok(bufSize == 3, "Unexpected buffer size: %u\n", bufSize);
ok(ret == ERROR_MORE_DATA, "Unexpected return: %lu\n", ret);
ok(bufSize == 3, "Unexpected buffer size: %lu\n", bufSize);
if (ret == WN_SUCCESS) WNetCancelConnectionA(drive, TRUE);
bufSize = 4;
ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, outBuf, &bufSize, &outRes);
ok(ret == WN_SUCCESS, "Unexpected return: %u\n", ret);
ok(ret == WN_SUCCESS, "Unexpected return: %lu\n", ret);
}
ok(bufSize == 4, "Unexpected buffer size: %u\n", bufSize);
ok(bufSize == 4, "Unexpected buffer size: %lu\n", bufSize);
if (ret == WN_SUCCESS) WNetCancelConnectionA(drive, TRUE);
end:
......
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