diff --git a/test/Makefile.am b/test/Makefile.am index 63ad428f..a7f9d940 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.24 2004/05/09 23:06:44 rocky Exp $ +# $Id: Makefile.am,v 1.25 2004/07/09 20:47:08 rocky Exp $ # # Copyright (C) 2003, 2004 Rocky Bernstein # @@ -23,7 +23,7 @@ # # There's a problem with doing make distcheck for testdefault. # A reminder of why I hate automake. -hack = check_sizeof testassert testischar testiso9660 testtoc +hack = check_sizeof testassert testischar testiso9660 testtoc testbincue noinst_PROGRAMS = $(hack) testdefault INCLUDES = -I$(top_srcdir) $(LIBCDIO_CFLAGS) @@ -34,6 +34,7 @@ testdefault_LDADD = $(LIBCDIO_LIBS) testischar_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) testiso9660_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) testtoc_LDADD = $(LIBCDIO_LIBS) +testbincue_LDADD = $(LIBCDIO_LIBS) check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh \ check_iso.sh check_opts.sh @@ -52,6 +53,7 @@ check_DATA = vcd_demo.right \ data1.toc data2.toc data5.toc data6.toc data7.toc \ bad-mode1.toc bad-msf-1.toc bad-msf-2.toc \ bad-cat1.toc bad-cat2.toc bad-cat3.toc \ + bad-cat1.cue bad-cat2.cue bad-cat3.cue \ copying.iso copying.right EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \ diff --git a/test/bad-cat2.cue b/test/bad-cat2.cue new file mode 100644 index 00000000..90c0b9bc --- /dev/null +++ b/test/bad-cat2.cue @@ -0,0 +1,9 @@ +REM $Id: bad-cat2.cue,v 1.1 2004/07/09 20:47:08 rocky Exp $ +REM test catalog number. -- not enough digits + +CATALOG "167890123" + +FILE "cdda.bin" BINARY + +TRACK 01 AUDIO + INDEX 01 00:00:00 diff --git a/test/bad-cat2.toc b/test/bad-cat2.toc index 4589d0aa..f1927cf5 100644 --- a/test/bad-cat2.toc +++ b/test/bad-cat2.toc @@ -1,7 +1,7 @@ -// $Id: bad-cat2.toc,v 1.1 2004/05/08 20:36:02 rocky Exp $ +// $Id: bad-cat2.toc,v 1.2 2004/07/09 20:47:08 rocky Exp $ // test catalog number. -- not enough digits -CATALOG "167890123" // Should be 13 digits +CATALOG 167890123 // Should be 13 digits TRACK AUDIO NO COPY diff --git a/test/bad-cat3.cue b/test/bad-cat3.cue new file mode 100644 index 00000000..92442e3d --- /dev/null +++ b/test/bad-cat3.cue @@ -0,0 +1,9 @@ +REM $Id: bad-cat3.cue,v 1.1 2004/07/09 20:47:08 rocky Exp $ +REM test catalog number. -- not enough digits + +CATALOG 123456789A123 + +FILE "cdda.bin" BINARY + +TRACK 01 AUDIO + INDEX 01 00:00:00 diff --git a/test/testbincue.c b/test/testbincue.c new file mode 100644 index 00000000..47f67671 --- /dev/null +++ b/test/testbincue.c @@ -0,0 +1,84 @@ +/* + $Id: testbincue.c,v 1.1 2004/07/09 20:47:08 rocky Exp $ + + Copyright (C) 2004 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + 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 + +#define NUM_GOOD_CUES 2 +#define NUM_BAD_CUES 3 +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", + }; + int ret=0; + unsigned int i; + + cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO; + for (i=0; i