diff --git a/test/Makefile.am b/test/Makefile.am index 8337b331..f11f356a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2004, 2006, 2008, 2009 Rocky Bernstein +# Copyright (C) 2003, 2004, 2006, 2008, 2009, 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 @@ -21,7 +21,7 @@ # There's a problem with doing make distcheck for testdefault. # A reminder of why I hate automake. -SUBDIRS = driver +SUBDIRS = data driver if BUILD_CD_PARANOIA testparanoia=testparanoia @@ -83,7 +83,7 @@ check_DATA = vcd_demo.right vcd_demo_vcdinfo.right \ EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \ check_common_fn check_cue.sh.in check_nrg.sh.in \ - testbincue.c.in testpregap.c.in testnrg.c.in \ + testpregap.c.in testnrg.c.in \ testgetdevices.c.in check_iso.sh.in TESTS = $(check_PROGRAMS) $(check_SCRIPTS) diff --git a/test/data/isofs-m1.bin b/test/data/isofs-m1.bin new file mode 100644 index 00000000..adaea5c3 Binary files /dev/null and b/test/data/isofs-m1.bin differ diff --git a/test/data/isofs-m1.cue b/test/data/isofs-m1.cue new file mode 100644 index 00000000..677a803f --- /dev/null +++ b/test/data/isofs-m1.cue @@ -0,0 +1,3 @@ +FILE "ISOFS-M1.BIN" BINARY + TRACK 01 MODE1/2352 + INDEX 01 00:00:00 diff --git a/test/driver/.gitignore b/test/driver/.gitignore index 92abc817..ca4f1621 100644 --- a/test/driver/.gitignore +++ b/test/driver/.gitignore @@ -4,6 +4,7 @@ /.libs /Makefile /Makefile.in +/bincue /follow_symlink /freebsd /gnu_linux diff --git a/test/driver/Makefile.am b/test/driver/Makefile.am index d17c6d04..d8913724 100644 --- a/test/driver/Makefile.am +++ b/test/driver/Makefile.am @@ -40,10 +40,13 @@ solaris_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" win32_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV) win32_CFLAGS = -DDATA_DIR=\"$(DATA_DIR)\" -check_PROGRAMS = bincue freebsd gnu_linux mmc osx realpath solaris win32 +hack = bincue freebsd gnu_linux mmc osx realpath solaris win32 +check_PROGRAMS = $(hack) TESTS = $(check_PROGRAMS) +EXTRA_DIST = bincue.c.in + MOSTLYCLEANFILES = core core.* *.dump cdda-orig.wav cdda-try.wav *.raw test: check-am diff --git a/test/driver/bincue.c b/test/driver/bincue.c new file mode 100644 index 00000000..1a6c39ee --- /dev/null +++ b/test/driver/bincue.c @@ -0,0 +1,133 @@ +/* -*- C -*- + $Id: testbincue.c.in,v 1.2 2008/03/22 18:08:25 karl Exp $ + + Copyright (C) 2004, 2006, 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + Regression test for cdio_binfile(). +*/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#include +#include + +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#include + +#ifndef DATA_DIR +#define DATA_DIR "/src/external-vcs/libcdio/test/data" +#endif + +#define NUM_GOOD_CUES 2 +#define NUM_BAD_CUES 7 +int +main(int argc, const char *argv[]) +{ + const char *cue_file[NUM_GOOD_CUES] = { + "cdda.cue", + "isofs-m1.cue", + }; + + const char *badcue_file[NUM_BAD_CUES] = { + "bad-cat1.cue", + "bad-cat2.cue", + "bad-cat3.cue", + "bad-mode1.cue", + "bad-msf-1.cue", + "bad-msf-2.cue", + "bad-msf-3.cue", + }; + int ret=0; + unsigned int i; + char psz_cuefile[500]; + + psz_cuefile[sizeof(psz_cuefile)-1] = '\0'; + cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; + for (i=0; i