From 19b760c443745195a77d8b1ee102e431fd009d77 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 19 Sep 2003 04:09:47 +0000 Subject: [PATCH] Add CD-DA reading test via cd-read; Add GPL --- test/Makefile.am | 4 +- test/cdda-read.right | 148 ++++++++++++++++++++++++++++++++++++++++ test/check_cd_read.sh | 46 +++++++++++++ test/check_common_fn.in | 64 +++++++++++++++-- test/check_cue.sh.in | 3 +- 5 files changed, 255 insertions(+), 10 deletions(-) create mode 100644 test/cdda-read.right create mode 100755 test/check_cd_read.sh diff --git a/test/Makefile.am b/test/Makefile.am index 7aa0d80a..f5975231 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.10 2003/09/17 02:51:44 rocky Exp $ +# $Id: Makefile.am,v 1.11 2003/09/19 04:09:47 rocky Exp $ # # Copyright (C) 2003 Rocky Bernstein # @@ -29,7 +29,7 @@ testischar_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) testiso9660_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) check_sizeof_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) -check_SCRIPTS = check_nrg.sh check_cue.sh check_opts.sh +check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh check_opts.sh check_PROGRAMS = $(noinst_PROGRAMS) diff --git a/test/cdda-read.right b/test/cdda-read.right new file mode 100644 index 00000000..aa3f218e --- /dev/null +++ b/test/cdda-read.right @@ -0,0 +1,148 @@ +0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0030: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0110: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0120: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0130: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0140: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0150: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0160: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0170: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0180: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0190: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x01a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x01b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x01c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x01d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x01e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x01f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0200: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0210: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0220: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0230: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0240: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0250: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0260: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0270: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0280: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0290: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x02a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x02b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x02c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x02d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x02e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x02f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0300: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0310: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0320: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0330: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0340: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0350: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0360: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0370: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0380: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0390: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x03a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x03b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x03c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x03d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x03e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x03f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0400: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0410: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0420: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0430: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0440: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0450: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0460: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0470: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0480: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0490: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x04a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x04b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x04c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x04d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x04e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x04f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0500: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0510: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0520: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0530: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0540: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0550: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0560: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0570: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0580: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +0x0590: 0000 0000 0000 0000 f0ff 0000 f0ff 0000 ................ +0x05a0: e3ff f0ff e3ff f0ff d8ff e3ff d8ff e3ff ................ +0x05b0: dfff e8ff dfff e8ff f5ff fcff f5ff fcff ................ +0x05c0: 0700 0c00 0700 0c00 1500 1800 1500 1800 ................ +0x05d0: 2000 1100 2000 1100 2800 0b00 2800 0b00 ... ...(...(... +0x05e0: 1d00 0500 1d00 0500 1300 0000 1300 0000 ................ +0x05f0: 0a00 0b00 0a00 0b00 1200 1300 1200 1300 ................ +0x0600: 1800 1900 1800 1900 0c00 0d00 0c00 0d00 ................ +0x0610: 0200 0300 0200 0300 e9ff faff e9ff faff ................ +0x0620: d5ff f2ff d5ff f2ff b5ff dbff b5ff dbff ................ +0x0630: 9cff c8ff 9cff c8ff a9ff c9ff a9ff c9ff ................ +0x0640: c4ff daff c4ff daff eaff f8ff eaff f8ff ................ +0x0650: 1900 1000 1900 1000 3e00 2300 3e00 2300 ........>.#.>.#. +0x0660: 6b00 3100 6b00 3100 8d00 3b00 8d00 3b00 k.1.k.1...;...;. +0x0670: 7600 4200 7600 4200 6100 3600 6100 3600 v.B.v.B.a.6.a.6. +0x0680: 3e00 2b00 3e00 2b00 1000 1100 1000 1100 >.+.>.+......... +0x0690: eaff fbff eaff fbff cbff e9ff cbff e9ff ................ +0x06a0: b2ff daff b2ff daff ceff deff ceff deff ................ +0x06b0: e5ff f1ff e5ff f1ff f8ff 0000 f8ff 0000 ................ +0x06c0: 0700 0c00 0700 0c00 1300 1500 1300 1500 ................ +0x06d0: 0c00 0b00 0c00 0b00 e6ff f2ff e6ff f2ff ................ +0x06e0: c7ff ddff c7ff ddff aeff ccff aeff ccff ................ +0x06f0: 8aff bfff 8aff bfff 6eff b5ff 6eff b5ff ........n...n... +0x0700: 99ff ceff 99ff ceff d0ff e3ff d0ff e3ff ................ +0x0710: 0e00 0400 0e00 0400 8000 3e00 8000 3e00 ..........>...>. +0x0720: da00 6c00 da00 6c00 1f01 8f00 1f01 8f00 ..l...l......... +0x0730: 4201 a900 4201 a900 2901 9b00 2901 9b00 B...B...)...)... +0x0740: d000 6d00 d000 6d00 7100 3500 7100 3500 ..m...m.q.5.q.5. +0x0750: 0000 0600 0000 0600 64ff bfff 64ff bfff ........d...d... +0x0760: e7fe 86ff e7fe 86ff a7fe 59ff a7fe 59ff ..........Y...Y. +0x0770: 98fe 47ff 98fe 47ff b1fe 4bff b1fe 4bff ..G...G...K...K. +0x0780: eafe 71ff eafe 71ff 5cff a2ff 5cff a2ff ..q...q.\...\... +0x0790: ceff ebff ceff ebff 3c00 2600 3c00 2600 ........<.&.<.&. +0x07a0: 9400 5500 9400 5500 d900 7900 d900 7900 ..U...U...y...y. +0x07b0: bd00 6400 bd00 6400 a300 5100 a300 5100 ..d...d...Q...Q. +0x07c0: 5f00 3000 5f00 3000 1300 1400 1300 1400 _.0._.0......... +0x07d0: 0700 fcff 0700 fcff 0d00 f8ff 0d00 f8ff ................ +0x07e0: 1100 0400 1100 0400 4300 1d00 4300 1d00 ........C...C... +0x07f0: 6a00 3000 6a00 3000 8800 3e00 8800 3e00 j.0.j.0...>...>. +0x0800: 8e00 4800 8e00 4800 6000 2f00 6000 2f00 ..H...H.`./.`./. +0x0810: e9ff f9ff e9ff f9ff 88ff cdff 88ff cdff ................ +0x0820: 3bff 9aff 3bff 9aff ecfe 72ff ecfe 72ff ;...;.....r...r. +0x0830: d2fe 63ff d2fe 63ff 01ff 79ff 01ff 79ff ..c...c...y...y. +0x0840: 2bff 8cff 2bff 8cff 83ff bdff 83ff bdff +...+........... +0x0850: fcff f5ff fcff f5ff 5e00 3200 5e00 3200 ........^.2.^.2. +0x0860: ac00 6200 ac00 6200 e800 8700 e800 8700 ..b...b......... +0x0870: 0501 8200 0501 8200 d800 6b00 d800 6b00 ..........k...k. +0x0880: 9d00 5600 9d00 5600 6a00 4300 6a00 4300 ..V...V.j.C.j.C. +0x0890: 3e00 2200 3e00 2200 1900 0600 1900 0600 >.".>."......... +0x08a0: eaff efff eaff efff e4ff ecff e4ff ecff ................ +0x08b0: dfff e9ff dfff e9ff bbff e6ff bbff e6ff ................ +0x08c0: 9eff d3ff 9eff d3ff 77ff c4ff 77ff c4ff ........w...w... +0x08d0: 39ff a8ff 39ff a8ff 19ff 92ff 19ff 92ff 9...9........... +0x08e0: 22ff 91ff 22ff 91ff 5cff b1ff 5cff b1ff "..."...\...\... +0x08f0: cdff ecff cdff ecff 7500 3c00 7500 3c00 ........u.<.u.<. +0x0900: 1101 8c00 1101 8c00 8b01 ca00 8b01 ca00 ................ +0x0910: e701 f900 e701 f900 da01 fb00 da01 fb00 ................ +0x0920: 6401 b800 6401 b800 8a00 4500 8a00 4500 d...d.....E...E. + diff --git a/test/check_cd_read.sh b/test/check_cd_read.sh new file mode 100755 index 00000000..9aff6a6b --- /dev/null +++ b/test/check_cd_read.sh @@ -0,0 +1,46 @@ +#!/bin/sh +#$Id: check_cd_read.sh,v 1.1 2003/09/19 04:09:47 rocky Exp $ +# +# Copyright (C) 2003 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 +# +# Tests to see that CD reading is correct (via cd-read). + +if test -z $srcdir ; then + srcdir=`pwd` +fi + +. ${srcdir}/check_common_fn + +if ! test -x ../src/cd-read ; then + exit 77 +fi + +BASE=`basename $0 .sh` + +fname=cdda +testnum=CD-DA +test_cd_read "${srcdir}/${fname}.cue 1 0" \ + ${fname}-read.dump ${srcdir}/${fname}-read.right +RC=$? +check_result $RC "cd-read CUE test $testnum" + +exit $RC + +#;;; Local Variables: *** +#;;; mode:shell-script *** +#;;; eval: (sh-set-shell "bash") *** +#;;; End: *** diff --git a/test/check_common_fn.in b/test/check_common_fn.in index 7652ed11..ea74806c 100755 --- a/test/check_common_fn.in +++ b/test/check_common_fn.in @@ -1,4 +1,21 @@ -# $Id: check_common_fn.in,v 1.3 2003/09/07 18:10:55 rocky Exp $ +# $Id: check_common_fn.in,v 1.4 2003/09/19 04:09:47 rocky Exp $ +# +# Copyright (C) 2003 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 +# # Common routines and setup for regression testing. SKIP_TEST_EXITCODE=77 @@ -30,14 +47,14 @@ test_cdinfo() { outfile="$2" rightfile="$3" - CDINFO="../src/cd-info" + CD_INFO="../src/cd-info" - if [ ! -x ${CDINFO} ]; then - echo "$0: No ${CDINFO}" + if [ ! -x ${CD_INFO} ]; then + echo "$0: No ${CD_INFO}" return 1 fi - if ${CDINFO} --no-header ${opts} >${outfile} 2>&1 ; then + if ${CD_INFO} --no-header ${opts} >${outfile} 2>&1 ; then if test "@DIFF@" != no; then if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then rm -f $outfile @@ -46,12 +63,45 @@ test_cdinfo() { return 3 fi else - echo "$0: No diff(1) or cmp(1 found - cannot test ${CDINFO}" + echo "$0: No diff(1) or cmp(1 found - cannot test ${CD_INFO}" rm -f $outfile return 77 fi else - echo "$0: ${CDINFO} ${opts} failed" + echo "$0: ${CD_INFO} ${opts} failed" + return 2 + fi + +} + +test_cd_read() { + + opts="$1" + outfile="$2" + rightfile="$3" + + CD_READ="../src/cd-read" + + if [ ! -x ${CD_READ} ]; then + echo "$0: No ${CD_READ}" + return 1 + fi + + if ${CD_READ} ${opts} >${outfile} 2>&1 ; then + if test "@DIFF@" != no; then + if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then + rm -f $outfile + return 0 + else + return 3 + fi + else + echo "$0: No diff(1) or cmp(1 found - cannot test ${CD_READ}" + rm -f $outfile + return 77 + fi + else + echo "$0: ${CD_READ} ${opts} failed" return 2 fi diff --git a/test/check_cue.sh.in b/test/check_cue.sh.in index cd217e2d..43454718 100644 --- a/test/check_cue.sh.in +++ b/test/check_cue.sh.in @@ -1,5 +1,6 @@ #!/bin/sh -#$Id: check_cue.sh.in,v 1.10 2003/09/14 04:56:46 rocky Exp $ +#$Id: check_cue.sh.in,v 1.11 2003/09/19 04:09:47 rocky Exp $ +# Tests to see that BIN/CUE file iamge reading is correct (via cd-info). if test -z "@VCDINFO_LIBS@" ; then vcd_opt='--no-vcd' fi