Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests add Makefile.inc everywhere so that we can set WARNS=4...
details: https://anonhg.NetBSD.org/src/rev/be513fdfd0de
branches: trunk
changeset: 758367:be513fdfd0de
user: christos <christos%NetBSD.org@localhost>
date: Wed Nov 03 16:10:19 2010 +0000
description:
add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing
how many bugs this found :-)
diffstat:
tests/Makefile.inc | 2 ++
tests/crypto/Makefile.inc | 1 +
tests/crypto/libcrypto/Makefile.inc | 5 +++--
tests/dev/Makefile.inc | 1 +
tests/fs/Makefile.inc | 1 +
tests/include/Makefile.inc | 1 +
tests/include/t_bitstring.c | 9 ++++-----
tests/kernel/Makefile.inc | 1 +
tests/kernel/kqueue/Makefile.inc | 1 +
tests/kernel/kqueue/t_sig.c | 8 ++++----
tests/kernel/t_extent.c | 6 +++---
tests/kernel/t_filedesc.c | 5 +++--
tests/kernel/tty/t_pr.c | 5 ++---
tests/lib/Makefile.inc | 1 +
tests/lib/csu/Makefile.inc | 1 +
tests/lib/libc/Makefile | 6 +++---
tests/lib/libc/Makefile.inc | 1 +
tests/lib/libc/gen/t_glob_star.c | 18 +++++++++---------
tests/lib/libc/hash/t_sha2.c | 18 +++++++++---------
tests/lib/libc/stdio/t_fmemopen.c | 34 ++++++++++++++++++----------------
tests/lib/libprop/t_basic.c | 7 ++++---
tests/lib/libpthread/h_resolv.c | 6 +++---
tests/lib/libpthread/t_barrier.c | 12 ++++++------
tests/lib/libpthread/t_cond.c | 22 +++++++++++-----------
tests/lib/libpthread/t_preempt.c | 11 ++++++-----
tests/lib/libpthread/t_sem.c | 16 ++++++++--------
tests/lib/libpthread/t_sigmask.c | 8 ++++----
tests/lib/libpthread/t_status.c | 8 ++++----
tests/lib/semaphore/Makefile.inc | 1 +
tests/libexec/Makefile.inc | 1 +
tests/libexec/ld.elf_so/t_dlinfo.c | 3 ++-
tests/modules/Makefile.inc | 1 +
tests/modules/k_helper/k_helper.c | 10 +++++-----
tests/modules/k_helper2/k_helper2.c | 10 +++++-----
tests/modules/t_builtin.c | 22 ++++++++++++----------
tests/modules/t_modctl.c | 9 +++++----
tests/net/Makefile.inc | 1 +
tests/net/bpf/t_div-by-zero.c | 4 ++--
tests/net/carp/t_basic.c | 7 ++++---
tests/net/icmp/t_forward.c | 5 ++---
tests/net/icmp/t_ping.c | 10 +++++-----
tests/net/if_loop/t_pr.c | 5 ++---
tests/net/sys/t_connect.c | 9 +++++----
tests/net/sys/t_listen.c | 10 ++++++----
tests/rump/Makefile.inc | 1 +
tests/util/Makefile.inc | 1 +
tests/util/df/getmntinfo.c | 4 ++--
tests/util/id/pwgr.c | 21 +++++++++++----------
48 files changed, 189 insertions(+), 161 deletions(-)
diffs (truncated from 1358 to 300 lines):
diff -r 6c2f420e3237 -r be513fdfd0de tests/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,2 @@
+# $NetBSD: Makefile.inc,v 1.1 2010/11/03 16:10:19 christos Exp $
+WARNS ?= 4
diff -r 6c2f420e3237 -r be513fdfd0de tests/crypto/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/crypto/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/crypto/libcrypto/Makefile.inc
--- a/tests/crypto/libcrypto/Makefile.inc Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/crypto/libcrypto/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile.inc,v 1.3 2010/07/13 21:13:21 jmmv Exp $
+# $NetBSD: Makefile.inc,v 1.4 2010/11/03 16:10:19 christos Exp $
.include <bsd.own.mk>
-
+# Not yet
+# .include "../Makefile.inc"
TESTSDIR= ${TESTSBASE}/crypto/libcrypto
ATFFILE= no
diff -r 6c2f420e3237 -r be513fdfd0de tests/dev/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/dev/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/fs/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fs/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/include/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/include/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/include/t_bitstring.c
--- a/tests/include/t_bitstring.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/include/t_bitstring.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_bitstring.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $ */
+/* $NetBSD: t_bitstring.c,v 1.2 2010/11/03 16:10:20 christos Exp $ */
/*-
* Copyright (c) 1993, 2008, 2010 The NetBSD Foundation, Inc.
@@ -63,9 +63,8 @@
static void
calculate_data(FILE *file, const int test_length)
{
- int b, i;
+ int i;
bitstr_t *bs;
- bitstr_t bit_decl(bss, 37); /* Mostly a random number. */
assert(test_length >= 4);
@@ -75,7 +74,7 @@
(void) fprintf(file, " i _bit_byte(i) _bit_mask(i) bitstr_size(i)\n");
for (i=0; i < test_length; i++) {
- (void) fprintf(file, "%3d%15d%15d%15d\n",
+ (void) fprintf(file, "%3d%15u%15u%15zu\n",
i, _bit_byte(i), _bit_mask(i), bitstr_size(i));
}
@@ -205,7 +204,7 @@
(void) free(bs);
}
-void
+static void
one_check(const atf_tc_t *tc, const int test_length)
{
FILE *out;
diff -r 6c2f420e3237 -r be513fdfd0de tests/kernel/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/kernel/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/kernel/kqueue/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/kernel/kqueue/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/kernel/kqueue/t_sig.c
--- a/tests/kernel/kqueue/t_sig.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/kernel/kqueue/t_sig.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sig.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+/* $NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sig.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+__RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $");
#include <sys/event.h>
#include <sys/ioctl.h>
@@ -111,8 +111,8 @@
RL(gettimeofday(&now, NULL));
timersub(&now, &then, &diff);
- (void)printf("sig: kevent returned %d in %ld.%06ld\n",
- n, diff.tv_sec, diff.tv_usec);
+ (void)printf("sig: kevent returned %d in %lld.%06ld\n",
+ n, (long long)diff.tv_sec, (long)diff.tv_usec);
if (n == 0)
continue;
diff -r 6c2f420e3237 -r be513fdfd0de tests/kernel/t_extent.c
--- a/tests/kernel/t_extent.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/kernel/t_extent.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_extent.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+/* $NetBSD: t_extent.c,v 1.2 2010/11/03 16:10:20 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.1 2009/02/20 21:39:57 jmmv Exp $");
+__RCSID("$NetBSD: t_extent.c,v 1.2 2010/11/03 16:10:20 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, u_long flags, const char *exp)
+ u_long end, long flags, const char *exp)
{
char buf[4096];
struct extent_region *rp;
diff -r 6c2f420e3237 -r be513fdfd0de tests/kernel/t_filedesc.c
--- a/tests/kernel/t_filedesc.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/kernel/t_filedesc.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_filedesc.c,v 1.3 2010/08/04 14:28:28 pooka Exp $ */
+/* $NetBSD: t_filedesc.c,v 1.4 2010/11/03 16:10:20 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_filedesc.c,v 1.3 2010/08/04 14:28:28 pooka Exp $");
+__RCSID("$NetBSD: t_filedesc.c,v 1.4 2010/11/03 16:10:20 christos Exp $");
#include <sys/types.h>
@@ -35,6 +35,7 @@
#include <atf-c.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <pthread.h>
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
diff -r 6c2f420e3237 -r be513fdfd0de tests/kernel/tty/t_pr.c
--- a/tests/kernel/tty/t_pr.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/kernel/tty/t_pr.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pr.c,v 1.2 2010/07/03 08:18:30 jmmv Exp $ */
+/* $NetBSD: t_pr.c,v 1.3 2010/11/03 16:10:20 christos Exp $ */
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -24,8 +24,7 @@
rump_init();
fd = rump_sys_open("/dev/ptyp1", O_RDWR);
- if (fd == -1)
- err(1, "open");
+ ATF_CHECK(fd != -1);
/* boom, dies with null deref under ptcwakeup() */
atf_tc_expect_signal(-1, "PR kern/40688");
diff -r 6c2f420e3237 -r be513fdfd0de tests/lib/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/lib/csu/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/csu/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/lib/libc/Makefile
--- a/tests/lib/libc/Makefile Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/lib/libc/Makefile Wed Nov 03 16:10:19 2010 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.6 2010/09/09 22:25:38 christos Exp $
+# $NetBSD: Makefile,v 1.7 2010/11/03 16:10:21 christos Exp $
.include <bsd.own.mk>
-TESTS_SUBDIRS+= gen hash stdlib
+TESTS_SUBDIRS+= gen hash stdlib stdio
# Disabled for now, only test in there is very expensive
-#SUBDIR+= string
+SUBDIR+= string
TESTSDIR= ${TESTSBASE}/lib/libc
diff -r 6c2f420e3237 -r be513fdfd0de tests/lib/libc/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/Makefile.inc Wed Nov 03 16:10:19 2010 +0000
@@ -0,0 +1,1 @@
+.include "../Makefile.inc"
diff -r 6c2f420e3237 -r be513fdfd0de tests/lib/libc/gen/t_glob_star.c
--- a/tests/lib/libc/gen/t_glob_star.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/lib/libc/gen/t_glob_star.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_glob_star.c,v 1.5 2010/10/13 11:19:28 pooka Exp $ */
+/* $NetBSD: t_glob_star.c,v 1.6 2010/11/03 16:10:21 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_glob_star.c,v 1.5 2010/10/13 11:19:28 pooka Exp $");
+__RCSID("$NetBSD: t_glob_star.c,v 1.6 2010/11/03 16:10:21 christos Exp $");
#include <atf-c.h>
@@ -127,12 +127,12 @@
gl_readdir(void *v)
{
static struct dirent dir;
- struct gl_dir *d = v;
- if (d->pos < d->len) {
- const struct gl_file *f = &d->dir[d->pos++];
+ struct gl_dir *dd = v;
+ if (dd->pos < dd->len) {
+ const struct gl_file *f = &dd->dir[dd->pos++];
strcpy(dir.d_name, f->name);
dir.d_namlen = strlen(f->name);
- dir.d_ino = d->pos;
+ dir.d_ino = dd->pos;
dir.d_type = f->dir ? DT_DIR : DT_REG;
DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type));
dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen);
@@ -162,9 +162,9 @@
static void
gl_closedir(void *v)
{
- struct gl_dir *d = v;
- d->pos = 0;
- DPRINTF(("closedir %p\n", d));
+ struct gl_dir *dd = v;
+ dd->pos = 0;
+ DPRINTF(("closedir %p\n", dd));
}
static void
diff -r 6c2f420e3237 -r be513fdfd0de tests/lib/libc/hash/t_sha2.c
--- a/tests/lib/libc/hash/t_sha2.c Wed Nov 03 16:09:43 2010 +0000
+++ b/tests/lib/libc/hash/t_sha2.c Wed Nov 03 16:10:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sha2.c,v 1.1 2010/01/24 21:12:17 joerg Exp $ */
+/* $NetBSD: t_sha2.c,v 1.2 2010/11/03 16:10:22 christos Exp $ */
/*-
* Copyright (c) 20010 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sha2.c,v 1.1 2010/01/24 21:12:17 joerg Exp $");
+__RCSID("$NetBSD: t_sha2.c,v 1.2 2010/11/03 16:10:22 christos Exp $");
#include <atf-c.h>
#include <sys/types.h>
@@ -144,7 +144,7 @@
{ "abcdefghijklmnopqrstuvwq", "404eb5652173323320cac6bf8d9714aef0747693a8ab4570700c6262268d367f30e31c44fa66860568ff058fe39c9aa8dac76bc78566c691a884cb9052c4aa0a" },
};
-void
+static void
digest2string(const uint8_t *digest, char *string, size_t len)
{
while (len--) {
@@ -171,8 +171,8 @@
{
size_t i, j, len;
Home |
Main Index |
Thread Index |
Old Index