diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-12-06 09:49:51 +0000 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-12-06 09:49:51 +0000 |
commit | 8a844b2603c05aa3ce0739b44a83696820774d31 (patch) | |
tree | 9a55ddee56cd15f5a4a00160a69c155f31adbf0f /tests | |
parent | e24f095e44c57a19717319ef3510f812c7a43d0e (diff) | |
parent | 5072f7b38b1b9b26b8fbe1a89086386a420aded8 (diff) | |
download | qemu-8a844b2603c05aa3ce0739b44a83696820774d31.zip qemu-8a844b2603c05aa3ce0739b44a83696820774d31.tar.gz qemu-8a844b2603c05aa3ce0739b44a83696820774d31.tar.bz2 |
Merge remote-tracking branch 'armbru/tags/pull-qapi-2016-12-05' into staging
QAPI patches for 2016-12-05
# gpg: Signature made Mon 05 Dec 2016 04:41:53 PM GMT
# gpg: using RSA key 0x3870B400EB918653
# 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
* armbru/tags/pull-qapi-2016-12-05:
qapi: add missing colon-ending for section name
qapi: use one symbol per line
qapi: fix various symbols mismatch in documentation
qapi: fix missing symbol @prefix
qapi: fix schema symbol sections
qga/schema: fix double-return in doc
tests: Avoid qobject_from_jsonf("%"PRId64)
test-qga: Avoid qobject_from_jsonv("%"PRId64)
qmp-event: Avoid qobject_from_jsonf("%"PRId64)
Message-id: 1480956313-31322-1-git-send-email-armbru@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check-qjson.c | 6 | ||||
-rw-r--r-- | tests/test-qga.c | 7 | ||||
-rw-r--r-- | tests/test-qobject-input-visitor.c | 5 |
3 files changed, 11 insertions, 7 deletions
diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 8595574..0b21a22 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -964,7 +964,7 @@ static void vararg_number(void) QInt *qint; QFloat *qfloat; int value = 0x2342; - int64_t value64 = 0x2342342343LL; + long long value_ll = 0x2342342343LL; double valuef = 2.323423423; obj = qobject_from_jsonf("%d", value); @@ -976,12 +976,12 @@ static void vararg_number(void) QDECREF(qint); - obj = qobject_from_jsonf("%" PRId64, value64); + obj = qobject_from_jsonf("%lld", value_ll); g_assert(obj != NULL); g_assert(qobject_type(obj) == QTYPE_QINT); qint = qobject_to_qint(obj); - g_assert(qint_get_int(qint) == value64); + g_assert(qint_get_int(qint) == value_ll); QDECREF(qint); diff --git a/tests/test-qga.c b/tests/test-qga.c index 40af649..868b02a 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -837,6 +837,7 @@ static void test_qga_guest_exec(gconstpointer fix) int64_t pid, now, exitcode; gsize len; bool exited; + char *cmd; /* exec 'echo foo bar' */ ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {" @@ -851,9 +852,10 @@ static void test_qga_guest_exec(gconstpointer fix) /* wait for completion */ now = g_get_monotonic_time(); + cmd = g_strdup_printf("{'execute': 'guest-exec-status'," + " 'arguments': { 'pid': %" PRId64 " } }", pid); do { - ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec-status'," - " 'arguments': { 'pid': %" PRId64 " } }", pid); + ret = qmp_fd(fixture->fd, cmd); g_assert_nonnull(ret); val = qdict_get_qdict(ret, "return"); exited = qdict_get_bool(val, "exited"); @@ -863,6 +865,7 @@ static void test_qga_guest_exec(gconstpointer fix) } while (!exited && g_get_monotonic_time() < now + 5 * G_TIME_SPAN_SECOND); g_assert(exited); + g_free(cmd); /* check stdout */ exitcode = qdict_get_int(val, "exitcode"); diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-visitor.c index 26c5012..945404a 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -83,10 +83,11 @@ static Visitor *visitor_input_test_init_raw(TestInputVisitorData *data, static void test_visitor_in_int(TestInputVisitorData *data, const void *unused) { - int64_t res = 0, value = -42; + int64_t res = 0; + int value = -42; Visitor *v; - v = visitor_input_test_init(data, "%" PRId64, value); + v = visitor_input_test_init(data, "%d", value); visit_type_int(v, NULL, &res, &error_abort); g_assert_cmpint(res, ==, value); |