[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 044/124] vmstate: Test for VMSTATE_FLOAT64_ARRAY
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 044/124] vmstate: Test for VMSTATE_FLOAT64_ARRAY |
Date: |
Mon, 21 Apr 2014 16:40:24 +0200 |
Remove unused VMSTATE_FLOAT64_ARRAY_V.
Signed-off-by: Juan Quintela <address@hidden>
---
include/migration/vmstate.h | 9 +++------
tests/test-vmstate.c | 11 +++++++++++
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 0a562aa..378dbc9 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -636,6 +636,9 @@ extern const VMStateInfo vmstate_info_bitmap;
#define VMSTATE_INT64_ARRAY(_f, _s, _n) \
VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int64, int64_t)
+#define VMSTATE_FLOAT64_ARRAY(_f, _s, _n) \
+ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_float64, float64)
+
#define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v) \
VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -660,12 +663,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_FLOAT64_ARRAY_V(_f, _s, _n, _v) \
- VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_float64, float64)
-
-#define VMSTATE_FLOAT64_ARRAY(_f, _s, _n) \
- VMSTATE_FLOAT64_ARRAY_V(_f, _s, _n, 0)
-
#define VMSTATE_BUFFER_V(_f, _s, _v) \
VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f)))
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index a930bde..9addb60 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -523,6 +523,7 @@ typedef struct TestArray {
int32_t i32_1[VMSTATE_ARRAY_SIZE];
int32_t i32_2[VMSTATE_ARRAY_SIZE];
int64_t i64_1[VMSTATE_ARRAY_SIZE];
+ float64 f64_1[VMSTATE_ARRAY_SIZE];
} TestArray;
TestArray obj_array = {
@@ -540,6 +541,8 @@ TestArray obj_array = {
.i32_1 = {51, 52, 53, 54, 55},
.i32_2 = {55, 54, 53, 52, 51},
.i64_1 = {61, 62, 63, 64, 65},
+ .f64_1 = {float64_zero, float64_one, float64_ln2, float64_pi,
+ float64_infinity},
};
static const VMStateDescription vmstate_array_primitive = {
@@ -557,6 +560,7 @@ static const VMStateDescription vmstate_array_primitive = {
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_FLOAT64_ARRAY(f64_1, TestArray, VMSTATE_ARRAY_SIZE),
VMSTATE_END_OF_LIST()
}
};
@@ -583,6 +587,11 @@ uint8_t wire_array_primitive[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41,
+ /* f64_1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x3f, 0xe6, 0x2e, 0x42, 0xfe, 0xfa, 0x39, 0xef,
+ 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+ 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
};
@@ -608,6 +617,7 @@ static void obj_array_copy(void *arg1, void *arg2)
target->i32_1[i] = source->i32_1[i];
target->i32_2[i] = source->i32_2[i];
target->i64_1[i] = source->i64_1[i];
+ target->f64_1[i] = source->f64_1[i];
}
}
@@ -644,6 +654,7 @@ static void test_array_primitive(void)
ELEM_EQUAL(i16_1, i);
ELEM_EQUAL(i32_1, i);
ELEM_EQUAL(i64_1, i);
+ ELEM_EQUAL(f64_1, i);
}
}
--
1.9.0
- [Qemu-devel] [PATCH 035/124] vmstate: Move VMSTATE_TIMER_V to VMSTATE_TIMER_TEST, (continued)
- [Qemu-devel] [PATCH 035/124] vmstate: Move VMSTATE_TIMER_V to VMSTATE_TIMER_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 037/124] vmstate: Test for VMSTATE_UINT8_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 039/124] vmstate: Test for VMSTATE_UINT32_ARRAY{_TEST}, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 040/124] vmstate: Test for VMSTATE_UINT64_ARRAY{_TEST}, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 038/124] vmstate: Test for VMSTATE_UINT16_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 041/124] vmstate: Test for VMSTATE_INT16_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 042/124] vmstate: Test for VMSTATE_INT32_ARRAY{_TEST}, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 045/124] vmstate: Test for VMSTATE_UINT8_2DARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 043/124] vmstate: Test for VMSTATE_INT64_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 046/124] vmstate: Test for VMSTATE_UINT16_2DARRAY., Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 044/124] vmstate: Test for VMSTATE_FLOAT64_ARRAY,
Juan Quintela <=
- [Qemu-devel] [PATCH 047/124] vmstate: Test for VMSTATE_UINT32_2DARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 048/124] vmstate: Remove unused VMSTATE_BUFFER_V, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 049/124] vmstate: Remove version from VMSTATE_BUFFER_UNSAFE, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 050/124] vmstate: Remove unused version fields from ARM, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 051/124] vmstate: All ptimers users were at least at version 1 or more, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 053/124] vmstate: Port last 3 users of VMSTATE_ARRAY to VMSTATE_ARRAY_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 052/124] vmstate: Remove version from all variants of VMSTATE_STRUCT_POINTER*, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 054/124] vmstate: Port last user of VMSTATE_SINGLE to VMSTATE_SINGLE_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 055/124] vmstate: Remove unused VMSTATE_POINTER, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 057/124] vmstate: Move VMSTATE_2DARRAY to use _test, Juan Quintela, 2014/04/21