[openssh-commits] [openssh] 01/01: Fix helper include path and remove excess code.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Feb 11 10:06:00 AEDT 2022


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

dtucker pushed a commit to branch master
in repository openssh.

commit 6ee53064f476cf163acd5521da45b11b7c57321b
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Feb 11 10:03:06 2022 +1100

    Fix helper include path and remove excess code.
    
    Looks like test_hpdelim.c was imported twice into the same file.
    Spotted by kevin.brott at gmail com and chris at cataclysmal org.
---
 regress/unittests/misc/test_hpdelim.c | 80 +----------------------------------
 1 file changed, 1 insertion(+), 79 deletions(-)

diff --git a/regress/unittests/misc/test_hpdelim.c b/regress/unittests/misc/test_hpdelim.c
index 9da0159d..d423023d 100644
--- a/regress/unittests/misc/test_hpdelim.c
+++ b/regress/unittests/misc/test_hpdelim.c
@@ -15,85 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test_helper.h"
-
-#include "log.h"
-#include "misc.h"
-#include "xmalloc.h"
-
-void test_hpdelim(void);
-
-void
-test_hpdelim(void)
-{
-	char *orig, *str, *cp, *port;
-
-#define START_STRING(x)	orig = str = xstrdup(x)
-#define DONE_STRING()	free(orig)
-
-	TEST_START("hpdelim host only");
-	START_STRING("host");
-	cp = hpdelim(&str);
-	ASSERT_STRING_EQ(cp, "host");
-	ASSERT_PTR_EQ(str, NULL);
-	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);
-	ASSERT_STRING_EQ(cp, "host");
-	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("[::1]:1234");
-	cp = hpdelim(&str);
-	ASSERT_STRING_EQ(cp, "[::1]");
-	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 missing ] error");
-	START_STRING("[::1:1234");
-	cp = hpdelim(&str);
-	ASSERT_PTR_EQ(cp, NULL);
-	DONE_STRING();
-	TEST_DONE();
-
-}
-/* 	$OpenBSD: test_hpdelim.c,v 1.2 2022/02/06 22:58:33 dtucker Exp $ */
-/*
- * Regress test for misc hpdelim() and co
- *
- * Placed in the public domain.
- */
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "test_helper.h"
+#include "../test_helper/test_helper.h"
 
 #include "log.h"
 #include "misc.h"

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


More information about the openssh-commits mailing list