diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-10-11 10:43:37 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-10-11 10:43:37 +0100 |
commit | 75e50c80e051423a6f55a34ee4a1eec842444a5b (patch) | |
tree | bc52115bc7254051864a725f0d44f2f53511f8e9 /tests | |
parent | 53a19a9a5f9811a911e9b69ef36afb0d66b5d85c (diff) | |
parent | b266f1d1123396f9f5df865508f7555ab0c9582a (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2018-10-10' into staging
Miscellaneous patches for 2018-10-10
# gpg: Signature made Wed 10 Oct 2018 07:03:10 BST
# gpg: using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* remotes/armbru/tags/pull-misc-2018-10-10:
ivshmem: Fix unplug of device "ivshmem-plain"
libqtest: Inline g_assert_no_errno()
tests: Restore check-qdict unit test
qapi/misc.json: Remove superfluous words in CpuModelExpansionType
tests/check-qjson: fix a leak
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.include | 2 | ||||
-rw-r--r-- | tests/check-qdict.c | 2 | ||||
-rw-r--r-- | tests/check-qjson.c | 1 | ||||
-rw-r--r-- | tests/libqtest.c | 11 |
4 files changed, 7 insertions, 9 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include index 7a3059bf6c..8264af64a8 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -40,7 +40,7 @@ SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ check-unit-y = tests/check-qdict$(EXESUF) gcov-files-check-qdict-y = qobject/qdict.c -check-unit-y = tests/check-block-qdict$(EXESUF) +check-unit-y += tests/check-block-qdict$(EXESUF) gcov-files-check-block-qdict-y = qobject/block-qdict.c check-unit-y += tests/test-char$(EXESUF) gcov-files-check-qdict-y = chardev/char.c diff --git a/tests/check-qdict.c b/tests/check-qdict.c index 86e9fe7dc4..a1e8305066 100644 --- a/tests/check-qdict.c +++ b/tests/check-qdict.c @@ -12,6 +12,8 @@ #include "qemu/osdep.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qnum.h" +#include "qapi/qmp/qstring.h" /* * Public Interface test-cases diff --git a/tests/check-qjson.c b/tests/check-qjson.c index cc13f3d41e..d876a7a96e 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -780,6 +780,7 @@ static void utf8_string(void) if (!strstr(json_out, "\\uFFFD")) { str = from_json_str(json_out, j, &error_abort); g_assert_cmpstr(qstring_get_try_str(str), ==, utf8_in); + qobject_unref(str); } } } diff --git a/tests/libqtest.c b/tests/libqtest.c index 2cd5736642..44ce118cfc 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -48,10 +48,6 @@ struct QTestState static GHookList abrt_hooks; static struct sigaction sigact_old; -#define g_assert_no_errno(ret) do { \ - g_assert_cmpint(ret, !=, -1); \ -} while (0) - static int qtest_query_target_endianness(QTestState *s); static int init_socket(const char *socket_path) @@ -61,7 +57,7 @@ static int init_socket(const char *socket_path) int ret; sock = socket(PF_UNIX, SOCK_STREAM, 0); - g_assert_no_errno(sock); + g_assert_cmpint(sock, !=, -1); addr.sun_family = AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path); @@ -70,9 +66,9 @@ static int init_socket(const char *socket_path) do { ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr)); } while (ret == -1 && errno == EINTR); - g_assert_no_errno(ret); + g_assert_cmpint(ret, !=, -1); ret = listen(sock, 1); - g_assert_no_errno(ret); + g_assert_cmpint(ret, !=, -1); return sock; } @@ -325,7 +321,6 @@ static void socket_send(int fd, const char *buf, size_t size) continue; } - g_assert_no_errno(len); g_assert_cmpint(len, >, 0); offset += len; |