I hate conflicted merges

This commit is contained in:
R. Bernstein
2008-12-06 22:44:28 -05:00
23 changed files with 169 additions and 181 deletions

View File

@@ -1,37 +0,0 @@
.deps
.libs
Makefile
Makefile.in
cdda.raw
cdda-orig.wav
cdda-try.wav
cdda-1.raw
cdda-2.raw
cdda-good.raw
cdda-jitter.raw
cdda-underrun.raw
check_cue.sh
check_paranoia.sh
check_common_fn
check_iso.sh
check_nrg.sh
check_sizeof
testassert
testbincue
testbincue.c
testdefault
testischar
testiso9660
testisocd
testisocd2
testisocd2.c
testnrg
testnrg.c
testparanoia
testpregap
testpregap.c
testtoc
*.dump
*.cue
*.bin
*.nrg

9
test/.gitignore vendored
View File

@@ -1,4 +1,8 @@
/*.o
<<<<<<< HEAD:test/.gitignore
=======
/*~
>>>>>>> 4f0228e99f37dedd16bc56df7b3982b589cf4122:test/.gitignore
/.deps
/.libs
/Makefile
@@ -17,6 +21,11 @@
/testassert
/testbincue
/testbincue.c
<<<<<<< HEAD:test/.gitignore
=======
/testdefault
/testgetdevices
>>>>>>> 4f0228e99f37dedd16bc56df7b3982b589cf4122:test/.gitignore
/testischar
/testiso9660
/testisocd

View File

@@ -28,7 +28,7 @@ testparanoia=testparanoia
testparanoia_LDADD = $(LIBCDIO_PARANOIA_LIBS) $(LIBCDIO_CDDA_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV)
endif
hack = check_sizeof testassert testbincue testischar \
hack = check_sizeof testassert testbincue testgetdevices testischar \
testisocd testisocd2 testiso9660 \
testnrg $(testparanoia) testtoc testpregap
@@ -39,6 +39,7 @@ INCLUDES = -I$(top_srcdir) $(LIBCDIO_CFLAGS) $(LIBISO9660_CFLAGS)
check_sizeof_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV)
testassert_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
testdefault_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
testgetdevices_LDADD= $(LIBCDIO_LIBS) $(LTLIBICONV)
testischar_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV)
testiso9660_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV)

View File

@@ -80,6 +80,13 @@ main(int argc, const char *argv[])
cdio_log_set_handler (log_handler);
if (cdio_have_driver(-1) != false)
{
printf("Bogus driver number -1 should be regexted\n");
return 5;
}
if (! (cdio_have_driver(DRIVER_NRG) && cdio_have_driver(DRIVER_BINCUE)) ) {
printf("You don't have enough drivers for this test\n");
exit(77);
@@ -189,12 +196,8 @@ main(int argc, const char *argv[])
}
cdio_free_device_list(nrg_images);
free(nrg_images);
cdio_free_device_list(bincue_images);
free(bincue_images);
cdio_free_device_list(imgs);
free(imgs);
return 0;
}

124
test/testgetdevices.c Normal file
View File

@@ -0,0 +1,124 @@
/*
Copyright (C) 2008 Rocky Bernstein <rocky@gnu.org>
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 3 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, see <http://www.gnu.org/licenses/>.
*/
/*
Regression test for cdio_get_devices, cdio_get_devices_with_cap(),
and cdio_free_device_list()
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <cdio/cdio.h>
#include <cdio/cd_types.h>
#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
static void
log_handler (cdio_log_level_t level, const char message[])
{
switch(level) {
case CDIO_LOG_DEBUG:
case CDIO_LOG_INFO:
return;
default:
printf("cdio %d message: %s\n", level, message);
}
}
static bool
is_in(char **file_list, const char *file)
{
char **p;
for (p = file_list; p != NULL && *p != NULL; p++) {
if (strcmp(*p, file) == 0) {
printf("File %s found as expected\n", file);
return true;
}
}
printf("Can't find file %s in list\n", file);
return false;
}
int
main(int argc, const char *argv[])
{
char **nrg_images=NULL;
char **bincue_images=NULL;
char **imgs;
unsigned int i;
int ret=0;
const char *cue_files[2] = {"cdda.cue", "isofs-m1.cue"};
const char *nrg_files[1] = {"videocd.nrg"};
cdio_log_set_handler (log_handler);
if (cdio_have_driver(-1) != false)
{
printf("Bogus driver number -1 should be regexted\n");
return 5;
}
if (! (cdio_have_driver(DRIVER_NRG) && cdio_have_driver(DRIVER_BINCUE)) ) {
printf("You don't have enough drivers for this test\n");
exit(77);
}
nrg_images = cdio_get_devices(DRIVER_NRG);
for (imgs=nrg_images; *imgs != NULL; imgs++) {
printf("NRG image %s\n", *imgs);
}
if (!is_in(nrg_images, nrg_files[0])) {
cdio_free_device_list(nrg_images);
return 10;
}
bincue_images = cdio_get_devices(DRIVER_BINCUE);
for (imgs=bincue_images; *imgs != NULL; imgs++) {
printf("bincue image %s\n", *imgs);
}
for (i=0; i<2; i++) {
if (is_in(bincue_images, cue_files[i])) {
printf("%s parses as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
} else {
printf("%s doesn't parse as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
ret = i+1;
}
}
if (ret != 0) return ret;
cdio_free_device_list(nrg_images);
cdio_free_device_list(bincue_images);
return 0;
}