tests
This commit is contained in:
70
nwtests.c
70
nwtests.c
@@ -1803,6 +1803,70 @@ static int tests_c32mapfull2(void)
|
||||
}
|
||||
|
||||
|
||||
static int tests_c32mapvar_one(UI specLen, UI flag)
|
||||
{
|
||||
uint8 out[32];
|
||||
uint16 ret_ax, ret_dx, result_lo, result_hi, cref_lo, cref_hi;
|
||||
|
||||
memset(out, 0, sizeof(out));
|
||||
|
||||
fprintf(stdout, "\nTEST C32MAPVAR specLen=%u flag=%u\n", specLen, flag);
|
||||
C32_MapVar_Probe(specLen, flag, out);
|
||||
|
||||
ret_ax = tests_get_word_lh(out + 14);
|
||||
ret_dx = tests_get_word_lh(out + 16);
|
||||
result_lo = tests_get_word_lh(out + 18);
|
||||
result_hi = tests_get_word_lh(out + 20);
|
||||
cref_lo = tests_get_word_lh(out + 22);
|
||||
cref_hi = tests_get_word_lh(out + 24);
|
||||
|
||||
fprintf(stdout, "Return DX:AX=%04X:%04X resultRef=%04X:%04X connRefLocal=%04X:%04X\n",
|
||||
ret_dx, ret_ax, result_hi, result_lo, cref_hi, cref_lo);
|
||||
tests_dump_bytes("OUT:", out, 26);
|
||||
|
||||
if (ret_ax == 0 && ret_dx == 0 && (cref_lo || cref_hi) &&
|
||||
!(cref_lo == 0xFFFE && cref_hi == 0xFFFF)) {
|
||||
fprintf(stdout, "Try open with connRefLocal:\n");
|
||||
fprintf(stdout, " TESTS C32OPENREF %u %u\n", cref_lo, cref_hi);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int tests_c32mapvar(int argc, char *argv[])
|
||||
{
|
||||
UI specLen = 5;
|
||||
UI flag = 0;
|
||||
|
||||
if (argc > 2)
|
||||
specLen = (UI)atoi(argv[2]);
|
||||
if (argc > 3)
|
||||
flag = (UI)atoi(argv[3]);
|
||||
|
||||
return tests_c32mapvar_one(specLen, flag);
|
||||
}
|
||||
|
||||
static int tests_c32mapvarmatrix(void)
|
||||
{
|
||||
fprintf(stdout, "TEST C32MAPVARMATRIX paged\n");
|
||||
fprintf(stdout, "Trying SPECTDATA length/flag variants for server MARS.\n");
|
||||
tests_wait_key();
|
||||
|
||||
tests_c32mapvar_one(5, 0);
|
||||
tests_wait_key();
|
||||
|
||||
tests_c32mapvar_one(5, 1);
|
||||
tests_wait_key();
|
||||
|
||||
tests_c32mapvar_one(0x31, 0);
|
||||
tests_wait_key();
|
||||
|
||||
tests_c32mapvar_one(0x31, 1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int func_tests(int argc, char *argv[], int mode)
|
||||
{
|
||||
if (argc >= 2) {
|
||||
@@ -1851,6 +1915,12 @@ int func_tests(int argc, char *argv[], int mode)
|
||||
if (tests_same_arg(argv[1], "C32MAPFULL2"))
|
||||
return tests_c32mapfull2();
|
||||
|
||||
if (tests_same_arg(argv[1], "C32MAPVAR"))
|
||||
return tests_c32mapvar(argc, argv);
|
||||
|
||||
if (tests_same_arg(argv[1], "C32MAPVARMATRIX"))
|
||||
return tests_c32mapvarmatrix();
|
||||
|
||||
if (tests_same_arg(argv[1], "NWREQ87C32MATRIX"))
|
||||
return tests_nwreq87c32matrix();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user