mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 02:41:22 +00:00
[CMD_ROSTEST] Sync batch.c with cmd_winetest' counterpart.
This commit is contained in:
parent
7115d7ba8e
commit
d85d991679
1 changed files with 17 additions and 6 deletions
|
@ -26,7 +26,7 @@
|
||||||
static char workdir[MAX_PATH];
|
static char workdir[MAX_PATH];
|
||||||
static DWORD workdir_len;
|
static DWORD workdir_len;
|
||||||
static char drive[2];
|
static char drive[2];
|
||||||
static const DWORD drive_len = sizeof(drive)/sizeof(drive[0]);
|
static const DWORD drive_len = ARRAY_SIZE(drive);
|
||||||
static char path[MAX_PATH];
|
static char path[MAX_PATH];
|
||||||
static DWORD path_len;
|
static DWORD path_len;
|
||||||
static char shortpath[MAX_PATH];
|
static char shortpath[MAX_PATH];
|
||||||
|
@ -71,7 +71,11 @@ static const char* convert_input_data(const char *data, DWORD size, DWORD *new_s
|
||||||
}
|
}
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
*new_size = lstrlenA(new_data);
|
*new_size = lstrlenA(new_data);
|
||||||
|
#else
|
||||||
|
*new_size = strlen(new_data);
|
||||||
|
#endif
|
||||||
return new_data;
|
return new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +170,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const
|
||||||
static const char path_cmd[] = {'@','p','a','t','h','@'};
|
static const char path_cmd[] = {'@','p','a','t','h','@'};
|
||||||
static const char shortpath_cmd[] = {'@','s','h','o','r','t','p','a','t','h','@'};
|
static const char shortpath_cmd[] = {'@','s','h','o','r','t','p','a','t','h','@'};
|
||||||
static const char space_cmd[] = {'@','s','p','a','c','e','@'};
|
static const char space_cmd[] = {'@','s','p','a','c','e','@'};
|
||||||
|
static const char spaces_cmd[] = {'@','s','p','a','c','e','s','@'};
|
||||||
static const char tab_cmd[] = {'@','t','a','b','@'};
|
static const char tab_cmd[] = {'@','t','a','b','@'};
|
||||||
static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'};
|
static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'};
|
||||||
|
|
||||||
|
@ -224,6 +229,15 @@ static const char *compare_line(const char *out_line, const char *out_end, const
|
||||||
} else {
|
} else {
|
||||||
err = out_end;
|
err = out_end;
|
||||||
}
|
}
|
||||||
|
}else if(exp_ptr+sizeof(spaces_cmd) <= exp_end
|
||||||
|
&& !memcmp(exp_ptr, spaces_cmd, sizeof(spaces_cmd))) {
|
||||||
|
exp_ptr += sizeof(spaces_cmd);
|
||||||
|
if(out_ptr < out_end && *out_ptr == ' ') {
|
||||||
|
while (out_ptr < out_end && *out_ptr == ' ') out_ptr++;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
err = out_end;
|
||||||
|
}
|
||||||
}else if(exp_ptr+sizeof(tab_cmd) <= exp_end
|
}else if(exp_ptr+sizeof(tab_cmd) <= exp_end
|
||||||
&& !memcmp(exp_ptr, tab_cmd, sizeof(tab_cmd))) {
|
&& !memcmp(exp_ptr, tab_cmd, sizeof(tab_cmd))) {
|
||||||
exp_ptr += sizeof(tab_cmd);
|
exp_ptr += sizeof(tab_cmd);
|
||||||
|
@ -251,10 +265,8 @@ static const char *compare_line(const char *out_line, const char *out_end, const
|
||||||
|
|
||||||
while(exp_ptr+sizeof(or_broken_cmd) <= exp_end && memcmp(exp_ptr, or_broken_cmd, sizeof(or_broken_cmd)))
|
while(exp_ptr+sizeof(or_broken_cmd) <= exp_end && memcmp(exp_ptr, or_broken_cmd, sizeof(or_broken_cmd)))
|
||||||
exp_ptr++;
|
exp_ptr++;
|
||||||
if(!exp_ptr)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
exp_ptr += sizeof(or_broken_cmd);
|
exp_ptr += sizeof(or_broken_cmd);
|
||||||
|
if (exp_ptr > exp_end) return err;
|
||||||
out_ptr = out_line;
|
out_ptr = out_line;
|
||||||
err = NULL;
|
err = NULL;
|
||||||
continue;
|
continue;
|
||||||
|
@ -470,8 +482,7 @@ START_TEST(reactos)
|
||||||
} else {
|
} else {
|
||||||
path_len = 1; /* \ */
|
path_len = 1; /* \ */
|
||||||
}
|
}
|
||||||
shortpath_len = GetShortPathNameA(path, shortpath,
|
shortpath_len = GetShortPathNameA(path, shortpath, ARRAY_SIZE(shortpath));
|
||||||
sizeof(shortpath)/sizeof(shortpath[0]));
|
|
||||||
|
|
||||||
argc = winetest_get_mainargs(&argv);
|
argc = winetest_get_mainargs(&argv);
|
||||||
if(argc > 2)
|
if(argc > 2)
|
||||||
|
|
Loading…
Reference in a new issue