From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX096-0006Jk-W4 for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX090-0008K3-Qi for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX090-0008Jr-Ga for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:46 -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 s373Miu0005858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Apr 2014 23:22:45 -0400 From: Juan Quintela Date: Mon, 7 Apr 2014 05:20:51 +0200 Message-Id: <1396840915-10384-34-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 33/97] vmstate: Test for VMSTATE_UINT16_ARRAY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Remove unused VMSTATE_UINT16_ARRAY_V. Signed-off-by: Juan Quintela --- 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