[openssh-commits] [openssh] 04/04: upstream: Add test for empty hostname with port.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Feb 10 15:17:38 AEDT 2022


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 25bd659cc72268f2858c5415740c442ee950049f
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Sun Feb 6 22:58:33 2022 +0000

    upstream: Add test for empty hostname with port.
    
    OpenBSD-Regress-ID: e19e89d3c432b68997667efea44cf015bbe2a7e3
---
 regress/unittests/misc/test_hpdelim.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/regress/unittests/misc/test_hpdelim.c b/regress/unittests/misc/test_hpdelim.c
index a6e99367..9da0159d 100644
--- a/regress/unittests/misc/test_hpdelim.c
+++ b/regress/unittests/misc/test_hpdelim.c
@@ -1,4 +1,4 @@
-/* 	$OpenBSD: test_hpdelim.c,v 1.1 2022/02/04 07:53:44 dtucker Exp $ */
+/* 	$OpenBSD: test_hpdelim.c,v 1.2 2022/02/06 22:58:33 dtucker Exp $ */
 /*
  * Regress test for misc hpdelim() and co
  *
@@ -39,6 +39,17 @@ test_hpdelim(void)
 	DONE_STRING();
 	TEST_DONE();
 
+	TEST_START("hpdelim :port");
+	START_STRING(":1234");
+	cp = hpdelim(&str);
+	ASSERT_STRING_EQ(cp, "");
+	ASSERT_PTR_NE(str, NULL);
+	port = hpdelim(&str);
+	ASSERT_STRING_EQ(port, "1234");
+	ASSERT_PTR_EQ(str, NULL);
+	DONE_STRING();
+	TEST_DONE();
+
 	TEST_START("hpdelim host:port");
 	START_STRING("host:1234");
 	cp = hpdelim(&str);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list