[master] 6d40577 Even more Teken coverage

Poul-Henning Kamp phk at FreeBSD.org
Sat Apr 7 13:00:13 UTC 2018


commit 6d40577825d8096bcf6678e7cfcda5c1ce5f7d32
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Apr 7 12:59:33 2018 +0000

    Even more Teken coverage

diff --git a/bin/varnishtest/tests/a00001.vtc b/bin/varnishtest/tests/a00001.vtc
index 16f0437..dfca677 100644
--- a/bin/varnishtest/tests/a00001.vtc
+++ b/bin/varnishtest/tests/a00001.vtc
@@ -7,6 +7,7 @@ process p4 {vttest} -start
 process p4 -expect-text 21 11 "Enter choice number (0 - 12):"
 process p4 -screen_dump
 
+# 1. Test of cursor movements
 process p4 -writehex "31 0d"
 process p4 -expect-text 14 61 "RETURN"
 process p4 -screen_dump
@@ -37,6 +38,7 @@ process p4 -writehex 0d
 process p4 -expect-text 21 11 "Enter choice number (0 - 12):"
 process p4 -screen_dump
 
+# 2. Test of screen features
 process p4 -writehex "32 0d"
 process p4 -expect-text 8 1 "Push <RETURN>"
 process p4 -screen_dump
@@ -104,6 +106,105 @@ process p4 -writehex 0d
 process p4 -expect-text 21 11 "Enter choice number (0 - 12):"
 process p4 -screen_dump
 
+# 4. Test of double-sized characters
+process p4 -writehex "34 0d"
+process p4 -expect-text 21 1 "This is not a double-width line"
+process p4 -expect-text 23 1 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex "0d"
+process p4 -expect-text 21 1 "This **is** a double-width line"
+process p4 -expect-text 23 1 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex "0d"
+process p4 -expect-text 21 1 "This is not a double-width line"
+process p4 -expect-text 23 1 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex "0d"
+process p4 -expect-text 21 1 "This **is** a double-width line"
+process p4 -expect-text 23 1 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex "0d"
+delay 2
+process p4 -expect-text 23 41 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex "0d"
+delay 2
+process p4 -expect-text 1 1 "Exactly half of the box should remain. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 21 11 "Enter choice number (0 - 12):"
+process p4 -screen_dump
+
+# 8. Test of VT102 features (Insert/Delete Char/Line)
+process p4 -writehex "38 0d"
+process p4 -expect-text 4 1 "Screen accordion test (Insert & Delete Line). Push <RETURN>D"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 2 45 "nothing more. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 4 59 "*B'. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 4 52 "'AB'. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 5 1 "by one.  Push <RETURN>E"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 5 1 "by one.  Push <RETURN>EEEEEEEEEEEEE "
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 10 1 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 4 1 "Screen accordion test (Insert & Delete Line). Push <RETURN>D"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 2 45 "nothing more. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 4 59 "*B'. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 4 52 "'AB'. Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 5 1 "by one.  Push <RETURN>E"
+process p4 -screen_dump
+
+
+process p4 -writehex 0d
+process p4 -expect-text 5 59 "EEE "
+process p4 -expect-text 5 1 "by one.  Push <RETURN>E"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 10 1 "Push <RETURN>"
+process p4 -screen_dump
+
+process p4 -writehex 0d
+process p4 -expect-text 21 11 "Enter choice number (0 - 12):"
+process p4 -screen_dump
+
+# 0. Exit
 process p4 -writehex "30 0d"
 process p4 -expect-text 12 30 "That's all, folks!"
 process p4 -screen_dump
diff --git a/bin/varnishtest/vtc_process.c b/bin/varnishtest/vtc_process.c
index 1bbf137..be76323 100644
--- a/bin/varnishtest/vtc_process.c
+++ b/bin/varnishtest/vtc_process.c
@@ -289,7 +289,7 @@ static void
 term_expect_text(struct process *pp,
     const char *lin, const char *col, const char *pat)
 {
-	int x, y, l;
+	int x, y, l, d = 10000;
 	char *t;
 
 	y = strtoul(lin, NULL, 0);
@@ -303,8 +303,10 @@ term_expect_text(struct process *pp,
 			    "text at %d,%d: '%.*s'", y, x, l, t);
 		}
 		AZ(pthread_mutex_unlock(&pp->mtx));
-		usleep(1000000);
+		usleep(d);
 		AZ(pthread_mutex_lock(&pp->mtx));
+		if (d < 300000)
+			d += d;
 	}
 	AZ(pthread_mutex_unlock(&pp->mtx));
 	vtc_log(pp->vl, 4, "found expected text at %d,%d: '%s'", y, x, pat);


More information about the varnish-commit mailing list