Fold more tests into bi/ncue driver.

This commit is contained in:
R. Bernstein
2010-01-20 21:52:23 -05:00
parent 818e499c4c
commit cda73dfa47
3 changed files with 83 additions and 9 deletions

View File

@@ -1,6 +1,4 @@
/* -*- C -*-
$Id: testbincue.c.in,v 1.2 2008/03/22 18:08:25 karl Exp $
Copyright (C) 2004, 2006, 2008, 2010 Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
@@ -18,7 +16,7 @@
*/
/*
Regression test for cdio_binfile().
Regression test for BIN/CUE device driver.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -125,6 +123,45 @@ main(int argc, const char *argv[])
}
drc = cdio_set_speed(p_cdio, 5);
}
{
const char *psz_response = cdio_get_arg(p_cdio, "mmc-supported?");
if ( psz_response == NULL ||
((0 != strncmp("false", psz_response, sizeof("false")))) ) {
fprintf(stderr,
"cdio_get_arg(\"mmc-supported?\") should return \"false\"; got: \"%s\".\n",
psz_response);
exit(3);
}
}
{
const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode");
if ( psz_access_mode == NULL ||
((0 != strncmp("image", psz_access_mode, sizeof("image")))) ) {
fprintf(stderr,
"cdio_get_arg(\"access-mode?\") should return \"image\"; got: \"%s\".\n",
psz_access_mode);
exit(4);
}
}
{
const char *psz_source = cdio_get_arg(p_cdio, "source");
const char *psz_device = cdio_get_default_device(p_cdio);
if ( psz_source == NULL ||
(0 != strcmp(psz_device, psz_device)) ) {
fprintf(stderr,
"cdio_get_arg(\"source\") should return \"%s\"; got: \"%s\".\n",
psz_source, psz_device);
exit(4);
}
}
cdio_destroy(p_cdio);
}
}

View File

@@ -1,6 +1,4 @@
/* -*- C -*-
$Id: testbincue.c.in,v 1.2 2008/03/22 18:08:25 karl Exp $
Copyright (C) 2004, 2006, 2008, 2010 Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
@@ -18,7 +16,7 @@
*/
/*
Regression test for cdio_binfile().
Regression test for BIN/CUE device driver.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -125,6 +123,45 @@ main(int argc, const char *argv[])
}
drc = cdio_set_speed(p_cdio, 5);
}
{
const char *psz_response = cdio_get_arg(p_cdio, "mmc-supported?");
if ( psz_response == NULL ||
((0 != strncmp("false", psz_response, sizeof("false")))) ) {
fprintf(stderr,
"cdio_get_arg(\"mmc-supported?\") should return \"false\"; got: \"%s\".\n",
psz_response);
exit(3);
}
}
{
const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode");
if ( psz_access_mode == NULL ||
((0 != strncmp("image", psz_access_mode, sizeof("image")))) ) {
fprintf(stderr,
"cdio_get_arg(\"access-mode?\") should return \"image\"; got: \"%s\".\n",
psz_access_mode);
exit(4);
}
}
{
const char *psz_source = cdio_get_arg(p_cdio, "source");
const char *psz_device = cdio_get_default_device(p_cdio);
if ( psz_source == NULL ||
(0 != strcmp(psz_device, psz_device)) ) {
fprintf(stderr,
"cdio_get_arg(\"source\") should return \"%s\"; got: \"%s\".\n",
psz_source, psz_device);
exit(4);
}
}
cdio_destroy(p_cdio);
}
}

View File

@@ -1,5 +1,5 @@
/* -*- C -*-
Copyright (C) 2009 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2009, 2010 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
@@ -70,7 +70,7 @@ main(int argc, const char *argv[])
((0 != strncmp("true", psz_response, sizeof("true"))) &&
(0 != strncmp("false", psz_response, sizeof("false")))) ) {
fprintf(stderr,
"cdio_get_arg(\"mmc-supported?\") should return \"true\" or \"false\"; got: %s.\n",
"cdio_get_arg(\"mmc-supported?\") should return \"true\" or \"false\"; got: \"%s\".\n",
psz_response);
exit(2);
}
@@ -96,7 +96,7 @@ main(int argc, const char *argv[])
if (0 != strncmp(psz_access_mode, "MMC_RDWR", strlen("MMC_RDWR"))) {
fprintf(stderr,
"Got %s; Should get back %s, the access mode requested.\n",
"Got \"%s\"; Should get back \"%s\", the access mode requested.\n",
psz_access_mode, "MMC_RDWR");
exit(4);
}