upstream: fix memleak in test

OpenBSD-Regress-ID: 5e529d0982aa04666604936df43242e97a7a6f81
This commit is contained in:
djm@openbsd.org 2021-05-21 04:03:47 +00:00 committed by Damien Miller
parent 60455a5d98
commit 1a4d1da918
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: test_argv.c,v 1.1 2021/03/19 04:23:50 djm Exp $ */
/* $OpenBSD: test_argv.c,v 1.2 2021/05/21 04:03:47 djm Exp $ */
/*
* Regress test for misc argv handling functions.
*
@ -55,6 +55,7 @@ test_argv(void)
ASSERT_INT_EQ(ac, 0);
ASSERT_PTR_NE(av, NULL);
ASSERT_PTR_EQ(av[0], NULL);
RESET_ARGV();
TEST_DONE();
TEST_START("trivial args");
@ -71,6 +72,7 @@ test_argv(void)
ASSERT_STRING_EQ(av[0], "smiley");
ASSERT_STRING_EQ(av[1], "leamas");
ASSERT_PTR_EQ(av[2], NULL);
RESET_ARGV();
TEST_DONE();
TEST_START("quoted");
@ -100,6 +102,7 @@ test_argv(void)
ASSERT_STRING_EQ(av[0], "smiley leamas");
ASSERT_STRING_EQ(av[1], "liz");
ASSERT_PTR_EQ(av[2], NULL);
RESET_ARGV();
TEST_DONE();
TEST_START("escaped");
@ -135,6 +138,7 @@ test_argv(void)
ASSERT_STRING_EQ(av[0], "leamas\\");
ASSERT_STRING_EQ(av[1], "\\smiley");
ASSERT_PTR_EQ(av[2], NULL);
RESET_ARGV();
TEST_DONE();
/* XXX test char *argv_assemble(int argc, char **argv) */