test/*, configure.ac:
First paranoia regression test. It's run automatically as it assumes
that you have a *flawless* CD-DA in a drive.
*.{c,h}: more integration toward libcdio routines. In particular remove
swap16 and swap32.
This commit is contained in:
11
configure.ac
11
configure.ac
@@ -19,7 +19,7 @@ define(RELEASE_NUM, 72)
|
|||||||
define(CDIO_VERSION_STR, 0.$1cvs)
|
define(CDIO_VERSION_STR, 0.$1cvs)
|
||||||
|
|
||||||
AC_PREREQ(2.52)
|
AC_PREREQ(2.52)
|
||||||
AC_REVISION([$Id: configure.ac,v 1.120 2004/12/18 21:24:25 rocky Exp $])dnl
|
AC_REVISION([$Id: configure.ac,v 1.121 2004/12/19 00:02:09 rocky Exp $])dnl
|
||||||
AC_INIT(libcdio, CDIO_VERSION_STR(RELEASE_NUM))
|
AC_INIT(libcdio, CDIO_VERSION_STR(RELEASE_NUM))
|
||||||
AC_CONFIG_SRCDIR(src/cd-info.c)
|
AC_CONFIG_SRCDIR(src/cd-info.c)
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
@@ -127,6 +127,13 @@ fi
|
|||||||
AC_SUBST(DIFF)
|
AC_SUBST(DIFF)
|
||||||
AC_SUBST(DIFF_OPTS)
|
AC_SUBST(DIFF_OPTS)
|
||||||
|
|
||||||
|
# We use cmp and cdparanoia in cd-paranoia regression testing
|
||||||
|
AC_PATH_PROG(CMP, cmp, no)
|
||||||
|
AC_SUBST(CMP)
|
||||||
|
|
||||||
|
AC_PATH_PROG(OLD_CDPARANOIA, cdparanoia, no)
|
||||||
|
AC_SUBST(OLD_CDPARANOIA)
|
||||||
|
|
||||||
AM_PATH_LIBPOPT(,
|
AM_PATH_LIBPOPT(,
|
||||||
[AC_MSG_WARN([Diagnostic programs cd-drive, cd-info, cd-read, iso-info, and is-read will not get built.])
|
[AC_MSG_WARN([Diagnostic programs cd-drive, cd-info, cd-read, iso-info, and is-read will not get built.])
|
||||||
enable_cd_info=no;
|
enable_cd_info=no;
|
||||||
@@ -493,6 +500,7 @@ AC_CONFIG_FILES([ \
|
|||||||
test/check_nrg.sh \
|
test/check_nrg.sh \
|
||||||
test/check_cue.sh \
|
test/check_cue.sh \
|
||||||
test/check_iso.sh \
|
test/check_iso.sh \
|
||||||
|
test/check_paranoia.sh \
|
||||||
test/check_common_fn \
|
test/check_common_fn \
|
||||||
test/Makefile \
|
test/Makefile \
|
||||||
])
|
])
|
||||||
@@ -502,6 +510,7 @@ AC_CONFIG_COMMANDS([default],[[
|
|||||||
chmod +x test/check_nrg.sh
|
chmod +x test/check_nrg.sh
|
||||||
chmod +x test/check_cue.sh
|
chmod +x test/check_cue.sh
|
||||||
chmod +x test/check_iso.sh
|
chmod +x test/check_iso.sh
|
||||||
|
chmod +x test/check_paranoia.sh
|
||||||
]],[[]])
|
]],[[]])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ long cdda_read(cdrom_drive_t *d, void *buffer, long beginsector, long sectors)
|
|||||||
u_int16_t *p=(u_int16_t *)buffer;
|
u_int16_t *p=(u_int16_t *)buffer;
|
||||||
long els=sectors*CD_FRAMESIZE_RAW/2;
|
long els=sectors*CD_FRAMESIZE_RAW/2;
|
||||||
|
|
||||||
for(i=0;i<els;i++)p[i]=swap16(p[i]);
|
for(i=0;i<els;i++)p[i]=UINT16_SWAP_LE_BE_C(p[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: utils.h,v 1.1 2004/12/18 17:29:32 rocky Exp $
|
$Id: utils.h,v 1.2 2004/12/19 00:02:09 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1998 Monty xiphmont@mit.edu
|
Copyright (C) 1998 Monty xiphmont@mit.edu
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <cdio/types.h>
|
#include <cdio/types.h>
|
||||||
|
#include <cdio/bytesex.h>
|
||||||
|
|
||||||
/* I wonder how many alignment issues this is gonna trip in the
|
/* I wonder how many alignment issues this is gonna trip in the
|
||||||
future... it shouldn't trip any... I guess we'll find out :) */
|
future... it shouldn't trip any... I guess we'll find out :) */
|
||||||
@@ -35,26 +36,14 @@ static inline int bigendianp(void){
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t swap32(int32_t x){
|
|
||||||
return((((u_int32_t)x & 0x000000ffU) << 24) |
|
|
||||||
(((u_int32_t)x & 0x0000ff00U) << 8) |
|
|
||||||
(((u_int32_t)x & 0x00ff0000U) >> 8) |
|
|
||||||
(((u_int32_t)x & 0xff000000U) >> 24));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int16_t swap16(int16_t x){
|
|
||||||
return((((u_int16_t)x & 0x00ffU) << 8) |
|
|
||||||
(((u_int16_t)x & 0xff00U) >> 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
|
|
||||||
static inline int32_t be32_to_cpu(int32_t x){
|
static inline int32_t be32_to_cpu(int32_t x){
|
||||||
return(swap32(x));
|
return(UINT32_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int16_t be16_to_cpu(int16_t x){
|
static inline int16_t be16_to_cpu(int16_t x){
|
||||||
return(swap16(x));
|
return(UINT16_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t le32_to_cpu(int32_t x){
|
static inline int32_t le32_to_cpu(int32_t x){
|
||||||
@@ -76,11 +65,11 @@ static inline int16_t be16_to_cpu(int16_t x){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t le32_to_cpu(int32_t x){
|
static inline int32_t le32_to_cpu(int32_t x){
|
||||||
return(swap32(x));
|
return(UINT32_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int16_t le16_to_cpu(int16_t x){
|
static inline int16_t le16_to_cpu(int16_t x){
|
||||||
return(swap16(x));
|
return(UINT16_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -127,7 +116,7 @@ void cderror(cdrom_drive_t *d, const char *s);
|
|||||||
|
|
||||||
void cdmessage(cdrom_drive_t *d,const char *s);
|
void cdmessage(cdrom_drive_t *d,const char *s);
|
||||||
|
|
||||||
void idperror(int messagedest,char **messages,const char *f, const char *s);
|
void idperror(int messagedest, char **messages, const char *f, const char *s);
|
||||||
|
|
||||||
void idmessage(int messagedest,char **messages,const char *f, const char *s);
|
void idmessage(int messagedest, char **messages, const char *f, const char *s);
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
|
|
||||||
#include <cdio/cdda_interface.h>
|
#include <cdio/cdda_interface.h>
|
||||||
#include <cdio/paranoia.h>
|
#include <cdio/paranoia.h>
|
||||||
|
#include <cdio/bytesex.h>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "report.h"
|
#include "report.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@@ -1236,7 +1237,8 @@ int main(int argc,char *argv[]){
|
|||||||
|
|
||||||
if(output_endian!=bigendianp()){
|
if(output_endian!=bigendianp()){
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<CDIO_CD_FRAMESIZE_RAW/2;i++)readbuf[i]=swap16(readbuf[i]);
|
for(i=0;i<CDIO_CD_FRAMESIZE_RAW/2;i++)
|
||||||
|
readbuf[i]=UINT16_SWAP_LE_BE_C(readbuf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(cursor*(CD_FRAMEWORDS)-1,-2);
|
callback(cursor*(CD_FRAMEWORDS)-1,-2);
|
||||||
@@ -1250,7 +1252,8 @@ int main(int argc,char *argv[]){
|
|||||||
|
|
||||||
if(output_endian!=bigendianp()){
|
if(output_endian!=bigendianp()){
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<CDIO_CD_FRAMESIZE_RAW/2;i++)readbuf[i]=swap16(readbuf[i]);
|
for(i=0;i<CDIO_CD_FRAMESIZE_RAW/2;i++)
|
||||||
|
readbuf[i]=UINT16_SWAP_LE_BE_C(readbuf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* One last bit of silliness to deal with sample offsets */
|
/* One last bit of silliness to deal with sample offsets */
|
||||||
@@ -1279,7 +1282,7 @@ int main(int argc,char *argv[]){
|
|||||||
|
|
||||||
if(output_endian!=bigendianp())
|
if(output_endian!=bigendianp())
|
||||||
for(i=0;i<CDIO_CD_FRAMESIZE_RAW/2;i++)
|
for(i=0;i<CDIO_CD_FRAMESIZE_RAW/2;i++)
|
||||||
offset_buffer[i]=swap16(readbuf[i]);
|
offset_buffer[i]=UINT16_SWAP_LE_BE_C(readbuf[i]);
|
||||||
else
|
else
|
||||||
memcpy(offset_buffer,readbuf,CDIO_CD_FRAMESIZE_RAW);
|
memcpy(offset_buffer,readbuf,CDIO_CD_FRAMESIZE_RAW);
|
||||||
offset_buffer_used=sample_offset*4;
|
offset_buffer_used=sample_offset*4;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: utils.h,v 1.1 2004/12/18 17:29:32 rocky Exp $
|
$Id: utils.h,v 1.2 2004/12/19 00:02:09 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1998 Monty xiphmont@mit.edu
|
Copyright (C) 1998 Monty xiphmont@mit.edu
|
||||||
@@ -24,6 +24,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <cdio/types.h>
|
||||||
|
#include <cdio/bytesex.h>
|
||||||
|
|
||||||
extern long buffering_write(int outf, char *buffer, long num);
|
extern long buffering_write(int outf, char *buffer, long num);
|
||||||
extern int buffering_close(int fd);
|
extern int buffering_close(int fd);
|
||||||
@@ -39,26 +41,14 @@ static inline int bigendianp(void){
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t swap32(int32_t x){
|
|
||||||
return((((u_int32_t)x & 0x000000ffU) << 24) |
|
|
||||||
(((u_int32_t)x & 0x0000ff00U) << 8) |
|
|
||||||
(((u_int32_t)x & 0x00ff0000U) >> 8) |
|
|
||||||
(((u_int32_t)x & 0xff000000U) >> 24));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int16_t swap16(int16_t x){
|
|
||||||
return((((u_int16_t)x & 0x00ffU) << 8) |
|
|
||||||
(((u_int16_t)x & 0xff00U) >> 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
|
|
||||||
static inline int32_t be32_to_cpu(int32_t x){
|
static inline int32_t be32_to_cpu(int32_t x){
|
||||||
return(swap32(x));
|
return(UINT32_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int16_t be16_to_cpu(int16_t x){
|
static inline int16_t be16_to_cpu(int16_t x){
|
||||||
return(swap16(x));
|
return(UINT16_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t le32_to_cpu(int32_t x){
|
static inline int32_t le32_to_cpu(int32_t x){
|
||||||
@@ -80,11 +70,11 @@ static inline int16_t be16_to_cpu(int16_t x){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t le32_to_cpu(int32_t x){
|
static inline int32_t le32_to_cpu(int32_t x){
|
||||||
return(swap32(x));
|
return(UINT32_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int16_t le16_to_cpu(int16_t x){
|
static inline int16_t le16_to_cpu(int16_t x){
|
||||||
return(swap16(x));
|
return(UINT16_SWAP_LE_BE_C(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.am,v 1.35 2004/12/18 17:29:32 rocky Exp $
|
# $Id: Makefile.am,v 1.36 2004/12/19 00:02:09 rocky Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
#
|
#
|
||||||
@@ -41,7 +41,7 @@ testbincue_LDADD = $(LIBCDIO_LIBS)
|
|||||||
testbincue_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
|
testbincue_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
|
||||||
|
|
||||||
check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh \
|
check_SCRIPTS = check_nrg.sh check_cue.sh check_cd_read.sh \
|
||||||
check_iso.sh check_opts.sh
|
check_iso.sh check_opts.sh check_paranoia.sh
|
||||||
|
|
||||||
check_PROGRAMS = $(hack)
|
check_PROGRAMS = $(hack)
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \
|
|||||||
TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
|
TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
|
||||||
XFAIL_TESTS = testassert
|
XFAIL_TESTS = testassert
|
||||||
|
|
||||||
MOSTLYCLEANFILES = core core.* *.dump
|
MOSTLYCLEANFILES = core core.* *.dump cdda-orig.wav cdda-try.wav
|
||||||
|
|
||||||
test: check
|
test: check
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ test: check
|
|||||||
# life the crappy automess system that I've really lost interest in
|
# life the crappy automess system that I've really lost interest in
|
||||||
# learning any more of this awful system than I need to.
|
# learning any more of this awful system than I need to.
|
||||||
check-am: make-executable
|
check-am: make-executable
|
||||||
make-executable: check_nrg.sh check_cue.sh
|
make-executable: check_nrg.sh check_cue.sh check_paranoia.sh
|
||||||
chmod +x *.sh
|
chmod +x *.sh
|
||||||
if test ! -f cdda.bin ; then $(LN_S) $(srcdir)/cdda.bin cdda.bin ; fi
|
if test ! -f cdda.bin ; then $(LN_S) $(srcdir)/cdda.bin cdda.bin ; fi
|
||||||
if test ! -f isofs-m1.bin ; then $(LN_S) $(srcdir)/isofs-m1.bin isofs-m1.bin ; fi
|
if test ! -f isofs-m1.bin ; then $(LN_S) $(srcdir)/isofs-m1.bin isofs-m1.bin ; fi
|
||||||
|
|||||||
31
test/check_paranoia.sh.in
Normal file
31
test/check_paranoia.sh.in
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $Id: check_paranoia.sh.in,v 1.1 2004/12/19 00:02:09 rocky Exp $
|
||||||
|
# Compare our cd-paranoia with an installed cdparanoia
|
||||||
|
|
||||||
|
if test "@OLD_CDPARANOIA@" != no -a -x @OLD_CDPARANOIA@ ; then
|
||||||
|
if test "@CMP@" != no -a -x @OLD_CDPARANOIA@ ; then
|
||||||
|
for opt in '' '-r' '-p' '-f' '-a' ; do
|
||||||
|
frames='"1[:130]-1[:134]"'
|
||||||
|
../src/cd-paranoia/cd-paranoia $frames cdda-try.wav
|
||||||
|
@OLD_CDPARANOIA@ $frames cdda-orig.wav
|
||||||
|
if @CMP@ cdda-try.wav cdda-orig.wav ; then
|
||||||
|
echo "** New and old paranoia output are identical using option '$opt'"
|
||||||
|
else
|
||||||
|
echo "** New and old paranoia output differ using option $opt"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Don't see libcdio cd-paranoia program. Test skipped."
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Don't see non-libcdio cdparanoia program. Test skipped."
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
#;;; Local Variables: ***
|
||||||
|
#;;; mode:shell-script ***
|
||||||
|
#;;; eval: (sh-set-shell "bash") ***
|
||||||
|
#;;; End: ***
|
||||||
|
|
||||||
Reference in New Issue
Block a user