tests
This commit is contained in:
71
nwtests.c
71
nwtests.c
@@ -542,6 +542,14 @@ static UI tests_build_nwreq87_path_multi(uint8 *buf, uint8 dhandle,
|
||||
return (UI)(p - buf);
|
||||
}
|
||||
|
||||
|
||||
static void tests_wait_key(void)
|
||||
{
|
||||
fprintf(stdout, "Strike any key when ready . . . ");
|
||||
getch();
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
static int tests_nwreq87vlm_one(char *label, uint8 connid,
|
||||
uint8 *hdr, uint8 *path, UI path_len)
|
||||
{
|
||||
@@ -575,6 +583,8 @@ static int tests_nwreq87vlm_one(char *label, uint8 connid,
|
||||
a4d = tests_get_dword_lh(repl + 0x4d);
|
||||
fprintf(stdout, "DW0=%08lX DW4D=%08lX\n", a0, a4d);
|
||||
|
||||
tests_wait_key();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -638,6 +648,64 @@ static int tests_nwreq87vlmmatrix(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
static int tests_nwreq87vlmcase(int argc, char *argv[])
|
||||
{
|
||||
int which = 1;
|
||||
uint8 connid = 0;
|
||||
uint8 dhandle = 0;
|
||||
uint8 hdr[16];
|
||||
uint8 path[300];
|
||||
UI len;
|
||||
|
||||
if (argc > 2)
|
||||
which = atoi(argv[2]);
|
||||
|
||||
if (tests_current_conn_dhandle(&connid, &dhandle))
|
||||
return(1);
|
||||
|
||||
memset(hdr, 0, sizeof(hdr));
|
||||
hdr[0] = 6;
|
||||
hdr[1] = 0;
|
||||
hdr[2] = 0;
|
||||
tests_put_word_lh(hdr + 3, 0x0006);
|
||||
tests_put_dword_lh(hdr + 5, 0x00000004UL);
|
||||
|
||||
fprintf(stdout, "TEST NWREQ87VLMCASE %d\n", which);
|
||||
fprintf(stdout, "connid=%u dhandle=%u\n", connid, dhandle);
|
||||
tests_dump_bytes("HDR:", hdr, 9);
|
||||
|
||||
switch (which) {
|
||||
case 1:
|
||||
len = tests_build_nwreq87_path_multi(path, dhandle, 0, 0, 1,
|
||||
"LOGIN.EXE", 0, 0);
|
||||
return tests_nwreq87vlm_one("1 h=dhandle style=0 LOGIN.EXE", connid, hdr, path, len);
|
||||
|
||||
case 2:
|
||||
len = tests_build_nwreq87_path_multi(path, dhandle, 0, 0, 2,
|
||||
"PUBLIC", "LOGIN.EXE", 0);
|
||||
return tests_nwreq87vlm_one("2 h=dhandle style=0 PUBLIC/LOGIN.EXE", connid, hdr, path, len);
|
||||
|
||||
case 3:
|
||||
len = tests_build_nwreq87_path_multi(path, 0, 0, 0, 2,
|
||||
"PUBLIC", "LOGIN.EXE", 0);
|
||||
return tests_nwreq87vlm_one("3 h=0 style=0 PUBLIC/LOGIN.EXE", connid, hdr, path, len);
|
||||
|
||||
case 4:
|
||||
len = tests_build_nwreq87_path_multi(path, dhandle, 0, 1, 1,
|
||||
"LOGIN.EXE", 0, 0);
|
||||
return tests_nwreq87vlm_one("4 h=dhandle style=1 LOGIN.EXE", connid, hdr, path, len);
|
||||
|
||||
case 5:
|
||||
len = tests_build_nwreq87_path_multi(path, 0, 0, 1, 2,
|
||||
"PUBLIC", "LOGIN.EXE", 0);
|
||||
return tests_nwreq87vlm_one("5 h=0 style=1 PUBLIC/LOGIN.EXE", connid, hdr, path, len);
|
||||
}
|
||||
|
||||
fprintf(stdout, "Valid cases: 1..5\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
int func_tests(int argc, char *argv[], int mode)
|
||||
{
|
||||
if (argc >= 2) {
|
||||
@@ -656,6 +724,9 @@ int func_tests(int argc, char *argv[], int mode)
|
||||
if (tests_same_arg(argv[1], "NWREQ87VLMMATRIX"))
|
||||
return tests_nwreq87vlmmatrix(argc, argv);
|
||||
|
||||
if (tests_same_arg(argv[1], "NWREQ87VLMCASE"))
|
||||
return tests_nwreq87vlmcase(argc, argv);
|
||||
|
||||
if (tests_same_arg(argv[1], "NCPF2"))
|
||||
return tests_ncpf2(argc, argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user