qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 33/97] vmstate: Test for VMSTATE_UINT16_ARRAY


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

Remove unused VMSTATE_UINT16_ARRAY_V.

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

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index c74cdf3..2579c4f 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -609,15 +609,12 @@ extern const VMStateInfo vmstate_info_bitmap;
 #define VMSTATE_UINT8_ARRAY(_f, _s, _n)                               \
     VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint8, uint8_t)

-#define VMSTATE_UINT16_ARRAY_V(_f, _s, _n, _v)                         \
-    VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint16, uint16_t)
+#define VMSTATE_UINT16_ARRAY(_f, _s, _n)                              \
+    VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint16, uint16_t)

 #define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v)                \
     VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)

-#define VMSTATE_UINT16_ARRAY(_f, _s, _n)                               \
-    VMSTATE_UINT16_ARRAY_V(_f, _s, _n, 0)
-
 #define VMSTATE_UINT16_2DARRAY(_f, _s, _n1, _n2)                      \
     VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, 0)

diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index 8a73d4c..ae0421e 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -542,6 +542,7 @@ typedef struct TestArray {
     bool     b_2[VMSTATE_ARRAY_SIZE];
     uint8_t  u8_1[VMSTATE_ARRAY_SIZE];
     uint8_t  u8_2[VMSTATE_ARRAY_SIZE];
+    uint16_t u16_1[VMSTATE_ARRAY_SIZE];
 } TestArray;

 TestArray obj_array = {
@@ -550,6 +551,7 @@ TestArray obj_array = {
     .b_2 = { true, false, true, false, true},
     .u8_1 = { 1, 2, 3, 4, 5},
     .u8_2 = { 5, 4, 3, 2, 1},
+    .u16_1 = {11, 12, 13, 14, 15},
 };

 static const VMStateDescription vmstate_array_primitive = {
@@ -561,6 +563,7 @@ static const VMStateDescription vmstate_array_primitive = {
         VMSTATE_INT32(size, TestArray),
         VMSTATE_BOOL_ARRAY(b_1, TestArray, VMSTATE_ARRAY_SIZE),
         VMSTATE_UINT8_ARRAY(u8_1, TestArray, VMSTATE_ARRAY_SIZE),
+        VMSTATE_UINT16_ARRAY(u16_1, TestArray, VMSTATE_ARRAY_SIZE),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -569,6 +572,7 @@ uint8_t wire_array_primitive[] = {
     /* size */  0x00, 0x00, 0x00, 0x05,
     /* b_1 */   0x00, 0x01, 0x00, 0x01, 0x00,
     /* u8_1 */  0x01, 0x02, 0x03, 0x04, 0x05,
+    /* u16_1 */ 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0f,
     QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
 };

@@ -625,6 +629,7 @@ static void test_array_primitive(void)
         ELEM_ASSERT(b_1, i);
         ELEM_ASSERT(u8_1, i);
         ELEM_NOT_ASSERT(u8_2, i);
+        ELEM_ASSERT(u16_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]