From c90c24d1c8ad6d8569c17085eeae96b076f049d5 Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Sat, 23 Jan 2010 23:20:12 -0500 Subject: [PATCH] testtoc -> driver/cdrdao.c.in --- configure.ac | 1 + doc/.gitignore | 1 + test/Makefile.am | 5 +- test/driver/.gitignore | 5 +- test/driver/Makefile.am | 6 ++- test/{testtoc.c => driver/cdrdao.c.in} | 67 ++++++++++++++------------ 6 files changed, 46 insertions(+), 39 deletions(-) rename test/{testtoc.c => driver/cdrdao.c.in} (60%) diff --git a/configure.ac b/configure.ac index 59b22a55..83250f09 100644 --- a/configure.ac +++ b/configure.ac @@ -663,6 +663,7 @@ AC_CONFIG_FILES([ test/data/Makefile \ test/driver/Makefile \ test/driver/bincue.c \ + test/driver/cdrdao.c \ test/driver/nrg.c \ test/testgetdevices.c \ test/testisocd2.c \ diff --git a/doc/.gitignore b/doc/.gitignore index 9872ee2e..602f540a 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -8,6 +8,7 @@ /libcdio.info /libcdio.ky /libcdio.log +/libcdio.pdf /libcdio.pg /libcdio.toc /libcdio.tp diff --git a/test/Makefile.am b/test/Makefile.am index 4fbdbf83..6149d2e9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -30,7 +30,7 @@ endif hack = check_sizeof testassert testgetdevices testischar \ testisocd testisocd2 testiso9660 test_lib_driver_util \ - $(testparanoia) testtoc testpregap + $(testparanoia) testpregap EXTRA_PROGRAMS = testdefault DATA_DIR = @abs_top_srcdir@/test/data @@ -48,9 +48,6 @@ testiso9660_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testisocd_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) testisocd2_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV) -testtoc_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) -testtoc_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" - test_lib_driver_util_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) test_lib_driver_util_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" diff --git a/test/driver/.gitignore b/test/driver/.gitignore index 2cf1a8ee..0f68f9db 100644 --- a/test/driver/.gitignore +++ b/test/driver/.gitignore @@ -1,15 +1,16 @@ -/*.o /*.exe +/*.o /*~ /.deps /.libs /Makefile /Makefile.in /bincue +/bincue /bincue.c +/cdrdao.c /follow_symlink /freebsd -/bincue /gnu_linux /mmc /nrg diff --git a/test/driver/Makefile.am b/test/driver/Makefile.am index 1be5bf55..47f6150e 100644 --- a/test/driver/Makefile.am +++ b/test/driver/Makefile.am @@ -19,6 +19,9 @@ DATA_DIR = $(abs_top_srcdir)/test/data bincue_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) bincue_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" +cdrdao_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) +cdrdao_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" + freebsd_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) freebsd_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" @@ -44,13 +47,14 @@ win32_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) win32_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" check_PROGRAMS = \ - bincue freebsd gnu_linux mmc nrg \ + bincue cdrdao freebsd gnu_linux mmc nrg \ osx realpath solaris win32 TESTS = $(check_PROGRAMS) EXTRA_DIST = \ bincue.c.in \ + cdrdao.c.in \ nrg.c.in MOSTLYCLEANFILES = \ diff --git a/test/testtoc.c b/test/driver/cdrdao.c.in similarity index 60% rename from test/testtoc.c rename to test/driver/cdrdao.c.in index dae7d94b..10d98040 100644 --- a/test/testtoc.c +++ b/test/driver/cdrdao.c.in @@ -1,7 +1,5 @@ /* - $Id: testtoc.c,v 1.9 2008/03/22 18:08:25 karl Exp $ - - Copyright (C) 2004, 2008 Rocky Bernstein + Copyright (C) 2004, 2008, 2010 Rocky Bernstein 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 @@ -38,7 +36,7 @@ #include #ifndef DATA_DIR -#define DATA_DIR "./data/" +#define DATA_DIR "@abs_top_srcdir@/test/data" #endif #define NUM_GOOD_TOCS 16 @@ -79,35 +77,40 @@ main(int argc, const char *argv[]) unsigned int i; char psz_tocfile[500]; - psz_tocfile[sizeof(psz_tocfile)-1] = '\0'; +#ifdef HAVE_CHDIR + if (0 == chdir(DATA_DIR)) +#endif + { + psz_tocfile[sizeof(psz_tocfile)-1] = '\0'; - cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; - for (i=0; i 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; + for (i=0; i