Blame SOURCES/kvm-qapi-add-native-list-coverage-for-visitor-serializat.patch

0a122b
From ee8b63caea8d46e37f7229fc420f4a61ed72a9a6 Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <ee8b63caea8d46e37f7229fc420f4a61ed72a9a6.1387369730.git.minovotn@redhat.com>
0a122b
In-Reply-To: <091eecc4fa42754760dfff393dabcc2b444e9693.1387369730.git.minovotn@redhat.com>
0a122b
References: <091eecc4fa42754760dfff393dabcc2b444e9693.1387369730.git.minovotn@redhat.com>
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
Date: Tue, 10 Dec 2013 15:29:07 +0100
0a122b
Subject: [PATCH 07/21] qapi: add native list coverage for visitor
0a122b
 serialization tests
0a122b
0a122b
RH-Author: Markus Armbruster <armbru@redhat.com>
0a122b
Message-id: <1386689361-30281-5-git-send-email-armbru@redhat.com>
0a122b
Patchwork-id: 56124
0a122b
O-Subject: [PATCH 7.0 qemu-kvm 04/18] qapi: add native list coverage for visitor serialization tests
0a122b
Bugzilla: 997915
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
0a122b
0a122b
From: Michael Roth <mdroth@linux.vnet.ibm.com>
0a122b
0a122b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
0a122b
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
0a122b
Reviewed-by: Amos Kong <akong@redhat.com>
0a122b
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
0a122b
(cherry picked from commit 8addacddfece619f1795fcf6cb9a3c49f800e7b9)
0a122b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
0a122b
---
0a122b
 tests/test-visitor-serialization.c | 451 +++++++++++++++++++++++++++++++++++--
0a122b
 1 file changed, 433 insertions(+), 18 deletions(-)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 tests/test-visitor-serialization.c | 451 +++++++++++++++++++++++++++++++++++--
0a122b
 1 file changed, 433 insertions(+), 18 deletions(-)
0a122b
0a122b
diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
0a122b
index fed6810..ee7916b 100644
0a122b
--- a/tests/test-visitor-serialization.c
0a122b
+++ b/tests/test-visitor-serialization.c
0a122b
@@ -23,6 +23,25 @@
0a122b
 #include "qapi/qmp-output-visitor.h"
0a122b
 #include "qapi/string-input-visitor.h"
0a122b
 #include "qapi/string-output-visitor.h"
0a122b
+#include "qapi-types.h"
0a122b
+#include "qapi-visit.h"
0a122b
+#include "qapi/dealloc-visitor.h"
0a122b
+
0a122b
+enum PrimitiveTypeKind {
0a122b
+    PTYPE_STRING = 0,
0a122b
+    PTYPE_BOOLEAN,
0a122b
+    PTYPE_NUMBER,
0a122b
+    PTYPE_INTEGER,
0a122b
+    PTYPE_U8,
0a122b
+    PTYPE_U16,
0a122b
+    PTYPE_U32,
0a122b
+    PTYPE_U64,
0a122b
+    PTYPE_S8,
0a122b
+    PTYPE_S16,
0a122b
+    PTYPE_S32,
0a122b
+    PTYPE_S64,
0a122b
+    PTYPE_EOL,
0a122b
+};
0a122b
 
0a122b
 typedef struct PrimitiveType {
0a122b
     union {
0a122b
@@ -40,26 +59,42 @@ typedef struct PrimitiveType {
0a122b
         int64_t s64;
0a122b
         intmax_t max;
0a122b
     } value;
0a122b
-    enum {
0a122b
-        PTYPE_STRING = 0,
0a122b
-        PTYPE_BOOLEAN,
0a122b
-        PTYPE_NUMBER,
0a122b
-        PTYPE_INTEGER,
0a122b
-        PTYPE_U8,
0a122b
-        PTYPE_U16,
0a122b
-        PTYPE_U32,
0a122b
-        PTYPE_U64,
0a122b
-        PTYPE_S8,
0a122b
-        PTYPE_S16,
0a122b
-        PTYPE_S32,
0a122b
-        PTYPE_S64,
0a122b
-        PTYPE_EOL,
0a122b
-    } type;
0a122b
+    enum PrimitiveTypeKind type;
0a122b
     const char *description;
0a122b
 } PrimitiveType;
0a122b
 
0a122b
+typedef struct PrimitiveList {
0a122b
+    union {
0a122b
+        strList *strings;
0a122b
+        boolList *booleans;
0a122b
+        numberList *numbers;
0a122b
+        intList *integers;
0a122b
+        int8List *s8_integers;
0a122b
+        int16List *s16_integers;
0a122b
+        int32List *s32_integers;
0a122b
+        int64List *s64_integers;
0a122b
+        uint8List *u8_integers;
0a122b
+        uint16List *u16_integers;
0a122b
+        uint32List *u32_integers;
0a122b
+        uint64List *u64_integers;
0a122b
+    } value;
0a122b
+    enum PrimitiveTypeKind type;
0a122b
+    const char *description;
0a122b
+} PrimitiveList;
0a122b
+
0a122b
 /* test helpers */
0a122b
 
0a122b
+typedef void (*VisitorFunc)(Visitor *v, void **native, Error **errp);
0a122b
+
0a122b
+static void dealloc_helper(void *native_in, VisitorFunc visit, Error **errp)
0a122b
+{
0a122b
+    QapiDeallocVisitor *qdv = qapi_dealloc_visitor_new();
0a122b
+
0a122b
+    visit(qapi_dealloc_get_visitor(qdv), &native_in, errp);
0a122b
+
0a122b
+    qapi_dealloc_visitor_cleanup(qdv);
0a122b
+}
0a122b
+
0a122b
 static void visit_primitive_type(Visitor *v, void **native, Error **errp)
0a122b
 {
0a122b
     PrimitiveType *pt = *native;
0a122b
@@ -105,6 +140,51 @@ static void visit_primitive_type(Visitor *v, void **native, Error **errp)
0a122b
     }
0a122b
 }
0a122b
 
0a122b
+static void visit_primitive_list(Visitor *v, void **native, Error **errp)
0a122b
+{
0a122b
+    PrimitiveList *pl = *native;
0a122b
+    switch (pl->type) {
0a122b
+    case PTYPE_STRING:
0a122b
+        visit_type_strList(v, &pl->value.strings, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_BOOLEAN:
0a122b
+        visit_type_boolList(v, &pl->value.booleans, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_NUMBER:
0a122b
+        visit_type_numberList(v, &pl->value.numbers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_INTEGER:
0a122b
+        visit_type_intList(v, &pl->value.integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_S8:
0a122b
+        visit_type_int8List(v, &pl->value.s8_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_S16:
0a122b
+        visit_type_int16List(v, &pl->value.s16_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_S32:
0a122b
+        visit_type_int32List(v, &pl->value.s32_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_S64:
0a122b
+        visit_type_int64List(v, &pl->value.s64_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_U8:
0a122b
+        visit_type_uint8List(v, &pl->value.u8_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_U16:
0a122b
+        visit_type_uint16List(v, &pl->value.u16_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_U32:
0a122b
+        visit_type_uint32List(v, &pl->value.u32_integers, NULL, errp);
0a122b
+        break;
0a122b
+    case PTYPE_U64:
0a122b
+        visit_type_uint64List(v, &pl->value.u64_integers, NULL, errp);
0a122b
+        break;
0a122b
+    default:
0a122b
+        g_assert(false);
0a122b
+    }
0a122b
+}
0a122b
+
0a122b
 typedef struct TestStruct
0a122b
 {
0a122b
     int64_t integer;
0a122b
@@ -206,12 +286,11 @@ static void visit_nested_struct_list(Visitor *v, void **native, Error **errp)
0a122b
 
0a122b
 /* test cases */
0a122b
 
0a122b
-typedef void (*VisitorFunc)(Visitor *v, void **native, Error **errp);
0a122b
-
0a122b
 typedef enum VisitorCapabilities {
0a122b
     VCAP_PRIMITIVES = 1,
0a122b
     VCAP_STRUCTURES = 2,
0a122b
     VCAP_LISTS = 4,
0a122b
+    VCAP_PRIMITIVE_LISTS = 8,
0a122b
 } VisitorCapabilities;
0a122b
 
0a122b
 typedef struct SerializeOps {
0a122b
@@ -270,6 +349,328 @@ static void test_primitives(gconstpointer opaque)
0a122b
     g_free(pt_copy);
0a122b
 }
0a122b
 
0a122b
+static void test_primitive_lists(gconstpointer opaque)
0a122b
+{
0a122b
+    TestArgs *args = (TestArgs *) opaque;
0a122b
+    const SerializeOps *ops = args->ops;
0a122b
+    PrimitiveType *pt = args->test_data;
0a122b
+    PrimitiveList pl = { .value = { 0 } };
0a122b
+    PrimitiveList pl_copy = { .value = { 0 } };
0a122b
+    PrimitiveList *pl_copy_ptr = &pl_copy;
0a122b
+    Error *err = NULL;
0a122b
+    void *serialize_data;
0a122b
+    void *cur_head = NULL;
0a122b
+    int i;
0a122b
+
0a122b
+    pl.type = pl_copy.type = pt->type;
0a122b
+
0a122b
+    /* build up our list of primitive types */
0a122b
+    for (i = 0; i < 32; i++) {
0a122b
+        switch (pl.type) {
0a122b
+        case PTYPE_STRING: {
0a122b
+            strList *tmp = g_new0(strList, 1);
0a122b
+            tmp->value = g_strdup(pt->value.string);
0a122b
+            if (pl.value.strings == NULL) {
0a122b
+                pl.value.strings = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.strings;
0a122b
+                pl.value.strings = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_INTEGER: {
0a122b
+            intList *tmp = g_new0(intList, 1);
0a122b
+            tmp->value = pt->value.integer;
0a122b
+            if (pl.value.integers == NULL) {
0a122b
+                pl.value.integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.integers;
0a122b
+                pl.value.integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S8: {
0a122b
+            int8List *tmp = g_new0(int8List, 1);
0a122b
+            tmp->value = pt->value.s8;
0a122b
+            if (pl.value.s8_integers == NULL) {
0a122b
+                pl.value.s8_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.s8_integers;
0a122b
+                pl.value.s8_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S16: {
0a122b
+            int16List *tmp = g_new0(int16List, 1);
0a122b
+            tmp->value = pt->value.s16;
0a122b
+            if (pl.value.s16_integers == NULL) {
0a122b
+                pl.value.s16_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.s16_integers;
0a122b
+                pl.value.s16_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S32: {
0a122b
+            int32List *tmp = g_new0(int32List, 1);
0a122b
+            tmp->value = pt->value.s32;
0a122b
+            if (pl.value.s32_integers == NULL) {
0a122b
+                pl.value.s32_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.s32_integers;
0a122b
+                pl.value.s32_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S64: {
0a122b
+            int64List *tmp = g_new0(int64List, 1);
0a122b
+            tmp->value = pt->value.s64;
0a122b
+            if (pl.value.s64_integers == NULL) {
0a122b
+                pl.value.s64_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.s64_integers;
0a122b
+                pl.value.s64_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U8: {
0a122b
+            uint8List *tmp = g_new0(uint8List, 1);
0a122b
+            tmp->value = pt->value.u8;
0a122b
+            if (pl.value.u8_integers == NULL) {
0a122b
+                pl.value.u8_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.u8_integers;
0a122b
+                pl.value.u8_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U16: {
0a122b
+            uint16List *tmp = g_new0(uint16List, 1);
0a122b
+            tmp->value = pt->value.u16;
0a122b
+            if (pl.value.u16_integers == NULL) {
0a122b
+                pl.value.u16_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.u16_integers;
0a122b
+                pl.value.u16_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U32: {
0a122b
+            uint32List *tmp = g_new0(uint32List, 1);
0a122b
+            tmp->value = pt->value.u32;
0a122b
+            if (pl.value.u32_integers == NULL) {
0a122b
+                pl.value.u32_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.u32_integers;
0a122b
+                pl.value.u32_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U64: {
0a122b
+            uint64List *tmp = g_new0(uint64List, 1);
0a122b
+            tmp->value = pt->value.u64;
0a122b
+            if (pl.value.u64_integers == NULL) {
0a122b
+                pl.value.u64_integers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.u64_integers;
0a122b
+                pl.value.u64_integers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_NUMBER: {
0a122b
+            numberList *tmp = g_new0(numberList, 1);
0a122b
+            tmp->value = pt->value.number;
0a122b
+            if (pl.value.numbers == NULL) {
0a122b
+                pl.value.numbers = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.numbers;
0a122b
+                pl.value.numbers = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_BOOLEAN: {
0a122b
+            boolList *tmp = g_new0(boolList, 1);
0a122b
+            tmp->value = pt->value.boolean;
0a122b
+            if (pl.value.booleans == NULL) {
0a122b
+                pl.value.booleans = tmp;
0a122b
+            } else {
0a122b
+                tmp->next = pl.value.booleans;
0a122b
+                pl.value.booleans = tmp;
0a122b
+            }
0a122b
+            break;
0a122b
+        }
0a122b
+        default:
0a122b
+            g_assert(0);
0a122b
+        }
0a122b
+    }
0a122b
+
0a122b
+    ops->serialize((void **)&pl, &serialize_data, visit_primitive_list, &err);
0a122b
+    ops->deserialize((void **)&pl_copy_ptr, serialize_data, visit_primitive_list, &err);
0a122b
+
0a122b
+    g_assert(err == NULL);
0a122b
+    i = 0;
0a122b
+
0a122b
+    /* compare our deserialized list of primitives to the original */
0a122b
+    do {
0a122b
+        switch (pl_copy.type) {
0a122b
+        case PTYPE_STRING: {
0a122b
+            strList *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.strings;
0a122b
+            }
0a122b
+            g_assert_cmpstr(pt->value.string, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_INTEGER: {
0a122b
+            intList *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.integer, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S8: {
0a122b
+            int8List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.s8_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.s8, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S16: {
0a122b
+            int16List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.s16_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.s16, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S32: {
0a122b
+            int32List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.s32_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.s32, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_S64: {
0a122b
+            int64List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.s64_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.s64, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U8: {
0a122b
+            uint8List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.u8_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.u8, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U16: {
0a122b
+            uint16List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.u16_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.u16, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U32: {
0a122b
+            uint32List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.u32_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.u32, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_U64: {
0a122b
+            uint64List *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.u64_integers;
0a122b
+            }
0a122b
+            g_assert_cmpint(pt->value.u64, ==, ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_NUMBER: {
0a122b
+            numberList *ptr;
0a122b
+            GString *double_expected = g_string_new("");
0a122b
+            GString *double_actual = g_string_new("");
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.numbers;
0a122b
+            }
0a122b
+            /* we serialize with %f for our reference visitors, so rather than
0a122b
+             * fuzzy floating math to test "equality", just compare the
0a122b
+             * formatted values
0a122b
+             */
0a122b
+            g_string_printf(double_expected, "%.6f", pt->value.number);
0a122b
+            g_string_printf(double_actual, "%.6f", ptr->value);
0a122b
+            g_assert_cmpstr(double_actual->str, ==, double_expected->str);
0a122b
+            g_string_free(double_expected, true);
0a122b
+            g_string_free(double_actual, true);
0a122b
+            break;
0a122b
+        }
0a122b
+        case PTYPE_BOOLEAN: {
0a122b
+            boolList *ptr;
0a122b
+            if (cur_head) {
0a122b
+                ptr = cur_head;
0a122b
+                cur_head = ptr->next;
0a122b
+            } else {
0a122b
+                cur_head = ptr = pl_copy.value.booleans;
0a122b
+            }
0a122b
+            g_assert_cmpint(!!pt->value.boolean, ==, !!ptr->value);
0a122b
+            break;
0a122b
+        }
0a122b
+        default:
0a122b
+            g_assert(0);
0a122b
+        }
0a122b
+        i++;
0a122b
+    } while (cur_head);
0a122b
+
0a122b
+    g_assert_cmpint(i, ==, 33);
0a122b
+
0a122b
+    ops->cleanup(serialize_data);
0a122b
+    dealloc_helper(&pl, visit_primitive_list, &err);
0a122b
+    g_assert(!err);
0a122b
+    dealloc_helper(&pl_copy, visit_primitive_list, &err);
0a122b
+    g_assert(!err);
0a122b
+    g_free(args);
0a122b
+}
0a122b
+
0a122b
 static void test_struct(gconstpointer opaque)
0a122b
 {
0a122b
     TestArgs *args = (TestArgs *) opaque;
0a122b
@@ -719,7 +1120,8 @@ static const SerializeOps visitors[] = {
0a122b
         .serialize = qmp_serialize,
0a122b
         .deserialize = qmp_deserialize,
0a122b
         .cleanup = qmp_cleanup,
0a122b
-        .caps = VCAP_PRIMITIVES | VCAP_STRUCTURES | VCAP_LISTS
0a122b
+        .caps = VCAP_PRIMITIVES | VCAP_STRUCTURES | VCAP_LISTS |
0a122b
+                VCAP_PRIMITIVE_LISTS
0a122b
     },
0a122b
     {
0a122b
         .type = "String",
0a122b
@@ -773,6 +1175,19 @@ static void add_visitor_type(const SerializeOps *ops)
0a122b
         args->test_data = NULL;
0a122b
         g_test_add_data_func(testname, args, test_nested_struct_list);
0a122b
     }
0a122b
+
0a122b
+    if (ops->caps & VCAP_PRIMITIVE_LISTS) {
0a122b
+        i = 0;
0a122b
+        while (pt_values[i].type != PTYPE_EOL) {
0a122b
+            sprintf(testname, "%s/primitive_list/%s", testname_prefix,
0a122b
+                    pt_values[i].description);
0a122b
+            args = g_malloc0(sizeof(*args));
0a122b
+            args->ops = ops;
0a122b
+            args->test_data = &pt_values[i];
0a122b
+            g_test_add_data_func(testname, args, test_primitive_lists);
0a122b
+            i++;
0a122b
+        }
0a122b
+    }
0a122b
 }
0a122b
 
0a122b
 int main(int argc, char **argv)
0a122b
-- 
0a122b
1.7.11.7
0a122b