diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-06-05 15:28:12 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-06-05 15:28:12 +0100 |
commit | 199e19ee538eb61fd08b1c1ee5aa838ebdcc968e (patch) | |
tree | 2d2bfa6513c3d6bfd82e8e1e37e0db4941b19788 /tests | |
parent | cb8b8ef4578dc17c350fd4b27700a9f178e2dad0 (diff) | |
parent | 03e947f9c2264356aef037e6bf9c496b5deae2d2 (diff) | |
download | qemu-199e19ee538eb61fd08b1c1ee5aa838ebdcc968e.zip |
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
trivial patches for 2017-06-05
# gpg: Signature made Mon 05 Jun 2017 15:23:46 BST
# gpg: using RSA key 0x701B4F6B1A693E59
# 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: (21 commits)
hw/core: nmi.c can be compiled as common-obj nowadays
dump: fix memory_mapping_filter leak
ide-test: check return of fwrite
help: Add newline to end of thread option help text
qemu-ga: remove useless allocation
scsi/lsi53c895a: Remove unused lsi_mem_*() return value
qapi: Fix some QMP documentation regressions
hw/mips: add missing include
register: display register prefix (name) since it is available
hw/sparc: use ARRAY_SIZE() macro
hw/xtensa: sim: use g_string/g_new
target/arm: add data cache invalidation cp15 instruction to cortex-r5
block: Correct documentation for BLOCK_WRITE_THRESHOLD
trivial: Remove unneeded ifndef in memory.h
altera_timer: fix incorrect memset
configure: Detect native NetBSD curses(3)
tests/libqtest: Print error instead of aborting when env variable is missing
docs/qdev-device-use.txt: update section Default Devices
docs qemu-doc: Avoid ide-drive, it's deprecated
qemu-doc: Add hyperlinks to further license information
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ide-test.c | 8 | ||||
-rw-r--r-- | tests/libqtest.c | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/ide-test.c b/tests/ide-test.c index 139ebc0ec6..bfd79ddbdc 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -796,11 +796,13 @@ static void cdrom_pio_impl(int nblocks) int i, j; uint8_t data; uint16_t limit; + size_t ret; /* Prepopulate the CDROM with an interesting pattern */ generate_pattern(pattern, patt_len, ATAPI_BLOCK_SIZE); fh = fopen(tmp_path, "w+"); - fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh); + ret = fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh); + g_assert_cmpint(ret, ==, patt_blocks); fclose(fh); ide_test_start("-drive if=none,file=%s,media=cdrom,format=raw,id=sr0,index=0 " @@ -880,6 +882,7 @@ static void test_cdrom_pio_large(void) static void test_cdrom_dma(void) { static const size_t len = ATAPI_BLOCK_SIZE; + size_t ret; char *pattern = g_malloc(ATAPI_BLOCK_SIZE * 16); char *rx = g_malloc0(len); uintptr_t guest_buf; @@ -896,7 +899,8 @@ static void test_cdrom_dma(void) generate_pattern(pattern, ATAPI_BLOCK_SIZE * 16, ATAPI_BLOCK_SIZE); fh = fopen(tmp_path, "w+"); - fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh); + ret = fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh); + g_assert_cmpint(ret, ==, 16); fclose(fh); send_dma_request(CMD_PACKET, 0, 1, prdt, 1, send_scsi_cdb_read10); diff --git a/tests/libqtest.c b/tests/libqtest.c index 84ecbd2bd8..4a5492a603 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -160,7 +160,10 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args) const char *qemu_binary; qemu_binary = getenv("QTEST_QEMU_BINARY"); - g_assert(qemu_binary != NULL); + if (!qemu_binary) { + fprintf(stderr, "Environment variable QTEST_QEMU_BINARY required\n"); + exit(1); + } s = g_malloc(sizeof(*s)); |