diff mbox series

[v3,09/19] qlit: Add more test literals to qlit_equal_qobject() test case

Message ID 20201123194818.2773508-10-ehabkost@redhat.com
State New
Headers show
Series qom: Use qlit to represent property defaults | expand

Commit Message

Eduardo Habkost Nov. 23, 2020, 7:48 p.m. UTC
Add a few examples of each qlit type, to make sure each one
compare as equal to itself, but not equal to the other values.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
This is a new patch added in v3 of this series.
---
 tests/check-qlit.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/tests/check-qlit.c b/tests/check-qlit.c
index b1cfbddb17..5a9260b93f 100644
--- a/tests/check-qlit.c
+++ b/tests/check-qlit.c
@@ -50,11 +50,27 @@  static void qlit_equal_qobject_test(void)
 {
     /* Each entry in the values[] array should be different from the others */
     QLitObject values[] = {
+        QLIT_QNULL,
+        QLIT_QBOOL(false),
+        QLIT_QBOOL(true),
+        QLIT_QNUM_INT(-1),
+        QLIT_QNUM_INT(0),
+        QLIT_QNUM_INT(1),
+        QLIT_QNUM_INT(INT64_MIN),
+        QLIT_QNUM_INT(INT64_MAX),
+        QLIT_QSTR(""),
+        QLIT_QSTR("foo"),
         qlit,
         QLIT_QDICT(((QLitDictEntry[]) {
             { "foo", QLIT_QNUM_INT(42) },
             { },
         })),
+        QLIT_QLIST(((QLitObject[]){
+            QLIT_QNUM_INT(-1),
+            QLIT_QNUM_INT(0),
+            QLIT_QNUM_INT(1),
+            { },
+        })),
     };
     int i;
     QObject *qobj = make_qobject();