diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-02-12 13:00:03 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-02-12 13:00:03 +0000 |
commit | 8e3fb8029efaf220ab48290cdb5151c682227030 (patch) | |
tree | 6ac74cba11eb36e6b87dd51b4f9b406a0ad1baae /tests | |
parent | 019bb9ac98f51c3ce362978c6e0c82d853762aa0 (diff) | |
parent | d40d74a645feea0ad01482da2358804f6574dce0 (diff) |
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
trivial patches for 2018-02-10
# gpg: Signature made Sat 10 Feb 2018 07:54:03 GMT
# gpg: using RSA key 701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg: aka "Michael Tokarev <mjt@corpit.ru>"
# gpg: aka "Michael Tokarev <mjt@debian.org>"
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5
# Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59
* remotes/mjt/tags/trivial-patches-fetch:
tests/qapi: use ARRAY_SIZE macro
tests/qapi: use QEMU_IS_ALIGNED macro
tests/hbitmap: use ARRAY_SIZE macro
async: use ARRAY_SIZE macro
qga: use ARRAY_SIZE macro
MAINTAINERS: Add qemu-binfmt-conf.sh script
oslib-posix: check for posix_memalign in configure script
maint: Mention web site maintenance in README
build: fix typo in error message
configure: Allow capstone=git only if git update is not disabled
scripts/make-release: Don't archive .git files
qemu-options.hx: Remove confusing spaces in parameter listings
mailmap: set preferred spelling for Daniel Berrangé
Drop unneeded system header includes
machine: Polish -machine xxx,help
scripts/argparse.py: spelling (independant)
qapi-schema.json: spelling (independant comparation)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-hbitmap.c | 6 | ||||
-rw-r--r-- | tests/test-qobject-output-visitor.c | 2 | ||||
-rw-r--r-- | tests/test-string-output-visitor.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index 9091c639b3..f29631f939 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hbitmap.c @@ -813,7 +813,7 @@ static void test_hbitmap_serialize_basic(TestHBitmapData *data, size_t buf_size; uint8_t *buf; uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 }; - int num_positions = sizeof(positions) / sizeof(positions[0]); + int num_positions = ARRAY_SIZE(positions); hbitmap_test_init(data, L3, 0); g_assert(hbitmap_is_serializable(data->hb)); @@ -838,7 +838,7 @@ static void test_hbitmap_serialize_part(TestHBitmapData *data, size_t buf_size; uint8_t *buf; uint64_t positions[] = { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - 1 }; - int num_positions = sizeof(positions) / sizeof(positions[0]); + int num_positions = ARRAY_SIZE(positions); hbitmap_test_init(data, L3, 0); buf_size = L2; @@ -880,7 +880,7 @@ static void test_hbitmap_serialize_zeroes(TestHBitmapData *data, int64_t next; uint64_t min_l1 = MAX(L1, 64); uint64_t positions[] = { 0, min_l1, L2, L3 - min_l1}; - int num_positions = sizeof(positions) / sizeof(positions[0]); + int num_positions = ARRAY_SIZE(positions); hbitmap_test_init(data, L3, 0); diff --git a/tests/test-qobject-output-visitor.c b/tests/test-qobject-output-visitor.c index 3cf942414c..11e8c5aa40 100644 --- a/tests/test-qobject-output-visitor.c +++ b/tests/test-qobject-output-visitor.c @@ -572,7 +572,7 @@ static void init_native_list(UserDefNativeListUnion *cvalue) boolList **list = &cvalue->u.boolean.data; for (i = 0; i < 32; i++) { *list = g_new0(boolList, 1); - (*list)->value = (i % 3 == 0); + (*list)->value = QEMU_IS_ALIGNED(i, 3); (*list)->next = NULL; list = &(*list)->next; } diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c index fa4b4ca288..02766c0f65 100644 --- a/tests/test-string-output-visitor.c +++ b/tests/test-string-output-visitor.c @@ -95,7 +95,7 @@ static void test_visitor_out_intList(TestOutputVisitorData *data, Error *err = NULL; char *str; - for (i = 0; i < sizeof(value) / sizeof(value[0]); i++) { + for (i = 0; i < ARRAY_SIZE(value); i++) { *tmp = g_malloc0(sizeof(**tmp)); (*tmp)->value = value[i]; tmp = &(*tmp)->next; |