Received: from eggs.gnu.org ([2001:4830:134:3::10]:51347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX09B-0006RX-9v for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX093-0008Kv-ON for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX093-0008Kj-Gj for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:49 -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 s373Mmn0005876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Apr 2014 23:22:49 -0400 From: Juan Quintela Date: Mon, 7 Apr 2014 05:20:54 +0200 Message-Id: <1396840915-10384-37-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 36/97] vmstate: Test for VMSTATE_INT16_ARRAY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Remove unused VMSTATE_INT16_ARRAY_V Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 3271114..5e62206 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -624,6 +624,9 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT64_ARRAY(_f, _s, _n) \ VMSTATE_UINT64_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_INT16_ARRAY(_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int16, int16_t) + #define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t) @@ -645,12 +648,6 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT32_2DARRAY(_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_INT16_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int16, int16_t) - -#define VMSTATE_INT16_ARRAY(_f, _s, _n) \ - VMSTATE_INT16_ARRAY_V(_f, _s, _n, 0) - #define VMSTATE_INT32_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int32, int32_t) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 1f50948..e800be0 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -547,6 +547,7 @@ typedef struct TestArray { uint32_t u32_2[VMSTATE_ARRAY_SIZE]; uint64_t u64_1[VMSTATE_ARRAY_SIZE]; uint64_t u64_2[VMSTATE_ARRAY_SIZE]; + int16_t i16_1[VMSTATE_ARRAY_SIZE]; } TestArray; TestArray obj_array = { @@ -560,6 +561,7 @@ TestArray obj_array = { .u32_2 = {25, 24, 23, 22, 21}, .u64_1 = {31, 32, 33, 34, 35}, .u64_2 = {35, 34, 33, 32, 31}, + .i16_1 = {41, 42, 43, 44, 45}, }; static const VMStateDescription vmstate_array_primitive = { @@ -574,6 +576,7 @@ static const VMStateDescription vmstate_array_primitive = { VMSTATE_UINT16_ARRAY(u16_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_UINT32_ARRAY(u32_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_UINT64_ARRAY(u64_1, TestArray, VMSTATE_ARRAY_SIZE), + VMSTATE_INT16_ARRAY(i16_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_END_OF_LIST() } }; @@ -591,6 +594,7 @@ uint8_t wire_array_primitive[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, + /* i16_1 */ 0x00, 0x29, 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2d, QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ }; @@ -650,6 +654,7 @@ static void test_array_primitive(void) ELEM_ASSERT(u16_1, i); ELEM_ASSERT(u32_1, i); ELEM_ASSERT(u64_1, i); + ELEM_ASSERT(i16_1, i); } /* We save the file again. We want the EOF this time */ -- 1.9.0