diff --git a/scp.c b/scp.c index ba355176..56de4c7a 100644 --- a/scp.c +++ b/scp.c @@ -15563,9 +15563,9 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { tstat = SCPE_OK; /* can't enable, just skip device */ if (tstat != SCPE_OK) { stat = tstat; - sim_printf ("%s device tests returned: %d - %s\n", dptr->name, tstat, sim_error_text (tstat)); + sim_printf ("%s device tests returned: %d - %s\n", dptr->name, SCPE_BARE_STATUS (tstat), sim_error_text (tstat)); if (sim_ttisatty()) { - if (get_yn ("Continue with additional tests? [N]", SCPE_STOP) == SCPE_STOP) + if (get_yn ("Continue with additional tests? [N] ", SCPE_STOP) == SCPE_STOP) break; } else diff --git a/scp.h b/scp.h index 7bda9a9e..d21f76f3 100644 --- a/scp.h +++ b/scp.h @@ -456,13 +456,13 @@ extern const char *sim_vm_step_unit; /* Simulator can change These defines help implement consistent unit test functionality */ #define SIM_TEST_INIT \ - int test_stat; \ - const char *sim_test; \ + volatile int test_stat; \ + const char *volatile sim_test; \ jmp_buf sim_test_env; \ if ((test_stat = setjmp (sim_test_env))) { \ sim_printf ("Error: %d - '%s' processing: %s\n", \ - test_stat, sim_error_text(test_stat), \ - sim_test); \ + SCPE_BARE_STATUS(test_stat), \ + sim_error_text(test_stat), sim_test); \ return test_stat; \ } #define SIM_TEST(_stat) \ diff --git a/sim_tape.c b/sim_tape.c index ea2af080..6e32aa9b 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -3894,6 +3894,10 @@ sim_switches = SWMASK ('F') | (sim_switches & SWMASK ('D')) | SWMASK ('N'); if (sim_switches & SWMASK ('D')) uptr->dctrl = MTSE_DBG_STR | MTSE_DBG_DAT; aws_stat = sim_tape_attach_ex (uptr, name, (saved_switches & SWMASK ('D')) ? MTSE_DBG_STR | MTSE_DBG_DAT: 0, 0); +if (aws_stat != MTSE_OK) { + stat = aws_stat; + goto Done_Files; + } sim_switches = saved_switches; stat = SCPE_OK; for (i=0; iunits->flags & UNIT_ATT) + return sim_messagef (SCPE_ALATT, "The %s device must be detached to run the tests\n", + sim_uname(dptr->units)); + sim_printf ("\nTesting %s device sim_tape APIs\n", sim_uname(dptr->units)); SIM_TEST(sim_tape_test_density_string ());