From f78b0f838750cbcf2b8b84e81ec0c98c386a0200 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 26 Jun 2009 08:00:28 -0600 Subject: [PATCH] tests: add test for bogus NULL definition * tests/test-stdio.c: Ensure POSIX 2008 requirement on NULL. * tests/test-stdlib.c: Likewise. * tests/test-string.c: Likewise. * tests/test-locale.c: Likewise. * tests/test-unistd.c: Likewise. * modules/stdio-tests (Depends-on): Add verify. * modules/stdlib-tests (Depends-on): Likewise. * modules/string-tests (Depends-on): Likewise. * modules/locale-tests (Depends-on): Likewise. * modules/unistd-tests (Depends-on): Likewise. Signed-off-by: Eric Blake --- ChangeLog | 14 ++++++++++++++ modules/locale-tests | 1 + modules/stdio-tests | 1 + modules/stdlib-tests | 1 + modules/string-tests | 1 + modules/unistd-tests | 1 + tests/test-locale.c | 8 +++++++- tests/test-stdio.c | 8 +++++++- tests/test-stdlib.c | 8 +++++++- tests/test-string.c | 8 +++++++- tests/test-unistd.c | 6 ++++++ 11 files changed, 53 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76029c773..c146e8cfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-06-27 Eric Blake + + tests: add test for bogus NULL definition + * tests/test-stdio.c: Ensure POSIX 2008 requirement on NULL. + * tests/test-stdlib.c: Likewise. + * tests/test-string.c: Likewise. + * tests/test-locale.c: Likewise. + * tests/test-unistd.c: Likewise. + * modules/stdio-tests (Depends-on): Add verify. + * modules/stdlib-tests (Depends-on): Likewise. + * modules/string-tests (Depends-on): Likewise. + * modules/locale-tests (Depends-on): Likewise. + * modules/unistd-tests (Depends-on): Likewise. + 2009-06-27 Paolo Bonzini * m4/selinux-context-h (gl_HEADERS_SELINUX_CONTEXT_H): Remove diff --git a/modules/locale-tests b/modules/locale-tests index 3a5fa8705..19bc373cb 100644 --- a/modules/locale-tests +++ b/modules/locale-tests @@ -2,6 +2,7 @@ Files: tests/test-locale.c Depends-on: +verify configure.ac: diff --git a/modules/stdio-tests b/modules/stdio-tests index cc0f14ec2..c572bfb4c 100644 --- a/modules/stdio-tests +++ b/modules/stdio-tests @@ -2,6 +2,7 @@ Files: tests/test-stdio.c Depends-on: +verify configure.ac: diff --git a/modules/stdlib-tests b/modules/stdlib-tests index 8a5a78fa5..3503511ef 100644 --- a/modules/stdlib-tests +++ b/modules/stdlib-tests @@ -2,6 +2,7 @@ Files: tests/test-stdlib.c Depends-on: +verify configure.ac: diff --git a/modules/string-tests b/modules/string-tests index 67d08bb5e..ab8699a71 100644 --- a/modules/string-tests +++ b/modules/string-tests @@ -2,6 +2,7 @@ Files: tests/test-string.c Depends-on: +verify configure.ac: diff --git a/modules/unistd-tests b/modules/unistd-tests index 703d5572c..7f9d44da8 100644 --- a/modules/unistd-tests +++ b/modules/unistd-tests @@ -2,6 +2,7 @@ Files: tests/test-unistd.c Depends-on: +verify configure.ac: diff --git a/tests/test-locale.c b/tests/test-locale.c index 39e7de9d7..625cc43d8 100644 --- a/tests/test-locale.c +++ b/tests/test-locale.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,8 @@ #include +#include "verify.h" + int a[] = { LC_ALL, @@ -31,6 +33,10 @@ int a[] = LC_TIME }; +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + int main () { diff --git a/tests/test-stdio.c b/tests/test-stdio.c index a5efa320b..dcfe38dd5 100644 --- a/tests/test-stdio.c +++ b/tests/test-stdio.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,9 +20,15 @@ #include +#include "verify.h" + /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + int main () { diff --git a/tests/test-stdlib.c b/tests/test-stdlib.c index e103d46b2..ae46ba166 100644 --- a/tests/test-stdlib.c +++ b/tests/test-stdlib.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,8 +20,14 @@ #include +#include "verify.h" + int exitcode; +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + int main () { diff --git a/tests/test-string.c b/tests/test-string.c index 68014f54c..fe53cd9b1 100644 --- a/tests/test-string.c +++ b/tests/test-string.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,12 @@ #include +#include "verify.h" + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + int main () { diff --git a/tests/test-unistd.c b/tests/test-unistd.c index 5fed15cf9..129367b4d 100644 --- a/tests/test-unistd.c +++ b/tests/test-unistd.c @@ -20,6 +20,12 @@ #include +#include "verify.h" + +/* Check that NULL can be passed through varargs as a pointer type, + per POSIX 2008. */ +verify (sizeof NULL == sizeof (void *)); + /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; -- 2.11.0