qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 38/97] vmstate: Test for VMSTATE_INT64_ARRAY


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 38/97] vmstate: Test for VMSTATE_INT64_ARRAY
Date: Mon, 7 Apr 2014 05:20:56 +0200

Remove unused VMSTATE_INT64_ARRAY_V.

Signed-off-by: Juan Quintela <address@hidden>
---
 include/migration/vmstate.h | 9 +++------
 tests/test-vmstate.c        | 9 +++++++++
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 20062ff..35c7bef 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -633,6 +633,9 @@ extern const VMStateInfo vmstate_info_bitmap;
 #define VMSTATE_INT32_ARRAY(_f, _s, _n)                               \
     VMSTATE_INT32_ARRAY_TEST(_f, _s, _n, NULL)

+#define VMSTATE_INT64_ARRAY(_f, _s, _n)                               \
+    VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int64, int64_t)
+
 #define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v)                \
     VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)

@@ -657,12 +660,6 @@ extern const VMStateInfo vmstate_info_bitmap;
 #define VMSTATE_UINT32_SUB_ARRAY(_f, _s, _start, _num)                \
     VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t)

-#define VMSTATE_INT64_ARRAY_V(_f, _s, _n, _v)                         \
-    VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int64, int64_t)
-
-#define VMSTATE_INT64_ARRAY(_f, _s, _n)                               \
-    VMSTATE_INT64_ARRAY_V(_f, _s, _n, 0)
-
 #define VMSTATE_FLOAT64_ARRAY_V(_f, _s, _n, _v)                       \
     VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_float64, float64)

diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index 348851d..d33fa77 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -550,6 +550,7 @@ typedef struct TestArray {
     int16_t i16_1[VMSTATE_ARRAY_SIZE];
     int32_t i32_1[VMSTATE_ARRAY_SIZE];
     int32_t i32_2[VMSTATE_ARRAY_SIZE];
+    int64_t i64_1[VMSTATE_ARRAY_SIZE];
 } TestArray;

 TestArray obj_array = {
@@ -566,6 +567,7 @@ TestArray obj_array = {
     .i16_1 = {41, 42, 43, 44, 45},
     .i32_1 = {51, 52, 53, 54, 55},
     .i32_2 = {55, 54, 53, 52, 51},
+    .i64_1 = {61, 62, 63, 64, 65},
 };

 static const VMStateDescription vmstate_array_primitive = {
@@ -582,6 +584,7 @@ static const VMStateDescription vmstate_array_primitive = {
         VMSTATE_UINT64_ARRAY(u64_1, TestArray, VMSTATE_ARRAY_SIZE),
         VMSTATE_INT16_ARRAY(i16_1, TestArray, VMSTATE_ARRAY_SIZE),
         VMSTATE_INT32_ARRAY(i32_1, TestArray, VMSTATE_ARRAY_SIZE),
+        VMSTATE_INT64_ARRAY(i64_1, TestArray, VMSTATE_ARRAY_SIZE),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -603,6 +606,11 @@ uint8_t wire_array_primitive[] = {
     /* i32_1 */ 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34,
                 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x36,
                 0x00, 0x00, 0x00, 0x37,
+    /* u64_1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d,
+                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e,
+                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
+                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41,
     QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
 };

@@ -664,6 +672,7 @@ static void test_array_primitive(void)
         ELEM_ASSERT(u64_1, i);
         ELEM_ASSERT(i16_1, i);
         ELEM_ASSERT(i32_1, i);
+        ELEM_ASSERT(i64_1, i);
     }

     /* We save the file again.  We want the EOF this time */
-- 
1.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]