From: Peter Krempa Date: Wed, 31 Mar 2021 07:29:22 +0000 (+0200) Subject: virTestLoadFileJSON: Don't try to unwrap JSON documents X-Git-Tag: v7.3.0-rc1~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5124770db19acd17bc2af413c9c6169a6c2faf5;p=thirdparty%2Flibvirt.git virTestLoadFileJSON: Don't try to unwrap JSON documents Use virFileReadAll to load the file instead of virTestLoadFile which tries to unwrap the file. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko Reviewed-by: Pavel Hrdina --- diff --git a/tests/testutils.c b/tests/testutils.c index 0f6b3a9705..3363d7f0aa 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -313,7 +313,7 @@ virTestLoadFileJSON(const char *p, ...) if (!(path = virTestLoadFileGetPath(p, ap))) goto cleanup; - if (virTestLoadFile(path, &jsonstr) < 0) + if (virFileReadAll(path, INT_MAX, &jsonstr) < 0) goto cleanup; if (!(ret = virJSONValueFromString(jsonstr)))