libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] [PATCH 5/5] Harmonize source headers: test sources


From: Pete Batard
Subject: [Libcdio-devel] [PATCH 5/5] Harmonize source headers: test sources
Date: Fri, 10 Feb 2012 19:35:26 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0

See previous mail.

Regards,

/Pete
>From d50ac787ddcdf83b11172bf17cfdd55d6f53a3e3 Mon Sep 17 00:00:00 2001
From: Pete Batard <address@hidden>
Date: Fri, 10 Feb 2012 18:39:29 +0000
Subject: [PATCH 5/5] Harmonize source headers: test sources

---
 test/check_sizeof.c         |   11 ++++++++---
 test/driver/abs_path.c      |    4 ++--
 test/driver/bincue.c.in     |   12 +++++++-----
 test/driver/cdrdao.c.in     |   11 +++++++----
 test/driver/freebsd.c       |   11 +++++++----
 test/driver/gnu_linux.c     |    8 ++++----
 test/driver/helper.c        |    5 +++--
 test/driver/mmc_read.c      |   16 +++++++++++-----
 test/driver/mmc_write.c     |   16 +++++++++++-----
 test/driver/nrg.c.in        |   13 ++++++-------
 test/driver/osx.c           |   11 +++++++----
 test/driver/realpath.c      |   24 ++++++++++--------------
 test/driver/solaris.c       |   11 +++++++----
 test/driver/win32.c         |   11 +++++++----
 test/test_lib_driver_util.c |   12 +++++++-----
 test/testassert.c           |    5 ++---
 test/testdefault.c          |   13 ++++++++-----
 test/testgetdevices.c.in    |   15 ++++++++-------
 test/testischar.c           |    8 +++++---
 test/testisocd.c            |   17 ++++-------------
 test/testisocd2.c.in        |   16 ++++------------
 test/testparanoia.c         |   14 +++++++-------
 test/testpregap.c.in        |   13 ++++++++-----
 23 files changed, 150 insertions(+), 127 deletions(-)

diff --git a/test/check_sizeof.c b/test/check_sizeof.c
index 068264d..10079b4 100644
--- a/test/check_sizeof.c
+++ b/test/check_sizeof.c
@@ -14,16 +14,21 @@
      You should have received a copy of the GNU General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
-
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
 #include <assert.h>
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
 #include <math.h>
 
 #include <cdio/iso9660.h>
diff --git a/test/driver/abs_path.c b/test/driver/abs_path.c
index e1c5edd..ec47997 100644
--- a/test/driver/abs_path.c
+++ b/test/driver/abs_path.c
@@ -1,6 +1,6 @@
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
 #ifdef HAVE_STDIO_H
diff --git a/test/driver/bincue.c.in b/test/driver/bincue.c.in
index 6b7962a..6819b7d 100644
--- a/test/driver/bincue.c.in
+++ b/test/driver/bincue.c.in
@@ -19,11 +19,9 @@
    Regression test for BIN/CUE device driver: lib/driver/image/bincue.c.
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -37,10 +35,14 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* chdir */
+#endif
 
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 #include "helper.h"
 
-
 #ifndef DATA_DIR
 #define DATA_DIR "@abs_top_srcdir@/test/data"
 #endif
diff --git a/test/driver/cdrdao.c.in b/test/driver/cdrdao.c.in
index fdcffc4..c29115c 100644
--- a/test/driver/cdrdao.c.in
+++ b/test/driver/cdrdao.c.in
@@ -19,11 +19,9 @@
    Regression test for cdio_tocfile.
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -37,7 +35,12 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* chdir */
+#endif
 
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 #include "helper.h"
 
 #ifndef DATA_DIR
diff --git a/test/driver/freebsd.c b/test/driver/freebsd.c
index 4791131..b70256e 100644
--- a/test/driver/freebsd.c
+++ b/test/driver/freebsd.c
@@ -19,11 +19,9 @@
    Unit test for lib/driver/freebsd.c
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -34,7 +32,12 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 
 int
 main(int argc, const char *argv[])
diff --git a/test/driver/gnu_linux.c b/test/driver/gnu_linux.c
index 4f68fb8..fdf998e 100644
--- a/test/driver/gnu_linux.c
+++ b/test/driver/gnu_linux.c
@@ -19,11 +19,9 @@
    Unit test for lib/driver/gnu_linux.c
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -38,6 +36,8 @@
 #include <string.h>
 #endif
 
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 #include "helper.h"
 
 int
diff --git a/test/driver/helper.c b/test/driver/helper.c
index ab89cb6..b000de4 100644
--- a/test/driver/helper.c
+++ b/test/driver/helper.c
@@ -15,9 +15,10 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
+
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
 #endif
diff --git a/test/driver/mmc_read.c b/test/driver/mmc_read.c
index d8dc20d..901d490 100644
--- a/test/driver/mmc_read.c
+++ b/test/driver/mmc_read.c
@@ -20,12 +20,9 @@
    Regression test for MMC commands which don't involve write access.
  */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
-#include <cdio/mmc_cmds.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -36,7 +33,16 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
+#include <cdio/mmc_cmds.h>
 
 #define SKIP_TEST 77
 
diff --git a/test/driver/mmc_write.c b/test/driver/mmc_write.c
index ac53146..a743b59 100644
--- a/test/driver/mmc_write.c
+++ b/test/driver/mmc_write.c
@@ -20,12 +20,9 @@
    Regression test for MMC commands involving read/write access.
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
-#include <cdio/mmc_cmds.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -36,7 +33,16 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
+#include <cdio/mmc_cmds.h>
 
 #define SKIP_TEST 77
 
diff --git a/test/driver/nrg.c.in b/test/driver/nrg.c.in
index 18ee3da..632a7c3 100644
--- a/test/driver/nrg.c.in
+++ b/test/driver/nrg.c.in
@@ -18,13 +18,9 @@
 /* 
    Regression test for Nero image driver: lib/driver/image/nrg.c.
 */
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
-#include <cdio/cdtext.h>
-
-#if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__)
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
 #ifdef HAVE_STDIO_H
@@ -40,6 +36,9 @@
 #include <string.h>
 #endif
 
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
+#include <cdio/cdtext.h>
 #include "helper.h"
 
 #ifndef DATA_DIR
diff --git a/test/driver/osx.c b/test/driver/osx.c
index 5d2b8c1..01c6a5b 100644
--- a/test/driver/osx.c
+++ b/test/driver/osx.c
@@ -19,11 +19,9 @@
    Unit test for lib/driver/osx.c
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -34,7 +32,12 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 
 int
 main(int argc, const char *argv[])
diff --git a/test/driver/realpath.c b/test/driver/realpath.c
index 866f6ed..98752b2 100644
--- a/test/driver/realpath.c
+++ b/test/driver/realpath.c
@@ -19,37 +19,33 @@
    Unit test for lib/driver/gnu_linux.c
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
 #ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
 #endif
 #ifdef HAVE_STRING_H
-# include <string.h>
+#include <string.h>
 #endif
 #ifdef HAVE_LIMITS_H
-# include <limits.h>
+#include <limits.h>
 #endif
 #ifdef HAVE_STDLIB_H
-# include <stdlib.h>
+#include <stdlib.h>
 #endif
-
 #ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#include <sys/stat.h>
 #endif
-
 #ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
+#include <sys/types.h>
 #endif
-
 #ifdef HAVE_UNISTD_H
-# include <unistd.h>
+#include <unistd.h>
 #endif
-
 #ifdef HAVE_ERRNO_H
-# include <errno.h>
+#include <errno.h>
 #endif
 
 #include <cdio/util.h>
diff --git a/test/driver/solaris.c b/test/driver/solaris.c
index 831af27..1d15b85 100644
--- a/test/driver/solaris.c
+++ b/test/driver/solaris.c
@@ -19,11 +19,9 @@
    Unit test for lib/driver/solaris.c
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -34,7 +32,12 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 
 int
 main(int argc, const char *argv[])
diff --git a/test/driver/win32.c b/test/driver/win32.c
index 9f35807..486d642 100644
--- a/test/driver/win32.c
+++ b/test/driver/win32.c
@@ -19,11 +19,9 @@
    Unit test for lib/driver/MSWindows/win32.c
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -34,7 +32,12 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
 
 int
 main(int argc, const char *argv[])
diff --git a/test/test_lib_driver_util.c b/test/test_lib_driver_util.c
index bcecec5..cd47867 100644
--- a/test/test_lib_driver_util.c
+++ b/test/test_lib_driver_util.c
@@ -15,20 +15,22 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 /* Unit test for lib/driver/util.c */
-
-#include <cdio/version.h>
-
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
+
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
 #endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/version.h>
 
 int
 main(int argc, const char *argv[])
diff --git a/test/testassert.c b/test/testassert.c
index d764cd7..90741ac 100644
--- a/test/testassert.c
+++ b/test/testassert.c
@@ -14,10 +14,9 @@
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
-
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
 /* Private headers */
diff --git a/test/testdefault.c b/test/testdefault.c
index f646853..45d16a5 100644
--- a/test/testdefault.c
+++ b/test/testdefault.c
@@ -20,12 +20,9 @@
    and cdio_free_device_list()
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -36,7 +33,13 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/cd_types.h>
+#include <cdio/logging.h>
 
 static void 
 log_handler (cdio_log_level_t level, const char message[])
diff --git a/test/testgetdevices.c.in b/test/testgetdevices.c.in
index 4d87071..15bb438 100644
--- a/test/testgetdevices.c.in
+++ b/test/testgetdevices.c.in
@@ -20,12 +20,9 @@
    and cdio_free_device_list()
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -42,14 +39,18 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/cd_types.h>
+#include <cdio/logging.h>
 
 #ifndef DATA_DIR
 #define DATA_DIR "@abs_top_srcdir@/test/data/"
 #endif
 
-
 static void 
 log_handler (cdio_log_level_t level, const char message[])
 {
diff --git a/test/testischar.c b/test/testischar.c
index 080f1fd..295e633 100644
--- a/test/testischar.c
+++ b/test/testischar.c
@@ -17,13 +17,15 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 /* Tests ISO9660 character sets. */
-
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
+
 #include <cdio/iso9660.h>
 
 int
diff --git a/test/testisocd.c b/test/testisocd.c
index 229daac..498fd94 100644
--- a/test/testisocd.c
+++ b/test/testisocd.c
@@ -17,18 +17,8 @@
 */
 
 /* Tests reading ISO 9660 info from a CD.  */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
-#endif
-
 #include "portable.h"
 
-#include <cdio/cdio.h>
-#include <cdio/iso9660.h>
-#include <cdio/cd_types.h>
-
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -47,9 +37,10 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+
+#include <cdio/cdio.h>
+#include <cdio/iso9660.h>
+#include <cdio/cd_types.h>
 
 #define SKIP_TEST_RC 77
 
diff --git a/test/testisocd2.c.in b/test/testisocd2.c.in
index 35e0cbe..98934aa 100644
--- a/test/testisocd2.c.in
+++ b/test/testisocd2.c.in
@@ -18,17 +18,8 @@
 */
 
 /* Tests reading ISO 9660 info from an ISO 9660 image.  */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
 #include "portable.h"
 
-#include <cdio/cdio.h>
-#include <cdio/iso9660.h>
-#include <cdio/cd_types.h>
-
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -47,9 +38,10 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+
+#include <cdio/cdio.h>
+#include <cdio/iso9660.h>
+#include <cdio/cd_types.h>
 
 /* Set up a CD-DA image to test on which is in the libcdio distribution. */
 #define ISO9660_IMAGE_PATH "@abs_top_srcdir@/test/data/"
diff --git a/test/testparanoia.c b/test/testparanoia.c
index e8b6a13..93d1a1a 100644
--- a/test/testparanoia.c
+++ b/test/testparanoia.c
@@ -16,24 +16,24 @@
 */
 
 /* Simple program to show using libcdio's version of cdparanoia. */
-
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
 
-#include <cdio/paranoia.h>
-#include <cdio/cd_types.h>
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
-
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
 
+#include <cdio/paranoia.h>
+#include <cdio/cd_types.h>
+
 #ifdef WORDS_BIGENDIAN
 #define BIGENDIAN 1
 #else
diff --git a/test/testpregap.c.in b/test/testpregap.c.in
index b049fde..d15bd53 100644
--- a/test/testpregap.c.in
+++ b/test/testpregap.c.in
@@ -20,12 +20,9 @@
    Regression test for cdio_get_pregap_lsn()
 */
 #ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
 #endif
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/logging.h>
 
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
@@ -36,7 +33,13 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/cd_types.h>
+#include <cdio/logging.h>
 
 #ifndef DATA_DIR
 #define DATA_DIR "@srcdir@/data"
-- 
1.7.8.msysgit.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]