[libvirt] [PATCHv3 04/13] FIXUP: fix tests

Ján Tomko posted 13 patches 7 years ago
[libvirt] [PATCHv3 04/13] FIXUP: fix tests
Posted by Ján Tomko 7 years ago
Jansson does not add an extra newline after the output
and it formats empty elements differently.
---
 tests/qemublocktest.c                    | 1 +
 tests/qemumigparamsdata/empty.json       | 4 +---
 tests/qemumigparamsdata/unsupported.json | 4 +---
 tests/virmacmaptestdata/empty.json       | 4 +---
 4 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index eae1ca8ee3..4bed82b4f5 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -301,6 +301,7 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque)
             goto cleanup;
 
         virBufferAdd(&buf, jsonstr, -1);
+        virBufferAddLit(&buf, "\n");
         VIR_FREE(jsonstr);
     }
 
diff --git a/tests/qemumigparamsdata/empty.json b/tests/qemumigparamsdata/empty.json
index 0db3279e44..0967ef424b 100644
--- a/tests/qemumigparamsdata/empty.json
+++ b/tests/qemumigparamsdata/empty.json
@@ -1,3 +1 @@
-{
-
-}
+{}
diff --git a/tests/qemumigparamsdata/unsupported.json b/tests/qemumigparamsdata/unsupported.json
index 0db3279e44..0967ef424b 100644
--- a/tests/qemumigparamsdata/unsupported.json
+++ b/tests/qemumigparamsdata/unsupported.json
@@ -1,3 +1 @@
-{
-
-}
+{}
diff --git a/tests/virmacmaptestdata/empty.json b/tests/virmacmaptestdata/empty.json
index 41b42e677b..fe51488c70 100644
--- a/tests/virmacmaptestdata/empty.json
+++ b/tests/virmacmaptestdata/empty.json
@@ -1,3 +1 @@
-[
-
-]
+[]
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv3 04/13] FIXUP: fix tests
Posted by Peter Krempa 6 years, 12 months ago
On Fri, May 11, 2018 at 14:59:05 +0200, Ján Tomko wrote:
> Jansson does not add an extra newline after the output
> and it formats empty elements differently.
> ---
>  tests/qemublocktest.c                    | 1 +
>  tests/qemumigparamsdata/empty.json       | 4 +---
>  tests/qemumigparamsdata/unsupported.json | 4 +---
>  tests/virmacmaptestdata/empty.json       | 4 +---
>  4 files changed, 4 insertions(+), 9 deletions(-)

ACK
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list