提交 b565e407 编写于 作者: J Ján Tomko

virjsontest: use name instead of doc for deflatten test

This test gets its JSON docs from files.

Now that we have a 'name' field in testInfo, use it instead
of abusing the 'doc' field.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 020382b2
...@@ -326,9 +326,9 @@ testJSONDeflatten(const void *data) ...@@ -326,9 +326,9 @@ testJSONDeflatten(const void *data)
int ret = -1; int ret = -1;
if (virAsprintf(&infile, "%s/virjsondata/deflatten-%s-in.json", if (virAsprintf(&infile, "%s/virjsondata/deflatten-%s-in.json",
abs_srcdir, info->doc) < 0 || abs_srcdir, info->name) < 0 ||
virAsprintf(&outfile, "%s/virjsondata/deflatten-%s-out.json", virAsprintf(&outfile, "%s/virjsondata/deflatten-%s-out.json",
abs_srcdir, info->doc) < 0) abs_srcdir, info->name) < 0)
goto cleanup; goto cleanup;
if (virTestLoadFile(infile, &indata) < 0) if (virTestLoadFile(infile, &indata) < 0)
...@@ -339,7 +339,7 @@ testJSONDeflatten(const void *data) ...@@ -339,7 +339,7 @@ testJSONDeflatten(const void *data)
if ((deflattened = virJSONValueObjectDeflatten(injson))) { if ((deflattened = virJSONValueObjectDeflatten(injson))) {
if (!info->pass) { if (!info->pass) {
VIR_TEST_VERBOSE("%s: deflattening should have failed\n", info->doc); VIR_TEST_VERBOSE("%s: deflattening should have failed\n", info->name);
goto cleanup; goto cleanup;
} }
} else { } else {
...@@ -638,7 +638,7 @@ mymain(void) ...@@ -638,7 +638,7 @@ mymain(void)
ObjectFormatSteal, NULL, NULL, true); ObjectFormatSteal, NULL, NULL, true);
#define DO_TEST_DEFLATTEN(name, pass) \ #define DO_TEST_DEFLATTEN(name, pass) \
DO_TEST_FULL(name, Deflatten, name, NULL, pass) DO_TEST_FULL(name, Deflatten, NULL, NULL, pass)
DO_TEST_DEFLATTEN("unflattened", true); DO_TEST_DEFLATTEN("unflattened", true);
DO_TEST_DEFLATTEN("basic-file", true); DO_TEST_DEFLATTEN("basic-file", true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册