Beispiel #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);
}
Beispiel #2
0
/*
**	sync_clear(test_list, status, ch)
**
**	How many clear-screens/second?
*/
static void
sync_clear(
	struct test_list *t,
	int *state,
	int *ch)
{
	int j;

	if (!clear_screen) {
		ptext("Terminal can not clear-screen.  ");
		generic_done_message(t, state, ch);
		return;
	}
	if (skip_pad_test(t, state, ch,
		"(clear) Start clear-screen performance test")) {
		return;
	}
	pad_test_startup(0);
	repeats = 20;
	do {
		sprintf(temp, "%d", test_complete);
		put_str(temp);
		for (j = 0; j < repeats; j++) {
			put_clear();
		}
	} while(still_testing());
	pad_test_shutdown(t, 0);
	j = sliding_scale(tx_count[0], 1000000, usec_run_time);
	if (j > tty_clear_rate) {
		tty_clear_rate = j;
	}
	sprintf(temp, "%d clear-screens per second.  ", j);
	ptext(temp);
	generic_done_message(t, state, ch);
}
Beispiel #3
0
/*
**	sync_home(test_list, status, ch)
**
**	Baudrate test
*/
void
sync_home(
	struct test_list *t,
	int *state,
	int *ch)
{
	int j, k;
	unsigned long rate;

	if (!cursor_home && !cursor_address && !row_address) {
		ptext("Terminal can not home cursor.  ");
		generic_done_message(t, state, ch);
		return;
	}
	if (skip_pad_test(t, state, ch,
		"(home) Start baudrate search")) {
		return;
	}
	pad_test_startup(1);
	do {
		go_home();
		for (j = 1; j < lines; j++) {
			for (k = 0; k < columns; k++) {
				if (k & 0xF) {
					put_this(letter);
				} else {
					put_this('.');
				}
			}
			SLOW_TERMINAL_EXIT;
		}
		NEXT_LETTER;
	} while(still_testing());
	pad_test_shutdown(t, auto_right_margin == 0);
	/* note:  tty_frame_size is the real framesize times two.
	   This takes care of half bits. */
	rate = (tx_cps * tty_frame_size) >> 1;
	if (rate > tty_baud_rate) {
		tty_baud_rate = rate;
	}
	if (tx_cps > tty_cps) {
		tty_cps = tx_cps;
	}
	sprintf(temp, "%d characters per second.  Baudrate %d  ", tx_cps, j);
	ptext(temp);
	generic_done_message(t, state, ch);
}
Beispiel #4
0
/*
**	pad_standard(test_list, status, ch)
**
**	Run a single cap pad test.
*/
static void
pad_standard(
	struct test_list *t,
	int *state,
	int *ch)
{
	const char *long_name;
	char *cap;
	int l = 2, i;
	char tbuf[128];

	if ((cap = get_string_cap_byname(t->caps_done, &long_name))) {
		sprintf(tbuf, "(%s) %s, start testing", t->caps_done,
			long_name);
		if (skip_pad_test(t, state, ch, tbuf)) {
			return;
		}
		i = 1;
		pad_test_startup(1);
		do {
			if (i >= columns) {
				page_loop();
				l++;
				i = 1;
			}
			tt_putp(cap);
			putchp(letter);
			i++;
		} while(still_testing());
		pad_test_shutdown(t, 0);
		if (l >= lines) {
			home_down();
		} else {
			put_crlf();
		}
		ptextln(no_visual);
	} else {
		CAP_NOT_FOUND;
		/* Note: get_string_cap_byname() always sets long_name */
		sprintf(temp, "(%s) %s, not present.  ", t->caps_done,
			long_name);
		ptext(temp);
	}
	pad_done_message(t, state, ch);
}