mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
tests: testQemuCapsIterate: Pass inputDir to callback
Right now users need to know input file live inside TEST_QEMU_CAPS_PATH, which is bad layering. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
29795544fd
commit
51495a4d73
@ -49,7 +49,6 @@ testQemuDataInit(testQemuDataPtr data)
|
||||
if (qemuTestDriverInit(&data->driver) < 0)
|
||||
return -1;
|
||||
|
||||
data->inputDir = TEST_QEMU_CAPS_PATH;
|
||||
data->outputDir = TEST_QEMU_CAPS_PATH;
|
||||
|
||||
data->ret = 0;
|
||||
@ -180,7 +179,8 @@ testQemuCapsCopy(const void *opaque)
|
||||
|
||||
|
||||
static int
|
||||
doCapsTest(const char *base,
|
||||
doCapsTest(const char *inputDir,
|
||||
const char *base,
|
||||
const char *archName,
|
||||
void *opaque)
|
||||
{
|
||||
@ -193,6 +193,7 @@ doCapsTest(const char *base,
|
||||
return -1;
|
||||
}
|
||||
|
||||
data->inputDir = inputDir;
|
||||
data->base = base;
|
||||
data->archName = archName;
|
||||
|
||||
|
@ -39,7 +39,6 @@ struct _testQemuData {
|
||||
static int
|
||||
testQemuDataInit(testQemuDataPtr data)
|
||||
{
|
||||
data->inputDir = TEST_QEMU_CAPS_PATH;
|
||||
data->outputDir = abs_srcdir "/qemucaps2xmloutdata";
|
||||
|
||||
data->ret = 0;
|
||||
@ -174,7 +173,8 @@ testQemuCapsXML(const void *opaque)
|
||||
}
|
||||
|
||||
static int
|
||||
doCapsTest(const char *base,
|
||||
doCapsTest(const char *inputDir,
|
||||
const char *base,
|
||||
const char *archName,
|
||||
void *opaque)
|
||||
{
|
||||
@ -184,6 +184,7 @@ doCapsTest(const char *base,
|
||||
if (virAsprintf(&title, "%s (%s)", base, archName) < 0)
|
||||
return -1;
|
||||
|
||||
data->inputDir = inputDir;
|
||||
data->base = base;
|
||||
data->archName = archName;
|
||||
|
||||
|
@ -937,7 +937,7 @@ testQemuCapsIterate(const char *suffix,
|
||||
archName++;
|
||||
|
||||
/* Run the user-provided callback */
|
||||
if (callback(base, archName, opaque) < 0)
|
||||
if (callback(TEST_QEMU_CAPS_PATH, base, archName, opaque) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,8 @@ char *testQemuGetLatestCapsForArch(const char *arch,
|
||||
const char *suffix);
|
||||
virHashTablePtr testQemuGetLatestCaps(void);
|
||||
|
||||
typedef int (*testQemuCapsIterateCallback)(const char *base,
|
||||
typedef int (*testQemuCapsIterateCallback)(const char *inputDir,
|
||||
const char *base,
|
||||
const char *archName,
|
||||
void *opaque);
|
||||
int testQemuCapsIterate(const char *suffix,
|
||||
|
Loading…
Reference in New Issue
Block a user