Skip to content

Commit

Permalink
More informative error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Sep 9, 2024
1 parent d1ad4c3 commit 3c3f1cf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sources/test-Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,10 @@ static zuint8 run_test(int test_index)

if (!i && !load_test(Z_NULL, test, &memory[start_address & Z_UINT16(0xFF00)]))
{
failure = "program";
error_loading_file:
if (verbosity) printf("error, test skipped\n%s", test_spacing);
if (verbosity > 2) printf("error\n%s", test_spacing);
else if (verbosity) printf("error: cannot load %s\n%s", failure, test_spacing);
return Z_FALSE;
}

Expand Down Expand Up @@ -578,7 +580,10 @@ static zuint8 run_test(int test_index)
);

if (!i && !load_file(Z_NULL, "ZX Spectrum.rom", 16384, 0, 16384, memory))
{
failure = "firmware";
goto error_loading_file;
}

if (verbosity >= 3) puts("OK");
Z80_SP(cpu) = 0x7FE8;
Expand Down Expand Up @@ -845,8 +850,8 @@ int main(int argc, char **argv)

else if (string_is_option(argv[i], "-p", "--path"))
{
zusize s;
char **p;
zusize s;

if (++i == argc) goto incomplete_option;

Expand Down

0 comments on commit 3c3f1cf

Please sign in to comment.