Ejemplo n.º 1
0
/*
**	sync_lines(test_list, status, ch)
**
**	How many newlines/second?
*/
static void
sync_lines(
	struct test_list *t,
	int *state,
	int *ch)
{
	int j;

	if (skip_pad_test(t, state, ch,
		"(nel) Start scroll performance test")) {
		return;
	}
	pad_test_startup(0);
	repeats = 100;
	do {
		sprintf(temp, "%d", test_complete);
		put_str(temp);
		put_newlines(repeats);
	} while(still_testing());
	pad_test_shutdown(t, 0);
	j = sliding_scale(tx_count[0], 1000000, usec_run_time);
	if (j > tty_newline_rate) {
		tty_newline_rate = j;
	}
	sprintf(temp, "%d linefeeds per second.  ", j);
	ptext(temp);
	generic_done_message(t, state, ch);
}
Ejemplo n.º 2
0
/*
**	crum_os(test_list, status, ch)
**
**	(cup) test Cursor position on overstrike terminals
*/
static void
crum_os(
	struct test_list *t,
	int *state,
	int *ch)
{
	int i;

	if (cursor_address && over_strike) {
		put_clear();
		for (i = 0; i < columns - 2; i++) {
			tc_putch('|');
		}
		for (i = 1; i < lines - 2; i++) {
			put_crlf();
			tc_putch('_');
		}
		for (i = 0; i < columns - 2; i++) {
			tputs(TPARM_2(cursor_address, 0, i), lines, tc_putch);
			tc_putch('+');
		}
		for (i = 0; i < lines - 2; i++) {
			tputs(TPARM_2(cursor_address, i, 0), lines, tc_putch);
			tc_putch(']');
			tc_putch('_');
		}
		go_home();
		put_newlines(3);
		ptext("    All the characters should look the same.  ");
		generic_done_message(t, state, ch);
		put_clear();
	}
}
Ejemplo n.º 3
0
/*
**	subtest_rmam(test_list, status, ch)
**
**	test exit automatic margins mode (rmam)
*/
static void
subtest_rmam(
	struct test_list *t,
	int *state,
	int *ch)
{
	int j;

	if (!exit_am_mode) {
		ptext("(rmam) not present.  ");
	} else
	if (!can_go_home) {
		ptext("(rmam) not tested, no way to home cursor.  ");
	} else
	if (over_strike) {
		put_clear();
		go_home();
		tc_putp(exit_am_mode);
		ptext("\n(rmam) will     reset (am)");
		go_home();
		for (j = 0; j < columns; j++)
			put_this(' ');
		ptext("(rmam) will not reset (am)");
		go_home();
		put_newlines(2);
	} else {
		put_clear();
		go_home();
		tc_putp(exit_am_mode);
		ptext("\n(rmam) will reset (am)");
		go_home();
		for (j = 0; j < columns; j++)
			put_this(' ');
		ptext("(rmam) will not reset (am) ");
		go_home();
		put_str("                          ");
		go_home();
		put_newlines(2);
	}
	ptext("Exit-automatic-margins ");
	generic_done_message(t, state, ch);
}
Ejemplo n.º 4
0
/*
**	subtest_smam(test_list, status, ch)
**
**	test enter automatic margins mode (smam)
*/
static void
subtest_smam(
	struct test_list *t,
	int *state,
	int *ch)
{
	int i, j;

	if (!enter_am_mode) {
		ptext("(smam) not present.  ");
	} else
	if (!can_go_home) {
		ptext("(smam) not tested, no way to home cursor.  ");
	} else
	if (over_strike) {
		put_clear();
		go_home();
		tc_putp(enter_am_mode);
		ptext("\n(smam) will ");
		i = char_count;
		ptext("not set (am)");
		go_home();
		for (j = -i; j < columns; j++)
			put_this(' ');
		put_str("@@@");
		put_newlines(2);
	} else {
		put_clear();
		go_home();
		tc_putp(enter_am_mode);
		ptext("\n(smam) will not set (am)");
		go_home();
		for (j = 0; j < columns; j++)
			put_this(' ');
		ptext("(smam) will set (am)    ");
		go_home();
		put_str("                          ");
		put_newlines(2);
	}
	ptext("Enter-automatic-margins ");
	generic_done_message(t, state, ch);
}
Ejemplo n.º 5
0
/*
**	subtest_cbt(test_list, status, ch)
**
**	(cbt) back tab
*/
static void
subtest_cbt(
	struct test_list *t,
	int *state,
	int *ch)
{
	int i;

	if (back_tab) {
		put_clear();
		ptext("Back-tab (cbt)");
		go_home();
		put_crlf();
		for (i = 1; i < columns; i++) {
			putchp(' ');
		}
		for (i = 0; i < columns; i += 8) {
			tc_putp(back_tab);
			putchp('T');
			tc_putp(back_tab);
		}
		go_home();
		put_newlines(2);
		for (i = 1; i < columns; i++) {
			if (i % 8 == 1) {
				putchp('T');
			} else {
				putchp(' ');
			}
		}
		go_home();
		put_newlines(3);
		ptextln("The preceding two lines should be the same.");
	} else {
		ptextln("(cbt) Back-tab not present");
	}
	generic_done_message(t, state, ch);
}
Ejemplo n.º 6
0
/*
**	crum_home(test_list, status, ch)
**
**	(home) test Home cursor
*/
static void
crum_home(
	struct test_list *t,
	int *state,
	int *ch)
{
	if (cursor_home) {
		put_clear();
		put_newlines(lines / 2);
		go_home();
		put_crlf();
		ptext("The bottom line should have text.");
		go_home();
		put_newlines(lines - 1);
		ptext("This line is on the bottom.");
		go_home();
		ptextln("This line starts in the home position.");
		put_crlf();
	} else {
		ptextln("(home) Home cursor is not defined.  ");
	}
	generic_done_message(t, state, ch);
}
Ejemplo n.º 7
0
/*
**	display_it(selection, text)
**
**	print the display using sel
*/
static void
display_it(
	int sel,
	char *txt)
{
	int i, done_line;

	put_clear();
	go_home();
	put_newlines(2);
	ptextln("    The top line should be alternating <'s and >'s");
	ptextln("    The left side should be alternating A's and V's");
	ptext("    Testing ");
	ptext(txt);
	put_cr();

	/* horizontal */
	move_to(done_line = line_count, 0, 0, 2, sel);
	for (i = 4; i < columns - 2; i += 2) {
		putchp('>');
		move_to(0, i - 1, 0, i, sel);
	}
	putchp('>');
	i -= 2;
	move_to(0, i + 1, 0, i - 1, sel);
	for (; i > 2; i -= 2) {
		putchp('<');
		move_to(0, i, 0, i - 3, sel);
	}
	putchp('<');

	/* vertical */
	move_to(0, 2, 0, 0, sel);
	for (i = 2; i < lines - 1; i += 2) {
		putchp('V');
		move_to(i - 2, 1, i, 0, sel);
	}
	putchp('V');
	i -= 2;
	move_to(i, 1, i + 1, 0, sel);
	for (; i > 0; i -= 2) {
		putchp('A');
		move_to(i + 1, 1, i - 1, 0, sel);
	}
	putchp('A');
	move_to(i + 1, 1, 0, 0, sel);	/* go home first */
	move_to(0, 0, done_line + 1, 3, sel);
	put_str(txt);
	put_str(" Done. ");
}
Ejemplo n.º 8
0
/*
**	subtest_mir(test_list, status, ch)
**
**	(mir) move in insert mode
*/
static void
subtest_mir(
	struct test_list *t,
	int *state,
	int *ch)
{
	int i;
	char *s;

	if (enter_insert_mode && exit_insert_mode && cursor_address) {
		put_clear();
		i = line_count;
		put_str("\nXXX\nXXX\nXXX\nXXX");
		tc_putp(enter_insert_mode);
		s = tparm(cursor_address, i + 1, 0);
		tputs(s, lines, tc_putch);
		putchp('X');
		s = tparm(cursor_address, i + 2, 1);
		tputs(s, lines, tc_putch);
		putchp('X');
		s = tparm(cursor_address, i + 3, 2);
		tputs(s, lines, tc_putch);
		putchp('X');
		s = tparm(cursor_address, i + 4, 3);
		tputs(s, lines, tc_putch);
		putchp('X');
		tc_putp(exit_insert_mode);
		put_newlines(2);
		ptextln("If you see a 4 by 4 block of X's then (mir) should be true.");
		sprintf(temp, "(mir) Move-in-insert-mode is %s in the data base",
			move_insert_mode ? "true" : "false");
		ptextln(temp);
	} else {
		ptext("(mir) Move-in-insert-mode not tested, ");
		if (!enter_insert_mode) {
			ptext("(smir) ");
		}
		if (!exit_insert_mode) {
			ptext("(rmir) ");
		}
		if (!cursor_address) {
			ptext("(cup) ");
		}
		ptext("not present.  ");
	}
	generic_done_message(t, state, ch);
}
Ejemplo n.º 9
0
/*
**	subtest_am(test_list, status, ch)
**
**	test automatic margins (am)
*/
static void
subtest_am(
	struct test_list *t,
	int *state,
	int *ch)
{
	int i, j;

	if (!can_go_home) {
		ptextln("(am) not tested, no way to home cursor.  ");
	} else
	if (over_strike) {
		put_clear();
		go_home();
		ptext("\n(am) should ");
		i = char_count;
		ptext("not be set");
		go_home();
		for (j = -i; j < columns; j++)
			put_this(' ');
		put_str("@@@");
		go_home();
		put_newlines(2);
		sprintf(temp, "(am) is %s in the data base",
			auto_right_margin ? "true" : "false");
		ptextln(temp);
	} else {
		put_clear();
		go_home();
		ptext("\n(am) should not be set");
		go_home();
		for (j = 0; j < columns; j++)
			put_this(' ');
		ptext("(am) should be set    ");
		go_home();
		put_str("                       \n\n");
		sprintf(temp, "(am) is %s in the data base",
			auto_right_margin ? "true" : "false");
		ptextln(temp);
	}
	ptext("Automatic-right-margin ");
	generic_done_message(t, state, ch);
}
Ejemplo n.º 10
0
/*
**	subtest_tbc(test_list, status, ch)
**
**	test clear tabs (tbc)
*/
static void
subtest_tbc(
	struct test_list *t,
	int *state,
	int *ch)
{
	int tabat;		/* the tab spacing we end up with */
	int i;

	if (clear_all_tabs && !set_tab) {
		ptext("(tbc) Clear-all-tabs is defined but (hts) set-tab is not.  ");
		ptext("Once the tabs are cleared there is no way to set them.  ");
	} else
	if (clear_all_tabs) {
		tabat = set_tab ? 8 : init_tabs;
		tc_putp(clear_all_tabs);
		ptext("Clear tabs (tbc)");
		go_home();
		put_crlf();
		putchp('\t');
		putchp('T');
		go_home();
		put_newlines(2);
		for (i = 0; i < columns; i++) {
			if (i == tabat) {
				putchp('T');
			} else {
				putchp('.');
			}
		}
		go_home();
		ptext("\n\n\nIf the above two lines have T's in the same column then (tbc) has failed.  ");
	} else {
		ptext("(tbc) Clear-all-tabs is not defined.  ");
	}
	generic_done_message(t, state, ch);
}
Ejemplo n.º 11
0
/*
**	subtest_xenl(test_list, status, ch)
**
**	(xenl) eat newline glitch
*/
static void
subtest_xenl(
	struct test_list *t,
	int *state,
	int *ch)
{
	int i, j, k;

	if (over_strike) {
		/* test (xenl) on overstrike terminals */
		if (!can_go_home || !can_clear_screen) {
			ptextln("(xenl) Newline-glitch not tested, can't home cursor and clear.");
			generic_done_message(t, state, ch);
			return;
		}
		put_clear();
		/*
		   this test must be done in raw mode.  Otherwise UNIX will
		   translate CR to CRLF.
		*/
		if (stty_query(TTY_OUT_TRANS))
			tty_raw(1, char_mask);
		ptext("\nreset (xenl). Does ");
		i = char_count;
		put_str("not ignore CR, does ");
		k = char_count;
		put_str("not ignore LF");
		go_home();
		for (j = 0; j < columns; j++)
			put_this(' ');
		put_cr();
		for (j = 0; j < i; j++)
			putchp(' ');
		put_str("@@@\n@@");
		go_home();
		for (j = 0; j < columns; j++)
			put_this(' ');
		put_lf();
		for (j = 0; j < k; j++)
			putchp(' ');
		put_str("@@@\r@@");
		tty_set();
		go_home();
		put_newlines(4);
		sprintf(temp, "(xenl) Newline-glitch is %s in the data base",
			eat_newline_glitch ? "true" : "false");
		ptextln(temp);
	} else {
		/* test (xenl) when (os) is reset */
		if (!can_go_home) {
			ptextln("(xenl) Newline-glitch not tested, can't home cursor");
			generic_done_message(t, state, ch);
			return;
		}
		/* (xenl) test */
		put_clear();
		/*
		   this test must be done in raw mode.  Otherwise
		   UNIX will translate CR to CRLF.
		*/
		if (stty_query(TTY_OUT_TRANS))
			tty_raw(1, char_mask);
		for (j = 0; j < columns; j++)
			put_this(' ');
		put_cr();
		ptext("(xenl) should be set. Does not ignore CR");
		go_home();
		put_crlf();
		for (j = 0; j < columns; j++)
			put_this(' ');
		put_lf();	/* test (cud1) */
		ptext("(xenl) should be set. Ignores (cud1)");
		go_home();
		put_newlines(3);
		if (scroll_forward && cursor_down &&
			strcmp(scroll_forward, cursor_down)) {
			for (j = 0; j < columns; j++)
				put_this(' ');
			put_ind();	/* test (ind) */
			ptext("(xenl) should be set. Ignores (ind)");
			go_home();
			put_newlines(5);
		}
		tty_set();
		ptextln("If you don't see text above telling you to set it, (xenl) should be false");
		sprintf(temp, "(xenl) Newline-glitch is %s in the data base",
			eat_newline_glitch ? "true" : "false");
		ptextln(temp);
	}
	generic_done_message(t, state, ch);
}
Ejemplo n.º 12
0
/*
**	subtest_hts(test_list, status, ch)
**
**	(ht) and set tabs with (hts)
*/
static void
subtest_hts(
	struct test_list *t,
	int *state,
	int *ch)
{
	int tabat;		/* the tab spacing we end up with */
	int i;

	tabat = init_tabs;
	if (set_tab) {
		ptext("Tabs set with (hts)");
		put_crlf();
		for (i = 1; i < columns; i++) {
			if (i % 8 == 1) {
				tc_putp(set_tab);
			}
			putchp(' ');
		}
		tabat = 8;
	} else {
		sprintf(temp, "(hts) Set-tabs not defined.  (it) Initial-tabs at %d", init_tabs);
		ptext(temp);
	}
	go_home();
	put_newlines(2);
	if (tabat <= 0) {
		tabat = 8;
	}
	for (i = tabat; i < columns; i += tabat) {
		putchp('\t');
		putchp('T');
	}
	go_home();
	put_newlines(3);
	for (i = 1; i < columns; i++) {
		putchp('.');
	}
	go_home();
	put_newlines(3);
	for (i = tabat; i < columns; i += tabat) {
		putchp('\t');
		putchp('T');
	}
	go_home();
	put_newlines(4);
	putchp('.');
	for (i = 2; i < columns; i++) {
		if (i % tabat == 1) {
			putchp('T');
		} else {
			putchp('.');
		}
	}
	go_home();
	put_newlines(5);
	if (set_tab) {
		ptextln("If the last two lines are not the same then (hts) has failed.");
	} else
	if (init_tabs > 0) {
		ptextln("If the last two lines are not the same then (it) is wrong.");
	} else {
		ptextln("If the last two lines are the same then maybe you do have tabs and (it) should be changed.");
	}
	generic_done_message(t, state, ch);
}
Ejemplo n.º 13
0
/*
**	keys_tested(first-time, show-help, hex-output)
**
**	Display a list of the keys not tested.
*/
static void
keys_tested(
	       int first_time,
	       int show_help,
	       int hex_output)
{
    int i, l;
    char outbuf[256];

    alloc_strings();
    put_clear();
    tty_set();
    flush_input();
    if (got_labels) {
	putln("Function key labels:");
	for (i = 0; i < key_count; ++i) {
	    if (fk_label[i]) {
		sprintf(outbuf, "%s %s",
			fk_name[i] ? fk_name[i] : "??", fk_label[i]);
		put_columns(outbuf, (int) strlen(outbuf), 16);
	    }
	}
	put_newlines(2);
    }
    if (funk) {
	putln("The following keys are not defined:");
	for (i = 0; i < funk; ++i) {
	    put_columns(fk_unknown[i], fk_length[i], 16);
	}
	put_mode(exit_attribute_mode);
	put_newlines(2);
    }
    if (first_time) {
	putln("The following keys are defined:");
    } else {
	putln("The following keys have not been tested:");
    }
    if (scan_mode) {
	for (i = 0; scan_down[i]; i++) {
	    if (!scan_tested[i]) {
		if (hex_output) {
		    strcpy(outbuf, hex_expand_to(scan_down[i], 3));
		} else {
		    strcpy(outbuf, expand(scan_down[i]));
		}
		l = expand_chars;
		if (hex_output) {
		    strcat(outbuf, hex_expand_to(scan_up[i], 3));
		} else {
		    strcat(outbuf, expand(scan_up[i]));
		}
		expand_chars += l;
		l = (int) strlen(scan_name[i]);
		if (((char_count + 16) & ~15) +
		    ((expand_chars + 7) & ~7) + l >= columns) {
		    put_crlf();
		} else if (char_count + 24 > columns) {
		    put_crlf();
		} else if (char_count) {
		    putchp(' ');
		}
		put_columns(outbuf, expand_chars, 16);
		put_columns(scan_name[i], l, 8);
	    }
	}
    } else {
	for (i = 0; i < key_count; i++) {
	    if (!fk_tested[i] && fk_name[i] != 0) {
		if (hex_output) {
		    strcpy(outbuf, hex_expand_to(fkval[i], 3));
		} else {
		    strcpy(outbuf, expand(fkval[i]));
		}
		l = (int) strlen(fk_name[i]);
		if (((char_count + 16) & ~15) +
		    ((expand_chars + 7) & ~7) + l >= columns) {
		    put_crlf();
		} else if (char_count + 24 > columns) {
		    put_crlf();
		} else if (char_count) {
		    putchp(' ');
		}
		put_columns(outbuf, expand_chars, 16);
		put_columns(fk_name[i], l, 8);
	    }
	}
    }
    put_newlines(2);
    if (show_help) {
	ptextln("Hit any function key.  Type 'end' to quit.  Type ? to update the display.");
	put_crlf();
    }
}