tests: add test for bogus NULL definition
authorEric Blake <ebb9@byu.net>
Fri, 26 Jun 2009 14:00:28 +0000 (08:00 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 27 Jun 2009 21:17:06 +0000 (15:17 -0600)
* 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 <ebb9@byu.net>
ChangeLog
modules/locale-tests
modules/stdio-tests
modules/stdlib-tests
modules/string-tests
modules/unistd-tests
tests/test-locale.c
tests/test-stdio.c
tests/test-stdlib.c
tests/test-string.c
tests/test-unistd.c

index 76029c7..c146e8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-06-27  Eric Blake  <ebb9@byu.net>
+
+       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  <bonzini@gnu.org>
 
        * m4/selinux-context-h (gl_HEADERS_SELINUX_CONTEXT_H): Remove
index 3a5fa87..19bc373 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-locale.c
 
 Depends-on:
+verify
 
 configure.ac:
 
index cc0f14e..c572bfb 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-stdio.c
 
 Depends-on:
+verify
 
 configure.ac:
 
index 8a5a78f..3503511 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-stdlib.c
 
 Depends-on:
+verify
 
 configure.ac:
 
index 67d08bb..ab8699a 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-string.c
 
 Depends-on:
+verify
 
 configure.ac:
 
index 703d557..7f9d44d 100644 (file)
@@ -2,6 +2,7 @@ Files:
 tests/test-unistd.c
 
 Depends-on:
+verify
 
 configure.ac:
 
index 39e7de9..625cc43 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <locale.h> 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 <locale.h>
 
+#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 ()
 {
index a5efa32..dcfe38d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> 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
 
 #include <stdio.h>
 
+#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 ()
 {
index e103d46..ae46ba1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> 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
 
 #include <stdlib.h>
 
+#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 ()
 {
index 68014f5..fe53cd9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <string.h> 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
 
 #include <string.h>
 
+#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 ()
 {
index 5fed15c..129367b 100644 (file)
 
 #include <unistd.h>
 
+#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 };