version tests: Win64 printf format warning fixes.
Michael [Plouj] Ploujnikov
ploujj at gmail.com
Mon Oct 9 20:56:26 CDT 2006
--
() ASCII Ribbon Campaign
/\ - against HTML mail & vCards
-------------- next part --------------
version tests: Win64 printf format warning fixes.
From: Michael Ploujnikov <ploujj at gmail.com>
---
dlls/version/tests/Makefile.in | 1 -
dlls/version/tests/info.c | 68 ++++++++++++++++++++--------------------
dlls/version/tests/install.c | 12 ++++---
3 files changed, 40 insertions(+), 41 deletions(-)
diff --git a/dlls/version/tests/Makefile.in b/dlls/version/tests/Makefile.in
index 1315f1f..4355774 100644
--- a/dlls/version/tests/Makefile.in
+++ b/dlls/version/tests/Makefile.in
@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = version.dll
IMPORTS = version kernel32
-EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \
info.c \
diff --git a/dlls/version/tests/info.c b/dlls/version/tests/info.c
index 8d60b0a..30662bf 100644
--- a/dlls/version/tests/info.c
+++ b/dlls/version/tests/info.c
@@ -33,7 +33,7 @@ #define EXPECT_BAD_PATH__NOT_FOUND \
(ERROR_BAD_PATHNAME == GetLastError()), \
"Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND/ERROR_BAD_PATHNAME (98)/" \
"ERROR_PATH_NOT_FOUND (NT4)/ERROR_FILE_NOT_FOUND (2k3)" \
- "expected, got 0x%08lx\n", GetLastError());
+ "expected, got 0x%08x\n", GetLastError());
#define EXPECT_INVALID__NOT_FOUND \
ok( (ERROR_PATH_NOT_FOUND == GetLastError()) || \
(ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError()) || \
@@ -41,7 +41,7 @@ #define EXPECT_INVALID__NOT_FOUND \
(ERROR_INVALID_PARAMETER == GetLastError()), \
"Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND/ERROR_INVALID_PARAMETER (98)/" \
"ERROR_PATH_NOT_FOUND (NT4)/ERROR_FILE_NOT_FOUND (2k3)" \
- "expected, got 0x%08lx\n", GetLastError());
+ "expected, got 0x%08x\n", GetLastError());
static void test_info_size(void)
{ DWORD hdl, retval;
@@ -50,7 +50,7 @@ static void test_info_size(void)
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( NULL, NULL);
ok( !retval,
- "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08x\n",
retval);
EXPECT_INVALID__NOT_FOUND;
@@ -58,16 +58,16 @@ static void test_info_size(void)
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( NULL, &hdl);
ok( !retval,
- "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08x\n",
retval);
EXPECT_INVALID__NOT_FOUND;
ok( hdl == 0L,
- "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
+ "Handle wrong! 0L expected, got 0x%08x\n", hdl);
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( "", NULL);
ok( !retval,
- "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08x\n",
retval);
EXPECT_BAD_PATH__NOT_FOUND;
@@ -75,43 +75,43 @@ static void test_info_size(void)
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( "", &hdl);
ok( !retval,
- "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08x\n",
retval);
EXPECT_BAD_PATH__NOT_FOUND;
ok( hdl == 0L,
- "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
+ "Handle wrong! 0L expected, got 0x%08x\n", hdl);
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( "kernel32.dll", NULL);
ok( retval,
- "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08x\n",
retval);
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
- "Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
+ "Last error wrong! NO_ERROR/0x%08x (NT4) expected, got 0x%08x\n",
MY_LAST_ERROR, GetLastError());
hdl = 0x55555555;
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( "kernel32.dll", &hdl);
ok( retval,
- "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08x\n",
retval);
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
- "Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
+ "Last error wrong! NO_ERROR/0x%08x (NT4) expected, got 0x%08x\n",
MY_LAST_ERROR, GetLastError());
ok( hdl == 0L,
- "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
+ "Handle wrong! 0L expected, got 0x%08x\n", hdl);
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( "notexist.dll", NULL);
ok( !retval,
- "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08x\n",
retval);
ok( (ERROR_FILE_NOT_FOUND == GetLastError()) ||
(ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError()) ||
(MY_LAST_ERROR == GetLastError()),
"Last error wrong! ERROR_FILE_NOT_FOUND/ERROR_RESOURCE_DATA_NOT_FOUND "
- "(XP)/0x%08lx (NT4) expected, got 0x%08lx\n", MY_LAST_ERROR, GetLastError());
+ "(XP)/0x%08x (NT4) expected, got 0x%08x\n", MY_LAST_ERROR, GetLastError());
/* test a currently loaded executable */
if(GetModuleFileNameA(NULL, mypath, MAX_PATH)) {
@@ -119,13 +119,13 @@ static void test_info_size(void)
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( mypath, &hdl);
ok( retval,
- "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08x\n",
retval);
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
- "Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
+ "Last error wrong! NO_ERROR/0x%08x (NT4) expected, got 0x%08x\n",
MY_LAST_ERROR, GetLastError());
ok( hdl == 0L,
- "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
+ "Handle wrong! 0L expected, got 0x%08x\n", hdl);
}
else
trace("skipping GetModuleFileNameA(NULL,..) failed\n");
@@ -141,13 +141,13 @@ static void test_info_size(void)
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( mypath, &hdl);
ok( retval,
- "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08x\n",
retval);
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
- "Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
+ "Last error wrong! NO_ERROR/0x%08x (NT4) expected, got 0x%08x\n",
MY_LAST_ERROR, GetLastError());
ok( hdl == 0L,
- "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
+ "Handle wrong! 0L expected, got 0x%08x\n", hdl);
}
}
else
@@ -183,13 +183,13 @@ static void test_info(void)
SetLastError(MY_LAST_ERROR);
retval = GetFileVersionInfoSizeA( "kernel32.dll", &hdl);
ok( retval,
- "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
+ "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08x\n",
retval);
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
- "Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
+ "Last error wrong! NO_ERROR/0x%08x (NT4) expected, got 0x%08x\n",
MY_LAST_ERROR, GetLastError());
ok( hdl == 0L,
- "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
+ "Handle wrong! 0L expected, got 0x%08x\n", hdl);
if ( retval == 0 || hdl != 0)
return;
@@ -212,12 +212,12 @@ #if 0
#endif
boolret = GetFileVersionInfoA( "kernel32.dll", 0, retval, pVersionInfo );
- ok (boolret, "GetFileVersionInfoA failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (boolret, "GetFileVersionInfoA failed: GetLastError = 0x%08x\n", GetLastError());
if (!boolret)
return;
boolret = VerQueryValueA( pVersionInfo, backslash, (LPVOID *)&pFixedVersionInfo, &uiLength );
- ok (boolret, "VerQueryValueA failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (boolret, "VerQueryValueA failed: GetLastError = 0x%08x\n", GetLastError());
if (!boolret)
return;
@@ -305,7 +305,7 @@ #endif
if (is_unicode_enabled)
{
- ok( retvalA == retvalW, "The size of the struct should be the same for both A/W calls, it is (%ld) vs. (%ld)\n",
+ ok( retvalA == retvalW, "The size of the struct should be the same for both A/W calls, it is (%d) vs. (%d)\n",
retvalA, retvalW);
ok( !memcmp(pVersionInfoA, pVersionInfoW, retvalA), "Both structs should be the same, they aren't\n");
}
@@ -350,13 +350,13 @@ #endif
/* Get the VS_FIXEDFILEINFO information, this must be the same for both A- and W-Calls */
retA = VerQueryValueA( pVersionInfoA, rootA, (LPVOID *)&pBufA, &uiLengthA );
- ok (retA, "VerQueryValueA failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retA, "VerQueryValueA failed: GetLastError = 0x%08x\n", GetLastError());
ok ( uiLengthA == sizeof(VS_FIXEDFILEINFO), "Size (%d) doesn't match the size of the VS_FIXEDFILEINFO struct\n", uiLengthA);
if (is_unicode_enabled)
{
retW = VerQueryValueW( pVersionInfoW, rootW, (LPVOID *)&pBufW, &uiLengthW );
- ok (retW, "VerQueryValueW failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retW, "VerQueryValueW failed: GetLastError = 0x%08x\n", GetLastError());
ok ( uiLengthA == sizeof(VS_FIXEDFILEINFO), "Size (%d) doesn't match the size of the VS_FIXEDFILEINFO struct\n", uiLengthA);
ok( uiLengthA == uiLengthW, "The size of VS_FIXEDFILEINFO should be the same for both A/W calls, it is (%d) vs. (%d)\n",
@@ -367,13 +367,13 @@ #endif
/* Get some VarFileInfo information, this must be the same for both A- and W-Calls */
retA = VerQueryValueA( pVersionInfoA, varfileinfoA, (LPVOID *)&pBufA, &uiLengthA );
- ok (retA, "VerQueryValueA failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retA, "VerQueryValueA failed: GetLastError = 0x%08x\n", GetLastError());
ok( !memcmp(pBufA, WineVarFileInfoA, uiLengthA), "The VarFileInfo should have matched 0904e404 (non case sensitive)\n");
if (is_unicode_enabled)
{
retW = VerQueryValueW( pVersionInfoW, varfileinfoW, (LPVOID *)&pBufW, &uiLengthW );
- ok (retW, "VerQueryValueW failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retW, "VerQueryValueW failed: GetLastError = 0x%08x\n", GetLastError());
ok( uiLengthA == uiLengthW, "The size of the VarFileInfo information should be the same for both A/W calls, it is (%d) vs. (%d)\n",
uiLengthA, uiLengthW);
ok( !memcmp(pBufA, pBufW, uiLengthA), "Both values should be the same, they aren't\n");
@@ -382,18 +382,18 @@ #endif
/* Get some StringFileInfo information, this will be ANSI for A-Calls and Unicode for W-Calls */
retA = VerQueryValueA( pVersionInfoA, FileDescriptionA, (LPVOID *)&pBufA, &uiLengthA );
- ok (retA, "VerQueryValueA failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retA, "VerQueryValueA failed: GetLastError = 0x%08x\n", GetLastError());
ok( !lstrcmpA(WineFileDescriptionA, pBufA), "FileDescription should have been 'Wine version test'\n");
/* Test a second time */
retA = VerQueryValueA( pVersionInfoA, FileDescriptionA, (LPVOID *)&pBufA, &uiLengthA );
- ok (retA, "VerQueryValueA failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retA, "VerQueryValueA failed: GetLastError = 0x%08x\n", GetLastError());
ok( !lstrcmpA(WineFileDescriptionA, pBufA), "FileDescription should have been 'Wine version test'\n");
if (is_unicode_enabled)
{
retW = VerQueryValueW( pVersionInfoW, FileDescriptionW, (LPVOID *)&pBufW, &uiLengthW );
- ok (retW, "VerQueryValueW failed: GetLastError = 0x%08lx\n", GetLastError());
+ ok (retW, "VerQueryValueW failed: GetLastError = 0x%08x\n", GetLastError());
ok( !lstrcmpW(WineFileDescriptionW, pBufW), "FileDescription should have been 'Wine version test' (unicode)\n");
}
diff --git a/dlls/version/tests/install.c b/dlls/version/tests/install.c
index fd1e91c..ada860c 100644
--- a/dlls/version/tests/install.c
+++ b/dlls/version/tests/install.c
@@ -60,7 +60,7 @@ static void test_find_file(void)
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
break;
default:
- ok(0, "Got unexpected return value %lx\n", ret);
+ ok(0, "Got unexpected return value %x\n", ret);
}
if(!GetWindowsDirectoryA(windir, MAX_PATH))
@@ -89,7 +89,7 @@ static void test_find_file(void)
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
break;
default:
- todo_wine ok(0, "Got unexpected return value %lx\n", ret);
+ todo_wine ok(0, "Got unexpected return value %x\n", ret);
}
dwCur=MAX_PATH;
@@ -111,7 +111,7 @@ static void test_find_file(void)
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
break;
default:
- todo_wine ok(0, "Got unexpected return value %lx\n", ret);
+ todo_wine ok(0, "Got unexpected return value %x\n", ret);
}
}
}
@@ -142,7 +142,7 @@ static void test_find_file(void)
"got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
break;
default:
- todo_wine ok(0, "Got unexpected return value %lx\n", ret);
+ todo_wine ok(0, "Got unexpected return value %x\n", ret);
}
dwCur=MAX_PATH;
@@ -150,7 +150,7 @@ static void test_find_file(void)
memset(outBuf, 0, MAX_PATH);
memset(curdir, 0, MAX_PATH);
ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
- todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %lx expected VFF_CURNEDEST\n", ret);
+ todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret);
ok(dwOut == 1 + strlen(windir), "Wrong length of buffer for current location: "
"got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(windir)+1);
@@ -159,7 +159,7 @@ static void test_find_file(void)
memset(outBuf, 0, MAX_PATH);
memset(curdir, 0, MAX_PATH);
ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
- todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %lx expected VFF_CURNEDEST\n", ret);
+ todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret);
ok(dwOut == 1 + strlen(appdir), "Wrong length of buffer for current location: "
"got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(appdir)+1);
}
More information about the wine-patches
mailing list