From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX09I-0006g1-HD for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX09B-0008O9-TV for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX09B-0008Nr-M8 for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:57 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s373MvDg005436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Apr 2014 23:22:57 -0400 From: Juan Quintela Date: Mon, 7 Apr 2014 05:21:00 +0200 Message-Id: <1396840915-10384-43-git-send-email-quintela@redhat.com> In-Reply-To: <1396840915-10384-1-git-send-email-quintela@redhat.com> References: <1396840915-10384-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH 42/97] vmstate: Test for VMSTATE_UINT32_2DARRAY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Remove unused _V version. Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 14c905a..e7ceb59 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -645,15 +645,12 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT16_2DARRAY(_f, _s, _n1, _n2) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint16, uint16_t) +#define VMSTATE_UINT32_2DARRAY(_f, _s, _n1, _n2) \ + VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint32, uint32_t) + #define VMSTATE_UINT8_SUB_ARRAY(_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, _v) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint32, uint32_t) - -#define VMSTATE_UINT32_2DARRAY(_f, _s, _n1, _n2) \ - VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) - #define VMSTATE_UINT32_SUB_ARRAY(_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index d0f6d4b..f51c887 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -555,6 +555,7 @@ typedef struct TestArray { float64 f64_1[VMSTATE_ARRAY_SIZE]; uint8_t u8_1d[VMSTATE_2D_SIZE][VMSTATE_2D_SIZE]; uint16_t u16_1d[VMSTATE_2D_SIZE][VMSTATE_2D_SIZE]; + uint32_t u32_1d[VMSTATE_2D_SIZE][VMSTATE_2D_SIZE]; } TestArray; TestArray obj_array = { @@ -580,6 +581,9 @@ TestArray obj_array = { .u16_1d = { {81, 82, 83}, {84, 85, 86}, {87, 88, 89} }, + .u32_1d = { {91, 92, 93}, + {94, 95, 96}, + {97, 98, 99} }, }; static const VMStateDescription vmstate_array_primitive = { @@ -602,6 +606,8 @@ static const VMStateDescription vmstate_array_primitive = { VMSTATE_2D_SIZE), VMSTATE_UINT16_2DARRAY(u16_1d, TestArray, VMSTATE_2D_SIZE, VMSTATE_2D_SIZE), + VMSTATE_UINT32_2DARRAY(u32_1d, TestArray, VMSTATE_2D_SIZE, + VMSTATE_2D_SIZE), VMSTATE_END_OF_LIST() } }; @@ -639,6 +645,15 @@ uint8_t wire_array_primitive[] = { /* u16_1d */0x00, 0x51, 0x00, 0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, 0x57, 0x00, 0x58, 0x00, 0x59, + /* u16_1d */0x00, 0x00, 0x00, 0x5b, + 0x00, 0x00, 0x00, 0x5c, + 0x00, 0x00, 0x00, 0x5d, + 0x00, 0x00, 0x00, 0x5e, + 0x00, 0x00, 0x00, 0x5f, + 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x61, + 0x00, 0x00, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x63, QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ }; @@ -709,6 +724,7 @@ static void test_array_primitive(void) for (j = 0; j < VMSTATE_2D_SIZE; j++) { ELEM_ASSERT_2D(u8_1d, i, j); ELEM_ASSERT_2D(u16_1d, i, j); + ELEM_ASSERT_2D(u32_1d, i, j); } } -- 1.9.0