summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2022-02-06 22:58:34 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2022-02-06 22:58:34 +0000
commit3d833436e3d62723e7c71bde000b1ad55aaa3f85 (patch)
tree5293600014eac9686d78a9ea13e13e6c0b0f40ff /regress/usr.bin
parentb4daa42995f0cd645e31bdbe58ef6bc09479ff7c (diff)
Add test for empty hostname with port.
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/ssh/unittests/misc/test_hpdelim.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/unittests/misc/test_hpdelim.c b/regress/usr.bin/ssh/unittests/misc/test_hpdelim.c
index ccd53d99c39..7f804456e79 100644
--- a/regress/usr.bin/ssh/unittests/misc/test_hpdelim.c
+++ b/regress/usr.bin/ssh/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
*
@@ -35,6 +35,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);