[master] 932ed4a More Teken coverage

Poul-Henning Kamp phk at FreeBSD.org
Mon Apr 16 05:34:15 UTC 2018


commit 932ed4af2a26b9df3aa0639b16ec3b15b816c509
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 16 05:26:48 2018 +0000

    More Teken coverage

diff --git a/bin/varnishtest/tests/a00000.vtc b/bin/varnishtest/tests/a00000.vtc
index a79ceed..868fa54 100644
--- a/bin/varnishtest/tests/a00000.vtc
+++ b/bin/varnishtest/tests/a00000.vtc
@@ -57,7 +57,13 @@ process p4 -write "4\x08>\x1b[A\x1b[Cv\x1b[22A^\x1b[79D^\x1b[;2H<\n\n\n\n"
 process p4 -write "\n\n\n\n\n\n\n\n\x1b[B\x1b[11B\x08<\x1b[24;Hv\x1b[12;1H"
 process p4 -write "111111112222222333333\x0d\x0a111111112"
 process p4 -write "222222333333\x0d\x0a111111112222222333333 UTF8: "
-process p4 -writehex {c2 a2 20 e2 82 ac 20 f0 9f 90 b0}
+process p4 -writehex {c2 a2 20}
+process p4 -writehex {e2 82 ac 20}
+process p4 -writehex {f0 90 80 80 20}
+process p4 -writehex {f0 9f 90 b0 20}
+process p4 -writehex {f0 a0 80 80 20}
+process p4 -writehex {f0 b0 80 80 20}
+process p4 -write "\x1b[22;24;25;27;30;47m"
 process p4 -write "\x0d\x0a111111112222222333333\x0d\x0a\x1b[12"
 process p4 -write ";12H\x1b[K\x1b[13;12H\x1b[0K\x1b[14;12H\x1b[1K\x1b"
 process p4 -write "[15;12H\x1b[2K\x1b[3;1Hline3 <\x0d\x0a"
@@ -68,13 +74,15 @@ process p4 -expect-cursor 4 0
 process p4 -expect-cursor 0 1
 process p4 -screen-dump 
 
-# Exercise CONS25 mode
+# Also exercise CONS25 mode
 process p4 -write "\x1b[=1T"
+process p4 -write "\x1b[=2T"
 process p4 -write "\x1b[8z"
 process p4 -write "\x1b[0x"
 process p4 -write "\x1b[=1A"
 process p4 -write "\x1b[=1;2B"
 process p4 -write "\x1b[=1;2;3C"
+process p4 -write "\x1b[=1;2;3;4C"
 process p4 -write "\x1b[=1F"
 process p4 -write "\x1b[=1G"
 process p4 -write "\x1b[=1S"
@@ -91,3 +99,8 @@ process p4 -writehex "0c 0a 0d 43 0a 08 08 0e 44 0f"
 
 process p4 -expect-text 3 1 "C"
 process p4 -expect-text 4 1 "D"
+process p4 -write "\x1b[2T"
+process p4 -expect-text 5 1 "C"
+process p4 -expect-text 6 1 "D"
+process p4 -write "\x1b[3S"
+process p4 -expect-text 3 1 "D"
diff --git a/bin/varnishtest/vtc_process.c b/bin/varnishtest/vtc_process.c
index 44103f4..c182ed3 100644
--- a/bin/varnishtest/vtc_process.c
+++ b/bin/varnishtest/vtc_process.c
@@ -346,6 +346,30 @@ term_expect_cursor(struct process *pp, const char *lin, const char *col)
 		VSB_destroy(&vsb);					\
 	} while (0)
 
+static void
+process_coverage(struct process *p)
+{
+	const teken_attr_t *a;
+	teken_pos_t pos;
+	int fg, bg;
+
+	// Code-Coverage of Teken
+
+	(void)teken_get_sequence(p->tek, TKEY_UP);
+	(void)teken_get_sequence(p->tek, TKEY_F1);
+	(void)teken_256to8(0);
+	(void)teken_256to16(0);
+	a = teken_get_defattr(p->tek);
+	teken_set_defattr(p->tek, a);
+	a = teken_get_curattr(p->tek);
+	teken_set_curattr(p->tek, a);
+	(void)teken_get_winsize(p->tek);
+	pos.tp_row = 0;
+	pos.tp_col = 8;
+	teken_set_cursor(p->tek, &pos);
+	teken_get_defattr_cons25(p->tek, &fg, &bg);
+}
+
 static struct process *
 process_new(const char *name)
 {
@@ -374,6 +398,7 @@ process_new(const char *name)
 	VTAILQ_INSERT_TAIL(&processes, p, list);
 	teken_init(p->tek, &process_teken_func, p);
 	term_resize(p, 24, 80);
+	process_coverage(p);
 	return (p);
 }
 


More information about the varnish-commit mailing list