[master] 7d2d86dce Test-cover for the last three lines of vct.h

Poul-Henning Kamp phk at FreeBSD.org
Sat Aug 28 10:33:04 UTC 2021


commit 7d2d86dce385a0ca132e608378b1ba8541adf902
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Aug 28 10:32:00 2021 +0000

    Test-cover for the last three lines of vct.h

diff --git a/lib/libvarnish/vct.c b/lib/libvarnish/vct.c
index 3ad131105..4bf6004a7 100644
--- a/lib/libvarnish/vct.c
+++ b/lib/libvarnish/vct.c
@@ -303,11 +303,16 @@ int
 main(int argc, char **argv)
 {
 	int i;
+	const char *p;
+
 	(void)argc;
 	(void)argv;
 
 	AN(setlocale(LC_ALL, "C"));
 
+	p = "";
+	assert(vct_iscrlf(p, p) == 0);
+
 	for (i = 0x20; i < 0x7f; i++)
 		assert(vct_lowertab[i] == tolower(i));
 
@@ -329,6 +334,10 @@ main(int argc, char **argv)
 	assert(vct_caselencmp("AZaz ", "azAY", 5) > 0);
 	assert(vct_caselencmp("AZay ", "azAZ", 5) < 0);
 
+	assert(vct_caselencmp("AZaz", "azAZ1", 5) < 0);
+	assert(vct_caselencmp("AZaz1", "azAZ", 5) > 0);
+
+
 	assert(vct_caselencmp("A", "B", 0) == 0);
 
 	return (0);


More information about the varnish-commit mailing list