Commit ec0e9b3b authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

cmd/tests: Enable compilation with long types.

parent 7f9b9df0
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = cmd.exe TESTDLL = cmd.exe
C_SRCS = \ C_SRCS = \
......
...@@ -92,7 +92,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size) ...@@ -92,7 +92,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
bres = WriteFile(file, cmd_data, cmd_size, &size, NULL); bres = WriteFile(file, cmd_data, cmd_size, &size, NULL);
CloseHandle(file); CloseHandle(file);
ok(bres, "Could not write to file: %u\n", GetLastError()); ok(bres, "Could not write to file: %lu\n", GetLastError());
if(!bres) if(!bres)
return FALSE; return FALSE;
...@@ -112,7 +112,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size) ...@@ -112,7 +112,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
si.hStdOutput = file; si.hStdOutput = file;
si.hStdError = fileerr; si.hStdError = fileerr;
bres = CreateProcessA(NULL, command, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi); 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) { if(!bres) {
DeleteFileA("test.out"); DeleteFileA("test.out");
return FALSE; return FALSE;
...@@ -133,7 +133,7 @@ static DWORD map_file(const char *file_name, const char **ret) ...@@ -133,7 +133,7 @@ static DWORD map_file(const char *file_name, const char **ret)
DWORD size; DWORD size;
file = CreateFileA(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); 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) if(file == INVALID_HANDLE_VALUE)
return 0; return 0;
...@@ -141,12 +141,12 @@ static DWORD map_file(const char *file_name, const char **ret) ...@@ -141,12 +141,12 @@ static DWORD map_file(const char *file_name, const char **ret)
map = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL); map = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);
CloseHandle(file); 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) if(!map)
return 0; return 0;
*ret = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 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); CloseHandle(map);
if(!*ret) if(!*ret)
return 0; return 0;
...@@ -307,10 +307,10 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da ...@@ -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); err = compare_line(out_ptr, out_nl, exp_ptr, exp_nl);
if(err == out_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); line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
else if(err == exp_nl) 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); 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) else if (!err && is_todo_wine && is_out_resync && is_exp_resync)
/* Consider that the todo_wine was to deal with extra lines, /* 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 ...@@ -318,7 +318,7 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
*/ */
err = NULL; err = NULL;
else 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); (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 ...@@ -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); 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) ...@@ -380,14 +380,14 @@ static void run_from_file(const char *file_name)
test_size = map_file(file_name, &test_data); test_size = map_file(file_name, &test_data);
if(!test_size) { 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; return;
} }
sprintf(out_name, "%s.exp", file_name); sprintf(out_name, "%s.exp", file_name);
out_size = map_file(out_name, &out_data); out_size = map_file(out_name, &out_data);
if(!out_size) { 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); UnmapViewOfFile(test_data);
return; return;
} }
...@@ -405,7 +405,7 @@ static DWORD load_resource(const char *name, const char *type, const char **ret) ...@@ -405,7 +405,7 @@ static DWORD load_resource(const char *name, const char *type, const char **ret)
DWORD size; DWORD size;
src = FindResourceA(NULL, name, type); 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) if(!src)
return 0; return 0;
......
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