summaryrefslogtreecommitdiff
path: root/tests/libqtest.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2012-04-23 18:53:38 +0000
committerBlue Swirl <blauwirbel@gmail.com>2012-04-23 19:28:14 +0000
commitce6bf17a97aa53496a385db5642a323ce3b877a1 (patch)
tree9338641b31010dc69cbe4d22817b704a5718e7c3 /tests/libqtest.c
parentcb4c2548ea7cceef7260465773c6b8e634c186d4 (diff)
qtest: fix memread and memwrite on 32 bit hosts
Use PRIx64 to print 64 bit values to avoid truncation on 32 bit hosts. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r--tests/libqtest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index d47969eae5..1ce6fa10df 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -356,7 +356,7 @@ void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size)
gchar **args;
size_t i;
- qtest_sendf(s, "read 0x%x 0x%x\n", addr, size);
+ qtest_sendf(s, "read 0x%" PRIx64 " 0x%x\n", addr, size);
args = qtest_rsp(s, 2);
for (i = 0; i < size; i++) {
@@ -378,7 +378,7 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)
const uint8_t *ptr = data;
size_t i;
- qtest_sendf(s, "write 0x%x 0x%x 0x", addr, size);
+ qtest_sendf(s, "write 0x%" PRIx64 " 0x%x 0x", addr, size);
for (i = 0; i < size; i++) {
qtest_sendf(s, "%02x", ptr[i]);
}