[libvirt] [PATCH 1/9] virmacmaptest: depend on yajl for 'empty' test

Ján Tomko posted 9 patches 7 years, 1 month ago
[libvirt] [PATCH 1/9] virmacmaptest: depend on yajl for 'empty' test
Posted by Ján Tomko 7 years, 1 month ago
While an empty array is formatted with two newlines with yajl,
jansson does not put any newlines between the brackets.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 tests/virmacmaptest.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c
index 6e3e9984d..e0cf8f91a 100644
--- a/tests/virmacmaptest.c
+++ b/tests/virmacmaptest.c
@@ -205,8 +205,11 @@ mymain(void)
     DO_TEST_BASIC("simple2", "f24", "aa:bb:cc:dd:ee:ff", "a1:b2:c3:d4:e5:f6");
     DO_TEST_BASIC("simple2", "f25", "00:11:22:33:44:55", "aa:bb:cc:00:11:22");
 
+#if WITH_YAJL
+    /* other JSON libraries might format an empty array differently */
     DO_TEST_FLUSH_PROLOGUE;
     DO_TEST_FLUSH_EPILOGUE("empty");
+#endif
 
     DO_TEST_FLUSH_PROLOGUE;
     DO_TEST_FLUSH("f24", "aa:bb:cc:dd:ee:ff");
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/9] virmacmaptest: depend on yajl for 'empty' test
Posted by Peter Krempa 7 years, 1 month ago
On Thu, Mar 29, 2018 at 01:09:50 +0200, Ján Tomko wrote:
> While an empty array is formatted with two newlines with yajl,
> jansson does not put any newlines between the brackets.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---

This should not be necessary if we replace the JSON library based JSON
formatting with virBuffer as I've proposed.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list