Eric Pouech : cmd/tests: Enable compilation with long types.

Alexandre Julliard julliard at winehq.org
Thu Feb 17 15:33:57 CST 2022


Module: wine
Branch: master
Commit: ec0e9b3b94eb57d3d0c17c4be5498787e2cfe046
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ec0e9b3b94eb57d3d0c17c4be5498787e2cfe046

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Thu Feb 17 07:10:31 2022 +0100

cmd/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/cmd/tests/Makefile.in |  1 -
 programs/cmd/tests/batch.c     | 24 ++++++++++++------------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/programs/cmd/tests/Makefile.in b/programs/cmd/tests/Makefile.in
index 78d92f7c778..87942fedcf9 100644
--- a/programs/cmd/tests/Makefile.in
+++ b/programs/cmd/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 TESTDLL   = cmd.exe
 
 C_SRCS = \
diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c
index 162e9cfa151..3846693ef2e 100644
--- a/programs/cmd/tests/batch.c
+++ b/programs/cmd/tests/batch.c
@@ -92,7 +92,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
 
     bres = WriteFile(file, cmd_data, cmd_size, &size, NULL);
     CloseHandle(file);
-    ok(bres, "Could not write to file: %u\n", GetLastError());
+    ok(bres, "Could not write to file: %lu\n", GetLastError());
     if(!bres)
         return FALSE;
 
@@ -112,7 +112,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
     si.hStdOutput = file;
     si.hStdError = fileerr;
     bres = CreateProcessA(NULL, command, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
-    ok(bres, "CreateProcess failed: %u\n", GetLastError());
+    ok(bres, "CreateProcess failed: %lu\n", GetLastError());
     if(!bres) {
         DeleteFileA("test.out");
         return FALSE;
@@ -133,7 +133,7 @@ static DWORD map_file(const char *file_name, const char **ret)
     DWORD size;
 
     file = CreateFileA(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
-    ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %08x\n", GetLastError());
+    ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %08lx\n", GetLastError());
     if(file == INVALID_HANDLE_VALUE)
         return 0;
 
@@ -141,12 +141,12 @@ static DWORD map_file(const char *file_name, const char **ret)
 
     map = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);
     CloseHandle(file);
-    ok(map != NULL, "CreateFileMappingA(%s) failed: %u\n", file_name, GetLastError());
+    ok(map != NULL, "CreateFileMappingA(%s) failed: %lu\n", file_name, GetLastError());
     if(!map)
         return 0;
 
     *ret = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
-    ok(*ret != NULL, "MapViewOfFile failed: %u\n", GetLastError());
+    ok(*ret != NULL, "MapViewOfFile failed: %lu\n", GetLastError());
     CloseHandle(map);
     if(!*ret)
         return 0;
@@ -307,10 +307,10 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
 
             err = compare_line(out_ptr, out_nl, exp_ptr, exp_nl);
             if(err == out_nl)
-                ok(0, "unexpected end of line %d (got '%.*s', wanted '%.*s')\n",
+                ok(0, "unexpected end of line %ld (got '%.*s', wanted '%.*s')\n",
                    line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
             else if(err == exp_nl)
-                ok(0, "excess characters on line %d (got '%.*s', wanted '%.*s')\n",
+                ok(0, "excess characters on line %ld (got '%.*s', wanted '%.*s')\n",
                    line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
             else if (!err && is_todo_wine && is_out_resync && is_exp_resync)
                 /* Consider that the todo_wine was to deal with extra lines,
@@ -318,7 +318,7 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
                  */
                 err = NULL;
             else
-                ok(!err, "unexpected char 0x%x position %d in line %d (got '%.*s', wanted '%.*s')\n",
+                ok(!err, "unexpected char 0x%x position %d in line %ld (got '%.*s', wanted '%.*s')\n",
                    (err ? *err : 0), (err ? (int)(err-out_ptr) : -1), line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
         }
 
@@ -344,7 +344,7 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
         }
     }
 
-    ok(exp_ptr >= exp_data+exp_size, "unexpected end of output in line %d, missing %s\n", line, exp_ptr);
+    ok(exp_ptr >= exp_data+exp_size, "unexpected end of output in line %ld, missing %s\n", line, exp_ptr);
     ok(out_ptr >= out_data+out_size, "too long output, got additional %s\n", out_ptr);
 }
 
@@ -380,14 +380,14 @@ static void run_from_file(const char *file_name)
 
     test_size = map_file(file_name, &test_data);
     if(!test_size) {
-        ok(0, "Could not map file %s: %u\n", file_name, GetLastError());
+        ok(0, "Could not map file %s: %lu\n", file_name, GetLastError());
         return;
     }
 
     sprintf(out_name, "%s.exp", file_name);
     out_size = map_file(out_name, &out_data);
     if(!out_size) {
-        ok(0, "Could not map file %s: %u\n", out_name, GetLastError());
+        ok(0, "Could not map file %s: %lu\n", out_name, GetLastError());
         UnmapViewOfFile(test_data);
         return;
     }
@@ -405,7 +405,7 @@ static DWORD load_resource(const char *name, const char *type, const char **ret)
     DWORD size;
 
     src = FindResourceA(NULL, name, type);
-    ok(src != NULL, "Could not find resource %s: %u\n", name, GetLastError());
+    ok(src != NULL, "Could not find resource %s: %lu\n", name, GetLastError());
     if(!src)
         return 0;
 




More information about the wine-cvs mailing list