Commit 29db3fbf authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Fix cursheet tests for 'make distcheck'.

parent 8267168d
......@@ -32,7 +32,7 @@
static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset)
{
FILE *fin, *fout;
const char *error_message;
const char *error_message, *tmpfilenamebase;
char tmpfilename[4096];
unsigned last_line_read;
FLAC__StreamMetadata *cuesheet;
......@@ -64,7 +64,11 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
FLAC__metadata_object_delete(cuesheet);
return 1;
}
flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.1", infilename);
tmpfilenamebase = strstr(infilename, "cuesheets/");
tmpfilenamebase = tmpfilenamebase == NULL ? infilename : tmpfilenamebase;
flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.1", tmpfilenamebase);
if(0 == (fout = flac_fopen(tmpfilename, "w"))) {
fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
FLAC__metadata_object_delete(cuesheet);
......@@ -96,7 +100,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
FLAC__metadata_object_delete(cuesheet);
return 1;
}
flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.2", infilename);
flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.2", tmpfilenamebase);
if(0 == (fout = flac_fopen(tmpfilename, "w"))) {
fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
FLAC__metadata_object_delete(cuesheet);
......
......@@ -118,8 +118,9 @@ for cuesheet in $good_cuesheets ; do
elif [ "$exit_code" != 0 ] ; then
die "Error: good cuesheet is broken"
fi
cuesheet_pass1=${cuesheet}.1
cuesheet_pass2=${cuesheet}.2
cuesheet_out=$(echo $cuesheet | sed "s|${top_srcdir}/test/||")
cuesheet_pass1=${cuesheet_out}.1
cuesheet_pass2=${cuesheet_out}.2
diff $cuesheet_pass1 $cuesheet_pass2 >> $log 2>&1 || die "Error: pass1 and pass2 output differ"
rm -f $cuesheet_pass1 $cuesheet_pass2
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment