Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/kernel32/tests/atom.c | 33 +++++++++++++------------
dlls/kernel32/tests/drive.c | 37 ++++++++++++++--------------
dlls/kernel32/tests/mailslot.c | 53 ++++++++++++++++++++--------------------
dlls/kernel32/tests/power.c | 11 +++++---
dlls/kernel32/tests/resource.c | 47 ++++++++++++++++++-----------------
dlls/kernel32/tests/timer.c | 29 +++++++++++-----------
dlls/kernel32/tests/toolhelp.c | 17 +++++++------
7 files changed, 117 insertions(+), 110 deletions(-)
diff --git a/dlls/kernel32/tests/atom.c b/dlls/kernel32/tests/atom.c
index 4796d41d23d..ac69a53066b 100644
--- a/dlls/kernel32/tests/atom.c
+++ b/dlls/kernel32/tests/atom.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
#include <stdio.h>
@@ -115,20 +116,20 @@ static void test_add_atom(void)
{
SetLastError( 0xdeadbeef );
ok( GlobalAddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
if (unicode_OS)
{
SetLastError( 0xdeadbeef );
ok( GlobalAddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
}
}
for (i = 0xc000; i <= 0xffff; i++)
{
- ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %lx\n", i );
+ ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %Ix\n", i );
if (unicode_OS)
- ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %lx\n", i );
+ ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %Ix\n", i );
}
}
@@ -196,7 +197,7 @@ static void test_get_atom_name(void)
len = GlobalGetAtomNameA( (ATOM)i, buf, 2);
ok(!len, "bad length %d\n", len);
ok(GetLastError() == ERROR_MORE_DATA || GetLastError() == ERROR_INVALID_PARAMETER,
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
}
memset( buf, '.', sizeof(buf) );
@@ -229,7 +230,7 @@ static void test_get_atom_name(void)
SetLastError(0xdeadbeef);
len = GlobalGetAtomNameA(atom, out, 10);
ok(!len, "bad length %d\n", len);
- ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%u instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
+ ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%lu instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
for (i = 0; i < 9; i++)
{
ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
@@ -266,7 +267,7 @@ static void test_get_atom_name(void)
{
/* len == 0 with ERROR_MORE_DATA is on NT3.51 */
ok(len == 1 || (len == 0 && GetLastError() == ERROR_MORE_DATA),
- "0x%04x: got %u with %d (expected '1' or '0' with "
+ "0x%04x: got %u with %ld (expected '1' or '0' with "
"ERROR_MORE_DATA)\n", i, len, GetLastError());
ok(outW[1] == DOUBLE('.'), "buffer overwrite\n");
}
@@ -373,20 +374,20 @@ static void test_local_add_atom(void)
{
SetLastError( 0xdeadbeef );
ok( AddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
if (unicode_OS)
{
SetLastError( 0xdeadbeef );
ok( AddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
}
}
for (i = 0xc000; i <= 0xffff; i++)
{
- ok( !AddAtomA((LPCSTR)i), "succeeded adding %lx\n", i );
+ ok( !AddAtomA((LPCSTR)i), "succeeded adding %Ix\n", i );
if (unicode_OS)
- ok( !AddAtomW((LPCWSTR)i), "succeeded adding %lx\n", i );
+ ok( !AddAtomW((LPCWSTR)i), "succeeded adding %Ix\n", i );
}
}
@@ -472,11 +473,11 @@ static void test_local_get_atom_name(void)
if (i)
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
else
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
}
/* test string limits & overflow */
do_initA(in, "abcdefghij", 255);
@@ -505,7 +506,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error code (%u)\n", GetLastError());
+ "wrong error code (%lu)\n", GetLastError());
if (unicode_OS)
{
@@ -532,7 +533,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok(GetLastError() == ERROR_MORE_DATA ||
GetLastError() == (i ? ERROR_INSUFFICIENT_BUFFER : ERROR_INVALID_PARAMETER),
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
}
do_initW(inW, "abcdefghij", 255);
atom = AddAtomW(inW);
@@ -560,7 +561,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error code (%u)\n", GetLastError());
+ "wrong error code (%lu)\n", GetLastError());
}
}
diff --git a/dlls/kernel32/tests/drive.c b/dlls/kernel32/tests/drive.c
index 98dc454f340..6fa0754de3e 100644
--- a/dlls/kernel32/tests/drive.c
+++ b/dlls/kernel32/tests/drive.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
@@ -35,7 +36,7 @@ static void test_GetDriveTypeA(void)
UINT type;
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -88,7 +89,7 @@ static void test_GetDriveTypeW(void)
UINT type;
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -142,21 +143,21 @@ static void test_GetDiskFreeSpaceA(void)
DWORD logical_drives;
ret = GetDiskFreeSpaceA(NULL, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
ret = GetDiskFreeSpaceA("", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_NAME),
- "GetDiskFreeSpaceA(\"\"): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceA(\"\"): ret=%d GetLastError=%ld\n",
ret, GetLastError());
ret = GetDiskFreeSpaceA("\\", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
ret = GetDiskFreeSpaceA("/", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -169,7 +170,7 @@ static void test_GetDiskFreeSpaceA(void)
ret = GetDiskFreeSpaceA(drive, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
if (!(logical_drives & 1))
ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_DRIVE),
- "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%ld\n",
drive, ret, GetLastError());
else
{
@@ -177,12 +178,12 @@ static void test_GetDiskFreeSpaceA(void)
if (!ret)
/* GetDiskFreeSpaceA() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
- trace("GetDiskFreeSpaceA(%s) failed with %d\n", drive, GetLastError());
+ trace("GetDiskFreeSpaceA(%s) failed with %ld\n", drive, GetLastError());
if( GetVersion() & 0x80000000)
/* win3.0 through winME */
ok( total_clusters <= 65535,
- "total clusters is %d > 65535\n", total_clusters);
+ "total clusters is %ld > 65535\n", total_clusters);
else if (pGetDiskFreeSpaceExA) {
/* NT, 2k, XP : GetDiskFreeSpace should be accurate */
ULARGE_INTEGER totEx, tot, d;
@@ -194,7 +195,7 @@ static void test_GetDiskFreeSpaceA(void)
if (!ret)
/* GetDiskFreeSpaceExA() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
- trace("GetDiskFreeSpaceExA(%s) failed with %d\n", drive, GetLastError());
+ trace("GetDiskFreeSpaceExA(%s) failed with %ld\n", drive, GetLastError());
ok( bytes_per_sector == 0 || /* empty cd rom drive */
totEx.QuadPart <= tot.QuadPart,
@@ -222,21 +223,21 @@ static void test_GetDiskFreeSpaceW(void)
win_skip("GetDiskFreeSpaceW is not available\n");
return;
}
- ok(ret, "GetDiskFreeSpaceW error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceW error %ld\n", GetLastError());
ret = GetDiskFreeSpaceW(empty_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND,
- "GetDiskFreeSpaceW(\"\"): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceW(\"\"): ret=%d GetLastError=%ld\n",
ret, GetLastError());
ret = GetDiskFreeSpaceW(root_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceW(\"\") error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceW(\"\") error %ld\n", GetLastError());
ret = GetDiskFreeSpaceW(unix_style_root_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceW error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceW error %ld\n", GetLastError());
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -247,12 +248,12 @@ static void test_GetDiskFreeSpaceW(void)
ret = GetDiskFreeSpaceW(drive, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
if (!(logical_drives & 1))
ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND,
- "GetDiskFreeSpaceW(%c): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceW(%c): ret=%d GetLastError=%ld\n",
drive[0], ret, GetLastError());
else if (!ret)
/* GetDiskFreeSpaceW() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
- trace("GetDiskFreeSpaceW(%c) failed with %d\n", drive[0], GetLastError());
+ trace("GetDiskFreeSpaceW(%c) failed with %ld\n", drive[0], GetLastError());
}
logical_drives >>= 1;
}
diff --git a/dlls/kernel32/tests/mailslot.c b/dlls/kernel32/tests/mailslot.c
index 7e488566dbb..8011249542d 100644
--- a/dlls/kernel32/tests/mailslot.c
+++ b/dlls/kernel32/tests/mailslot.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
#include <stdlib.h>
@@ -81,38 +82,38 @@ static int mailslot_test(void)
SetLastError(0xdeadbeef);
ret = ReadFile(INVALID_HANDLE_VALUE, buffer, 0, &count, NULL);
ok(!ret, "ReadFile should fail\n");
- ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError());
- ok(count == 0, "expected 0, got %u\n", count);
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError());
+ ok(count == 0, "expected 0, got %lu\n", count);
count = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = ReadFile(hSlot, buffer, 0, &count, NULL);
ok(!ret, "ReadFile should fail\n");
todo_wine
- ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError());
- ok(count == 0, "expected 0, got %u\n", count);
+ ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError());
+ ok(count == 0, "expected 0, got %lu\n", count);
count = 0;
memset(buffer, 0, sizeof buffer);
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL),
"slot write\n");
- ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
/* now try and open the client, but with the wrong sharing mode */
hWriter = CreateFileA(szmspath, GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter != INVALID_HANDLE_VALUE /* vista */ || GetLastError() == ERROR_SHARING_VIOLATION,
- "error should be ERROR_SHARING_VIOLATION got %p / %u\n", hWriter, GetLastError());
+ "error should be ERROR_SHARING_VIOLATION got %p / %lu\n", hWriter, GetLastError());
if (hWriter != INVALID_HANDLE_VALUE) CloseHandle( hWriter );
/* now open the client with the correct sharing mode */
hWriter = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
- ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError());
+ ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %lu\n", GetLastError());
/*
* opening a client should make no difference to
@@ -120,11 +121,11 @@ static int mailslot_test(void)
*/
ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL),
"slot write\n");
- ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
/*
* we can't read from this client,
@@ -133,13 +134,13 @@ static int mailslot_test(void)
ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
"can read client\n");
ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED,
- "wrong error %u\n", GetLastError() );
+ "wrong error %lu\n", GetLastError() );
ok( WriteFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
"can't write client\n");
ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
"can read client\n");
ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED,
- "wrong error %u\n", GetLastError() );
+ "wrong error %lu\n", GetLastError() );
/*
* seeing as there's something in the slot,
@@ -152,8 +153,8 @@ static int mailslot_test(void)
/* but not again */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
/* now try open another writer... should fail */
hWriter2 = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
@@ -214,8 +215,8 @@ static int mailslot_test(void)
/* check there's still no data */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
/* write two messages */
buffer[0] = 'a';
@@ -250,7 +251,7 @@ static int mailslot_test(void)
"getmailslotinfo failed\n");
ok( dwNext == 1, "dwNext incorrect\n");
todo_wine
- ok( dwMsgCount == 3, "dwMsgCount incorrect %u\n", dwMsgCount);
+ ok( dwMsgCount == 3, "dwMsgCount incorrect %lu\n", dwMsgCount);
buffer[0]=buffer[1]=0;
@@ -269,7 +270,7 @@ static int mailslot_test(void)
"getmailslotinfo failed\n");
ok( dwNext == 2, "dwNext incorrect\n");
todo_wine {
- ok( dwMsgCount == 2, "dwMsgCount incorrect %u\n", dwMsgCount);
+ ok( dwMsgCount == 2, "dwMsgCount incorrect %lu\n", dwMsgCount);
}
/* read the second message */
@@ -282,9 +283,9 @@ static int mailslot_test(void)
dwNext = dwMsgCount = 0;
ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
"getmailslotinfo failed\n");
- ok( dwNext == 0, "dwNext incorrect %u\n", dwNext);
+ ok( dwNext == 0, "dwNext incorrect %lu\n", dwNext);
todo_wine {
- ok( dwMsgCount == 1, "dwMsgCount incorrect %u\n", dwMsgCount);
+ ok( dwMsgCount == 1, "dwMsgCount incorrect %lu\n", dwMsgCount);
}
/* read the 3rd (zero length) message */
@@ -307,8 +308,8 @@ static int mailslot_test(void)
/* check that reads fail */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "3rd slot read succeeded\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
/* finally close the mailslot and its client */
ok( CloseHandle( hWriter2 ), "closing 2nd client\n");
@@ -322,9 +323,9 @@ static int mailslot_test(void)
memset(buffer, 0, sizeof buffer);
dwTimeout = GetTickCount();
ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n");
- ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
dwTimeout = GetTickCount() - dwTimeout;
- ok( dwTimeout >= 900, "timeout too short %u\n", dwTimeout );
+ ok( dwTimeout >= 900, "timeout too short %lu\n", dwTimeout );
ok( CloseHandle( hSlot ), "closing the mailslot\n");
return 0;
diff --git a/dlls/kernel32/tests/power.c b/dlls/kernel32/tests/power.c
index af488849e21..40ecf29a941 100644
--- a/dlls/kernel32/tests/power.c
+++ b/dlls/kernel32/tests/power.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "wine/test.h"
@@ -53,14 +54,14 @@ void test_GetSystemPowerStatus(void)
"expected %u%%-charged battery to have capacity flags 0x%02x, got 0x%02x\n",
ps.BatteryLifePercent, expected_capacity_flags, capacity_flags);
ok(ps.BatteryLifeTime <= ps.BatteryFullLifeTime,
- "expected BatteryLifeTime %u to be less than or equal to BatteryFullLifeTime %u\n",
+ "expected BatteryLifeTime %lu to be less than or equal to BatteryFullLifeTime %lu\n",
ps.BatteryLifeTime, ps.BatteryFullLifeTime);
if (ps.BatteryFlag & BATTERY_FLAG_CHARGING)
{
ok(ps.BatteryLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryLifeTime to be -1 when charging, got %u\n", ps.BatteryLifeTime);
+ "expected BatteryLifeTime to be -1 when charging, got %lu\n", ps.BatteryLifeTime);
ok(ps.BatteryFullLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryFullLifeTime to be -1 when charging, got %u\n", ps.BatteryFullLifeTime);
+ "expected BatteryFullLifeTime to be -1 when charging, got %lu\n", ps.BatteryFullLifeTime);
}
}
else
@@ -71,9 +72,9 @@ void test_GetSystemPowerStatus(void)
ok(ps.BatteryLifePercent == BATTERY_PERCENTAGE_UNKNOWN,
"expected BatteryLifePercent to be -1, got %u\n", ps.BatteryLifePercent);
ok(ps.BatteryLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryLifeTime to be -1, got %u\n", ps.BatteryLifeTime);
+ "expected BatteryLifeTime to be -1, got %lu\n", ps.BatteryLifeTime);
ok(ps.BatteryFullLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryFullLifeTime to be -1, got %u\n", ps.BatteryFullLifeTime);
+ "expected BatteryFullLifeTime to be -1, got %lu\n", ps.BatteryFullLifeTime);
}
}
diff --git a/dlls/kernel32/tests/resource.c b/dlls/kernel32/tests/resource.c
index bca0298044f..b9428a7b240 100644
--- a/dlls/kernel32/tests/resource.c
+++ b/dlls/kernel32/tests/resource.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <windows.h>
#include <stdio.h>
@@ -332,10 +333,10 @@ static void update_resources_version( void )
MAKEINTRESOURCEA(0x4567),
0xabcd,
foo, sizeof foo );
- ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
+ ok( r == TRUE, "UpdateResource failed: %ld\n", GetLastError());
r = EndUpdateResourceA( res, FALSE );
- ok( r, "EndUpdateResource failed: %d\n", GetLastError());
+ ok( r, "EndUpdateResource failed: %ld\n", GetLastError());
}
static void update_resources_bigdata( void )
@@ -352,7 +353,7 @@ static void update_resources_bigdata( void )
MAKEINTRESOURCEA(0x5647),
0xcdba,
foo, sizeof foo );
- ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
+ ok( r == TRUE, "UpdateResource failed: %ld\n", GetLastError());
r = EndUpdateResourceA( res, FALSE );
ok( r, "EndUpdateResource failed\n");
@@ -367,27 +368,27 @@ static void update_resources_name( void )
BOOL ret;
res = BeginUpdateResourceA( filename, TRUE );
- ok( res != NULL, "BeginUpdateResource failed: %u\n", GetLastError() );
+ ok( res != NULL, "BeginUpdateResource failed: %lu\n", GetLastError() );
if ( !res ) return;
ret = UpdateResourceA( res, res_type, res_name, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), foo, sizeof(foo) );
- ok( ret == TRUE, "UpdateResource failed: %u\n", GetLastError() );
+ ok( ret == TRUE, "UpdateResource failed: %lu\n", GetLastError() );
ret = EndUpdateResourceA( res, FALSE );
- ok( ret, "EndUpdateResource failed: %u\n", GetLastError() );
+ ok( ret, "EndUpdateResource failed: %lu\n", GetLastError() );
if ( !ret ) return;
module = LoadLibraryExA( filename, NULL, LOAD_LIBRARY_AS_DATAFILE );
- ok( module != NULL, "LoadLibraryEx failed: %u\n", GetLastError() );
+ ok( module != NULL, "LoadLibraryEx failed: %lu\n", GetLastError() );
if ( !module ) return;
rsrc = FindResourceA( module, res_name, res_type );
ok( rsrc != NULL ||
broken( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND ) /* win2008 */,
- "FindResource failed: %u\n", GetLastError() );
+ "FindResource failed: %lu\n", GetLastError() );
ret = FreeLibrary(module);
- ok( ret, "FreeLibrary failed: %u\n", GetLastError() );
+ ok( ret, "FreeLibrary failed: %lu\n", GetLastError() );
}
static void check_exe( const sec_verify *verify )
@@ -402,7 +403,7 @@ static void check_exe( const sec_verify *verify )
DWORD length, sec_count = 0;
file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
- ok (file != INVALID_HANDLE_VALUE, "failed to create file (%d)\n", GetLastError());
+ ok (file != INVALID_HANDLE_VALUE, "failed to create file (%ld)\n", GetLastError());
length = GetFileSize( file, NULL );
ok( length >= verify->length, "file size wrong\n");
@@ -423,11 +424,11 @@ static void check_exe( const sec_verify *verify )
for(i = 0; i < max_sections; i++)
if (verify->sect_out[i])
{
- ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %d name wrong\n", sec_count);
- ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %d vaddr wrong\n", sec_count);
- ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %d SizeOfRawData wrong (%d vs %d)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData);
- ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %d PointerToRawData wrong\n", sec_count);
- ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %d characteristics wrong\n", sec_count);
+ ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %ld name wrong\n", sec_count);
+ ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %ld vaddr wrong\n", sec_count);
+ ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %ld SizeOfRawData wrong (%ld vs %ld)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData);
+ ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %ld PointerToRawData wrong\n", sec_count);
+ ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %ld characteristics wrong\n", sec_count);
sec_count++;
}
@@ -438,17 +439,17 @@ static void check_exe( const sec_verify *verify )
dir = (void*) ((BYTE*) dos + sec[verify->rsrc_section].VirtualAddress);
ok( dir->Characteristics == 0, "Characteristics wrong\n");
- ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong %u\n", dir->TimeDateStamp);
+ ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong %lu\n", dir->TimeDateStamp);
ok( dir->MajorVersion == 4, "MajorVersion wrong\n");
ok( dir->MinorVersion == 0, "MinorVersion wrong\n");
- ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %d instead of %d\n",
+ ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %ld instead of %d\n",
verify->NumberOfNamedEntries, dir->NumberOfNamedEntries);
- ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %d instead of %d\n",
+ ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %ld instead of %d\n",
verify->NumberOfIdEntries, dir->NumberOfIdEntries);
ok(opt->DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY].VirtualAddress == sec[verify->rsrc_section].VirtualAddress,
- "VirtualAddress in optional header should be %d instead of %d\n",
+ "VirtualAddress in optional header should be %ld instead of %ld\n",
sec[verify->rsrc_section].VirtualAddress, opt->DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY].VirtualAddress);
}
@@ -476,24 +477,24 @@ static void test_find_resource(void)
SetLastError( 0xdeadbeef );
rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(1), (LPCWSTR)RT_DIALOG );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(2), (LPCWSTR)RT_MENU );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1),
MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ) );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1),
MAKELANGID( LANG_FRENCH, SUBLANG_DEFAULT ) );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %lu\n", GetLastError() );
}
typedef struct
diff --git a/dlls/kernel32/tests/timer.c b/dlls/kernel32/tests/timer.c
index 156f1acd7f1..e64d2b6300d 100644
--- a/dlls/kernel32/tests/timer.c
+++ b/dlls/kernel32/tests/timer.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "wine/test.h"
#include "winbase.h"
@@ -79,10 +80,10 @@ static DWORD WINAPI thread_WaitForSingleObject(void *arg)
ok(event != NULL, "CreateEvent failed\n");
t = GetTickCount();
r = WaitForSingleObject(event, 3000);
- ok(r == WAIT_TIMEOUT, "WiatForSingleObject returned %x\n", r);
+ ok(r == WAIT_TIMEOUT, "WiatForSingleObject returned %lx\n", r);
CloseHandle(event);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -92,7 +93,7 @@ static DWORD WINAPI thread_Sleep(void *arg)
Sleep(3000);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -102,7 +103,7 @@ static DWORD WINAPI thread_SleepEx(void *arg)
SleepEx(3000, TRUE);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -122,10 +123,10 @@ static DWORD WINAPI thread_WaitableTimer_rel(void *arg)
ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
CloseHandle(timer);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -149,10 +150,10 @@ static DWORD WINAPI thread_WaitableTimer_abs(void *arg)
ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
CloseHandle(timer);
t = GetTickCount() - t;
- ok(t < 2000, "t = %d\n", t);
+ ok(t < 2000, "t = %ld\n", t);
return 0;
}
@@ -172,13 +173,13 @@ static DWORD WINAPI thread_WaitableTimer_period(void *arg)
ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
CloseHandle(timer);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -189,7 +190,7 @@ static DWORD WINAPI thread_SetTimer(void *arg)
MSG msg;
timer = SetTimer(NULL, 0, 3000, NULL);
- ok(timer, "SetTimer failed (%d)\n", GetLastError());
+ ok(timer, "SetTimer failed (%ld)\n", GetLastError());
while (GetMessageW(&msg, NULL, 0, 0))
{
@@ -198,7 +199,7 @@ static DWORD WINAPI thread_SetTimer(void *arg)
}
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
KillTimer(NULL, timer);
return 0;
}
@@ -210,7 +211,7 @@ static void test_timeouts(void)
if (!adjust_system_time(1))
{
- skip("can't adjust system clock (%d)\n", GetLastError());
+ skip("can't adjust system clock (%ld)\n", GetLastError());
return;
}
diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c
index 3bc07ec84f3..7d3df2d5e38 100644
--- a/dlls/kernel32/tests/toolhelp.c
+++ b/dlls/kernel32/tests/toolhelp.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
#include <stdlib.h>
@@ -124,7 +125,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
{
if (pe.th32ProcessID == curr_pid) found++;
if (pe.th32ProcessID == sub_pcs_pid) { childpos = num; found++; }
- trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile);
+ trace("PID=%lx %s\n", pe.th32ProcessID, pe.szExeFile);
num++;
} while (pProcess32Next( hSnapshot, &pe ));
}
@@ -138,7 +139,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
{
if (pe.th32ProcessID == curr_pid) found++;
if (pe.th32ProcessID == sub_pcs_pid) found++;
- trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile);
+ trace("PID=%lx %s\n", pe.th32ProcessID, pe.szExeFile);
num--;
} while (pProcess32Next( hSnapshot, &pe ));
}
@@ -237,7 +238,7 @@ static DWORD WINAPI get_id_thread(void* curr_pid)
free(pcs_buffer);
pcs_buffer = malloc(buf_size);
}
- ok(status == STATUS_SUCCESS, "got %#x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
found = FALSE;
matched_idx = -1;
@@ -332,7 +333,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid)
if (te.th32OwnerProcessID == curr_pid) curr_found++;
if (te.th32OwnerProcessID == sub_pcs_pid) sub_found++;
if (winetest_debug > 1)
- trace("PID=%x TID=%x %d\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
+ trace("PID=%lx TID=%lx %ld\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
num++;
} while (pThread32Next( hSnapshot, &te ));
}
@@ -349,7 +350,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid)
if (te.th32OwnerProcessID == curr_pid) curr_found++;
if (te.th32OwnerProcessID == sub_pcs_pid) sub_found++;
if (winetest_debug > 1)
- trace("PID=%x TID=%x %d\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
+ trace("PID=%lx TID=%lx %ld\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
num--;
} while (pThread32Next( hSnapshot, &te ));
}
@@ -399,7 +400,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
{
do
{
- trace("PID=%x base=%p size=%x %s %s\n",
+ trace("PID=%lx base=%p size=%lx %s %s\n",
me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule);
ok(me.th32ProcessID == pid, "wrong returned process id\n");
for (i = 0; i < num_expected; i++)
@@ -418,7 +419,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
{
do
{
- trace("PID=%x base=%p size=%x %s %s\n",
+ trace("PID=%lx base=%p size=%lx %s %s\n",
me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule);
for (i = 0; i < num_expected; i++)
if (!lstrcmpiA(expected[i], me.szModule)) found[i]++;
@@ -489,7 +490,7 @@ START_TEST(toolhelp)
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = SW_SHOWNORMAL;
- sprintf(buffer, "%s toolhelp %lu %lu", selfname, (DWORD_PTR)ev1, (DWORD_PTR)ev2);
+ sprintf(buffer, "%s toolhelp %Iu %Iu", selfname, (DWORD_PTR)ev1, (DWORD_PTR)ev2);
ok(CreateProcessA(NULL, buffer, NULL, NULL, TRUE, 0, NULL, NULL, &startup, &info), "CreateProcess\n");
/* wait for child to be initialized */
w = WaitForSingleObject(ev1, WAIT_TIME);