cmd/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-17 07:10:31 +01:00 committed by Alexandre Julliard
parent 7f9b9df04f
commit ec0e9b3b94
2 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = cmd.exe
C_SRCS = \

View File

@ -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;