Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests Turn warns on for all tests and fix all the bugs.
details: https://anonhg.NetBSD.org/src/rev/e02f502778f9
branches: trunk
changeset: 765945:e02f502778f9
user: christos <christos%NetBSD.org@localhost>
date: Sat Jun 11 18:03:17 2011 +0000
description:
Turn warns on for all tests and fix all the bugs.
diffstat:
tests/crypto/libcrypto/Makefile.inc | 5 +-
tests/fs/ffs/h_quota2_tests.c | 22 +-
tests/fs/nfs/nfsservice/rpcbind/util.c | 4 +-
tests/fs/tmpfs/h_tools.c | 14 +-
tests/kernel/t_extent.c | 8 +-
tests/kernel/t_writev.c | 6 +-
tests/lib/libc/Makefile | 5 +-
tests/lib/libc/gen/t_dir.c | 20 +-
tests/lib/libc/gen/t_humanize_number.c | 4 +-
tests/lib/libc/locale/t_wctomb.c | 6 +-
tests/lib/libc/net/Makefile.inc | 1 +
tests/lib/libc/stdio/t_popen.c | 7 +-
tests/lib/libc/t_convfp.c | 6 +-
tests/lib/libc/tls/Makefile.inc | 1 +
tests/lib/libcurses/director/director.c | 51 +--
tests/lib/libcurses/director/testlang_conf.l | 22 +-
tests/lib/libcurses/director/testlang_parse.y | 285 ++++++++--------
tests/lib/libcurses/slave/Makefile | 4 +-
tests/lib/libcurses/slave/commands.c | 70 +--
tests/lib/libcurses/slave/curses_commands.c | 326 +++++++++----------
tests/lib/libcurses/slave/slave.c | 11 +-
tests/lib/libcurses/slave/slave.h | 6 +-
tests/lib/libposix/Makefile.inc | 1 +
tests/libexec/Makefile | 4 +-
tests/libexec/ld.elf_so/Makefile.inc | 1 +
tests/libexec/ld.elf_so/helper_dso1/h_helper_dso1.c | 6 +-
tests/libexec/ld.elf_so/helper_dso2/h_helper_dso2.c | 4 +-
27 files changed, 437 insertions(+), 463 deletions(-)
diffs (truncated from 2970 to 300 lines):
diff -r c1abaabdfc53 -r e02f502778f9 tests/crypto/libcrypto/Makefile.inc
--- a/tests/crypto/libcrypto/Makefile.inc Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/crypto/libcrypto/Makefile.inc Sat Jun 11 18:03:17 2011 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.5 2011/05/26 12:56:32 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.6 2011/06/11 18:03:17 christos Exp $
.include <bsd.own.mk>
-# Not yet
-# .include "../Makefile.inc"
+.include "../Makefile.inc"
TESTSDIR= ${TESTSBASE}/crypto/libcrypto
ATFFILE= no
diff -r c1abaabdfc53 -r e02f502778f9 tests/fs/ffs/h_quota2_tests.c
--- a/tests/fs/ffs/h_quota2_tests.c Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/fs/ffs/h_quota2_tests.c Sat Jun 11 18:03:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_quota2_tests.c,v 1.2 2011/03/06 17:08:40 bouyer Exp $ */
+/* $NetBSD: h_quota2_tests.c,v 1.3 2011/06/11 18:03:17 christos Exp $ */
/*
* rump server for advanced quota tests
@@ -38,18 +38,18 @@
rump_sys_chmod(".", 0777);
if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_setegid");
+ warn("rump_sys_setegid");
return error;
}
if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_seteuid");
+ warn("rump_sys_seteuid");
return error;
}
fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
if (fd < 0) {
error = errno;
- perror("rump_sys_open");
+ warn("rump_sys_open");
} else {
while (rump_sys_write(fd, buf, sizeof(buf)) == sizeof(buf))
error = 0;
@@ -71,18 +71,18 @@
rump_sys_chmod(".", 0777);
if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_setegid");
+ warn("rump_sys_setegid");
return error;
}
if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_seteuid");
+ warn("rump_sys_seteuid");
return error;
}
fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
if (fd < 0) {
error = errno;
- perror("rump_sys_open");
+ warn("rump_sys_open");
} else {
/*
* write up to the soft limit, wait a bit, an try to
@@ -120,12 +120,12 @@
rump_sys_chmod(".", 0777);
if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_setegid");
+ warn("rump_sys_setegid");
return error;
}
if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_seteuid");
+ warn("rump_sys_seteuid");
return error;
}
@@ -157,12 +157,12 @@
rump_sys_chmod(".", 0777);
if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_setegid");
+ warn("rump_sys_setegid");
return error;
}
if (rump_sys_seteuid(TEST_NONROOT_ID) != 0) {
error = errno;
- perror("rump_sys_seteuid");
+ warn("rump_sys_seteuid");
return error;
}
diff -r c1abaabdfc53 -r e02f502778f9 tests/fs/nfs/nfsservice/rpcbind/util.c
--- a/tests/fs/nfs/nfsservice/rpcbind/util.c Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/fs/nfs/nfsservice/rpcbind/util.c Sat Jun 11 18:03:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: util.c,v 1.1 2010/07/26 15:53:01 pooka Exp $ */
+/* $NetBSD: util.c,v 1.2 2011/06/11 18:03:17 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -378,7 +378,7 @@
if (setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq6,
sizeof mreq6) < 0)
if (debugging)
- perror("setsockopt v6 multicast");
+ warn("setsockopt v6 multicast");
}
#endif
diff -r c1abaabdfc53 -r e02f502778f9 tests/fs/tmpfs/h_tools.c
--- a/tests/fs/tmpfs/h_tools.c Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/fs/tmpfs/h_tools.c Sat Jun 11 18:03:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_tools.c,v 1.3 2011/01/15 20:16:57 martin Exp $ */
+/* $NetBSD: h_tools.c,v 1.4 2011/06/11 18:03:17 christos Exp $ */
/*
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@
if (fh != NULL)
free(fh);
if (errno != E2BIG) {
- perror("getfh");
+ warn("getfh");
return EXIT_FAILURE;
}
}
@@ -100,7 +100,7 @@
error = write(STDOUT_FILENO, fh, fh_size);
if (error == -1) {
- perror("write");
+ warn("write");
return EXIT_FAILURE;
}
free(fh);
@@ -206,7 +206,7 @@
return EXIT_FAILURE;
if (rename(argv[1], argv[2]) == -1) {
- perror("rename");
+ warn("rename");
return EXIT_FAILURE;
}
@@ -226,7 +226,7 @@
fd = socket(PF_LOCAL, SOCK_STREAM, 0);
if (fd == -1) {
- perror("socket");
+ warn("socket");
return EXIT_FAILURE;
}
@@ -235,7 +235,7 @@
error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
if (error == -1) {
- perror("connect");
+ warn("connect");
return EXIT_FAILURE;
}
@@ -257,7 +257,7 @@
error = statvfs(argv[1], &buf);
if (error != 0) {
- perror("statvfs");
+ warn("statvfs");
return EXIT_FAILURE;
}
diff -r c1abaabdfc53 -r e02f502778f9 tests/kernel/t_extent.c
--- a/tests/kernel/t_extent.c Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/kernel/t_extent.c Sat Jun 11 18:03:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_extent.c,v 1.2 2010/11/03 16:10:20 christos Exp $ */
+/* $NetBSD: t_extent.c,v 1.3 2011/06/11 18:03:17 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_extent.c,v 1.2 2010/11/03 16:10:20 christos Exp $");
+__RCSID("$NetBSD: t_extent.c,v 1.3 2011/06/11 18:03:17 christos Exp $");
#include <sys/types.h>
#include <sys/queue.h>
@@ -82,7 +82,7 @@
static void
h_require(const char *name, u_long start,
- u_long end, long flags, const char *exp)
+ u_long end, int flags, const char *exp)
{
char buf[4096];
struct extent_region *rp;
@@ -95,7 +95,7 @@
ATF_REQUIRE_EQ_MSG(ex->ex_end, end,
"expected: %#lx, got: %#lx", end, ex->ex_end);
ATF_REQUIRE_EQ_MSG(ex->ex_flags, flags,
- "expected: %#lx, got: %#lx", flags, ex->ex_flags);
+ "expected: %#x, got: %#x", flags, ex->ex_flags);
(void)memset(buf, 0, sizeof(buf));
LIST_FOREACH(rp, &ex->ex_regions, er_link)
diff -r c1abaabdfc53 -r e02f502778f9 tests/kernel/t_writev.c
--- a/tests/kernel/t_writev.c Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/kernel/t_writev.c Sat Jun 11 18:03:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_writev.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+/* $NetBSD: t_writev.c,v 1.2 2011/06/11 18:03:17 christos Exp $ */
/*-
* Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_writev.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+__RCSID("$NetBSD: t_writev.c,v 1.2 2011/06/11 18:03:17 christos Exp $");
#include <sys/uio.h>
#include <sys/syslimits.h>
@@ -58,7 +58,7 @@
errno = 0;
retval = writev(2, NULL, IOV_MAX + 1);
- ATF_REQUIRE_EQ_MSG(retval, -1, "got: %d", retval);
+ ATF_REQUIRE_EQ_MSG(retval, -1, "got: %zd", retval);
ATF_REQUIRE_EQ_MSG(errno, EINVAL, "got: %s", strerror(errno));
}
diff -r c1abaabdfc53 -r e02f502778f9 tests/lib/libc/Makefile
--- a/tests/lib/libc/Makefile Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/lib/libc/Makefile Sat Jun 11 18:03:17 2011 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.40 2011/05/01 11:44:41 jruoho Exp $
+# $NetBSD: Makefile,v 1.41 2011/06/11 18:03:18 christos Exp $
+.include "Makefile.inc"
+.include <bsd.sys.mk>
.include <bsd.own.mk>
-.include <bsd.sys.mk>
SUBDIR+= tls_dso .WAIT
diff -r c1abaabdfc53 -r e02f502778f9 tests/lib/libc/gen/t_dir.c
--- a/tests/lib/libc/gen/t_dir.c Sat Jun 11 16:54:56 2011 +0000
+++ b/tests/lib/libc/gen/t_dir.c Sat Jun 11 18:03:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dir.c,v 1.2 2011/04/07 18:14:08 jruoho Exp $ */
+/* $NetBSD: t_dir.c,v 1.3 2011/06/11 18:03:18 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -75,6 +75,8 @@
/* get second entry */
entry = readdir(dp);
wasname = strdup(entry->d_name);
+ if (wasname == NULL)
+ atf_tc_fail("cannot allocate memory");
/* get third entry */
entry = readdir(dp);
@@ -83,6 +85,8 @@
seekdir(dp, here);
entry = readdir(dp);
+ if (entry == NULL)
+ atf_tc_fail("entry 1 not found");
if (strcmp(entry->d_name, wasname) != 0)
atf_tc_fail("1st seekdir found wrong name");
@@ -91,6 +95,8 @@
here = telldir(dp);
entry = readdir(dp);
+ if (entry == NULL)
+ atf_tc_fail("entry 2 not found");
if (strcmp(entry->d_name, wasname) != 0)
atf_tc_fail("2nd seekdir found wrong name");
@@ -98,6 +104,8 @@
seekdir(dp, here);
entry = readdir(dp);
+ if (entry == NULL)
+ atf_tc_fail("entry 3 not found");
if (strcmp(entry->d_name, wasname) != 0)
atf_tc_fail("3rd seekdir found wrong name");
Home |
Main Index |
Thread Index |
Old Index