提交 51495a4d 编写于 作者: A Andrea Bolognani

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: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 29795544
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册