--- /dev/null
+NEGATIVE cuesheets/bad.000.CATALOG_multiple.cue
+pass1: parse error, line 2: "found multiple CATALOG commands"
+NEGATIVE cuesheets/bad.001.CATALOG_missing_number.cue
+pass1: parse error, line 1: "CATALOG is missing catalog number"
+NEGATIVE cuesheets/bad.002.CATALOG_number_too_long.cue
+pass1: parse error, line 1: "CATALOG number is too long"
+NEGATIVE cuesheets/bad.003.CATALOG_not_13_digits.cue
+pass1: parse error, line 1: "CD-DA CATALOG number must be 13 decimal digits"
+NEGATIVE cuesheets/bad.030.FLAGS_multiple.cue
+pass1: parse error, line 4: "found multiple FLAGS commands"
+NEGATIVE cuesheets/bad.031.FLAGS_wrong_place_1.cue
+pass1: parse error, line 1: "FLAGS command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.032.FLAGS_wrong_place_2.cue
+pass1: parse error, line 4: "FLAGS command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.060.INDEX_wrong_place.cue
+pass1: parse error, line 2: "found INDEX before any TRACK"
+NEGATIVE cuesheets/bad.061.INDEX_missing_number.cue
+pass1: parse error, line 4: "INDEX is missing index number"
+NEGATIVE cuesheets/bad.062.INDEX_invalid_number_1.cue
+pass1: parse error, line 4: "INDEX has invalid index number"
+NEGATIVE cuesheets/bad.063.first_INDEX_not_0_or_1.cue
+pass1: parse error, line 4: "first INDEX number of a TRACK must be 0 or 1"
+NEGATIVE cuesheets/bad.064.INDEX_num_non_sequential.cue
+pass1: parse error, line 5: "INDEX numbers must be sequential"
+NEGATIVE cuesheets/bad.065.INDEX_num_out_of_range.cue
+pass1: parse error, line 104: "CD-DA INDEX number must be between 0 and 99, inclusive"
+NEGATIVE cuesheets/bad.066.INDEX_missing_offset.cue
+pass1: parse error, line 4: "INDEX is missing an offset after the index number"
+NEGATIVE cuesheets/bad.067.INDEX_illegal_offset.cue
+pass1: parse error, line 4: "illegal INDEX offset (not of the form MM:SS:FF)"
+NEGATIVE cuesheets/bad.068.INDEX_cdda_illegal_offset.cue
+pass1: parse error, line 4: "illegal INDEX offset (not of the form MM:SS:FF)"
+NEGATIVE cuesheets/bad.069.nonzero_first_INDEX.cue
+pass1: parse error, line 4: "first INDEX of first TRACK must have an offset of 00:00:00"
+NEGATIVE cuesheets/bad.070.INDEX_offset_not_ascending_1.cue
+pass1: parse error, line 5: "CD-DA INDEX offsets must increase in time"
+NEGATIVE cuesheets/bad.071.INDEX_offset_not_ascending_2.cue
+pass1: parse error, line 6: "CD-DA INDEX offsets must increase in time"
+NEGATIVE cuesheets/bad.110.ISRC_multiple.cue
+pass1: parse error, line 4: "found multiple ISRC commands"
+NEGATIVE cuesheets/bad.111.ISRC_wrong_place_1.cue
+pass1: parse error, line 2: "ISRC command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.112.ISRC_wrong_place_2.cue
+pass1: parse error, line 4: "ISRC command must come after TRACK but before INDEX"
+NEGATIVE cuesheets/bad.113.ISRC_missing_number.cue
+pass1: parse error, line 3: "ISRC is missing ISRC number"
+NEGATIVE cuesheets/bad.114.ISRC_invalid_number.cue
+pass1: parse error, line 3: "invalid ISRC number"
+NEGATIVE cuesheets/bad.130.TRACK_missing_INDEX_01_1.cue
+pass1: parse error, line 2: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.131.TRACK_missing_INDEX_01_2.cue
+pass1: parse error, line 3: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.132.TRACK_missing_INDEX_01_3.cue
+pass1: parse error, line 3: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.133.TRACK_missing_INDEX_01_4.cue
+pass1: parse error, line 4: "previous TRACK must specify at least one INDEX 01"
+NEGATIVE cuesheets/bad.134.TRACK_missing_number.cue
+pass1: parse error, line 2: "TRACK is missing track number"
+NEGATIVE cuesheets/bad.135.TRACK_invalid_number_1.cue
+pass1: parse error, line 2: "TRACK has invalid track number"
+NEGATIVE cuesheets/bad.136.TRACK_invalid_number_2.cue
+pass1: parse error, line 2: "TRACK number must be greater than 0"
+NEGATIVE cuesheets/bad.137.TRACK_cdda_out_of_range.cue
+pass1: parse error, line 2: "CD-DA TRACK number must be between 1 and 99, inclusive"
+NEGATIVE cuesheets/bad.138.TRACK_num_non_sequential.cue
+pass1: parse error, line 6: "CD-DA TRACK numbers must be sequential"
+NEGATIVE cuesheets/bad.139.TRACK_missing_type.cue
+pass1: parse error, line 2: "TRACK is missing a track type after the track number"
+NEGATIVE cuesheets/bad.140.no_TRACKs.cue
+pass1: parse error, line 1: "there must be at least one TRACK command"
+NEGATIVE cuesheets/bad.200.FLAC_leadin_missing_offset.cue
+pass1: parse error, line 1: "FLAC__lead-in is missing offset"
+NEGATIVE cuesheets/bad.201.FLAC_leadin_illegal_offset.cue
+pass1: parse error, line 1: "illegal FLAC__lead-in offset"
+NEGATIVE cuesheets/bad.202.FLAC_leadin_cdda_illegal_offset.cue
+pass1: parse error, line 1: "illegal CD-DA FLAC__lead-in offset, must be even multiple of 588 samples"
+NEGATIVE cuesheets/bad.230.FLAC_leadout_multiple.cue
+pass1: parse error, line 3: "multiple FLAC__lead-out commands"
+NEGATIVE cuesheets/bad.231.FLAC_leadout_missing_track.cue
+pass1: parse error, line 1: "FLAC__lead-out is missing track number"
+NEGATIVE cuesheets/bad.232.FLAC_leadout_illegal_track.cue
+pass1: parse error, line 1: "illegal FLAC__lead-out track number"
+NEGATIVE cuesheets/bad.233.FLAC_leadout_missing_offset.cue
+pass1: parse error, line 1: "FLAC__lead-out is missing offset"
+NEGATIVE cuesheets/bad.234.FLAC_leadout_illegal_offset.cue
+pass1: parse error, line 1: "illegal FLAC__lead-out offset"
+NEGATIVE cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue
+pass1: parse error, line 1: "FLAC__lead-out offset does not match end-of-stream offset"
+POSITIVE cuesheets/good.000.cue
+POSITIVE cuesheets/good.001.cue
--- /dev/null
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001,2002 Josh Coalson
+#
+# This program is part of FLAC; 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.
+
+EXTRA_DIST = \
+ bad.000.CATALOG_multiple.cue \
+ bad.001.CATALOG_missing_number.cue \
+ bad.002.CATALOG_number_too_long.cue \
+ bad.003.CATALOG_not_13_digits.cue \
+ bad.030.FLAGS_multiple.cue \
+ bad.031.FLAGS_wrong_place_1.cue \
+ bad.032.FLAGS_wrong_place_2.cue \
+ bad.060.INDEX_wrong_place.cue \
+ bad.061.INDEX_missing_number.cue \
+ bad.062.INDEX_invalid_number_1.cue \
+ bad.063.first_INDEX_not_0_or_1.cue \
+ bad.064.INDEX_num_non_sequential.cue \
+ bad.065.INDEX_num_out_of_range.cue \
+ bad.066.INDEX_missing_offset.cue \
+ bad.067.INDEX_illegal_offset.cue \
+ bad.068.INDEX_cdda_illegal_offset.cue \
+ bad.069.nonzero_first_INDEX.cue \
+ bad.070.INDEX_offset_not_ascending_1.cue \
+ bad.071.INDEX_offset_not_ascending_2.cue \
+ bad.110.ISRC_multiple.cue \
+ bad.111.ISRC_wrong_place_1.cue \
+ bad.112.ISRC_wrong_place_2.cue \
+ bad.113.ISRC_missing_number.cue \
+ bad.114.ISRC_invalid_number.cue \
+ bad.130.TRACK_missing_INDEX_01_1.cue \
+ bad.131.TRACK_missing_INDEX_01_2.cue \
+ bad.132.TRACK_missing_INDEX_01_3.cue \
+ bad.133.TRACK_missing_INDEX_01_4.cue \
+ bad.134.TRACK_missing_number.cue \
+ bad.135.TRACK_invalid_number_1.cue \
+ bad.136.TRACK_invalid_number_2.cue \
+ bad.137.TRACK_cdda_out_of_range.cue \
+ bad.138.TRACK_num_non_sequential.cue \
+ bad.139.TRACK_missing_type.cue \
+ bad.140.no_TRACKs.cue \
+ bad.200.FLAC_leadin_missing_offset.cue \
+ bad.201.FLAC_leadin_illegal_offset.cue \
+ bad.202.FLAC_leadin_cdda_illegal_offset.cue \
+ bad.230.FLAC_leadout_multiple.cue \
+ bad.231.FLAC_leadout_missing_track.cue \
+ bad.232.FLAC_leadout_illegal_track.cue \
+ bad.233.FLAC_leadout_missing_offset.cue \
+ bad.234.FLAC_leadout_illegal_offset.cue \
+ bad.235.FLAC_leadout_offset_not_211680000.cue \
+ good.000.cue \
+ good.001.cue
--- /dev/null
+#!/bin/sh
+
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001,2002 Josh Coalson
+#
+# This program is part of FLAC; 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.
+
+LD_LIBRARY_PATH=../src/libFLAC/.libs:../src/share/grabbag/.libs:../obj/release/lib:../obj/debug/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+PATH=../src/test_cuesheet:../obj/release/b:../obj/debug/bin:$PATH
+
+test_cuesheet -h 1>/dev/null 2>/dev/null || (echo "ERROR can't find test_cuesheet executable" 1>&2 && exit 1)
+if [ $? != 0 ] ; then exit 1 ; fi
+
+########################################################################
+#
+# test_cuesheet
+#
+########################################################################
+
+log=cuesheet.log
+bad_cuesheets=cuesheets/bad.*.cue
+good_cuesheets=cuesheets/good.*.cue
+good_leadout=`expr 80 \* 60 \* 44100`
+bad_leadout=`expr $good_leadout + 1`
+
+rm -f $log
+
+#
+# negative tests
+#
+for cuesheet in $bad_cuesheets ; do
+ echo "NEGATIVE $cuesheet" >> $log 2>&1
+ test_cuesheet $cuesheet $good_leadout cdda >> $log 2>&1
+ exit_code=$?
+ if [ "$exit_code" = 255 ] ; then
+ echo "Error: test script is broken"
+ exit 1
+ fi
+ cuesheet_pass1=${cuesheet}.1
+ cuesheet_pass2=${cuesheet}.2
+ rm -f $cuesheet_pass1 $cuesheet_pass2
+done
+
+#
+# positve tests
+#
+for cuesheet in $good_cuesheets ; do
+ echo "POSITIVE $cuesheet" >> $log 2>&1
+ test_cuesheet $cuesheet $good_leadout cdda >> $log 2>&1
+ exit_code=$?
+ if [ "$exit_code" = 255 ] ; then
+ echo "Error: test script is broken"
+ exit 1
+ elif [ "$exit_code" != 0 ] ; then
+ echo "Error: good cuesheet is broken"
+ exit 1
+ fi
+ cuesheet_pass1=${cuesheet}.1
+ cuesheet_pass2=${cuesheet}.2
+ diff $cuesheet_pass1 $cuesheet_pass2 >> $log 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error: pass1 and pass2 output differ"
+ exit 1
+ fi
+ rm -f $cuesheet_pass1 $cuesheet_pass2
+done
+
+diff cuesheet.ok $log > cuesheet.diff
+if [ $? != 0 ] ; then
+ echo "Error: .log file does not match .ok file, see cuesheet.diff"
+ exit 1
+fi