diff options
author | Igor Mammedov <imammedo@redhat.com> | 2019-05-02 16:52:03 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-05-21 09:30:57 -0400 |
commit | ba02ff90ee1dcaf7aa5645075217e555ae2c54ea (patch) | |
tree | 6cb61c7ab16b26df9e788094a7569adea0e6026f /tests | |
parent | ae3c12a015522621931383f0ddbff8a6a00f7866 (diff) | |
download | qemu-ba02ff90ee1dcaf7aa5645075217e555ae2c54ea.zip qemu-ba02ff90ee1dcaf7aa5645075217e555ae2c54ea.tar.gz qemu-ba02ff90ee1dcaf7aa5645075217e555ae2c54ea.tar.bz2 |
tests: acpi: print error unable to dump ACPI table during rebuild
Instead of just asserting print the error that lead to assert first.
While at it move assert into rebuild branch, which removes redundant
check done in case of !rebuild branch is taken (the later is taken
care of by g_assert_no_error).
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1556808723-226478-16-git-send-email-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bios-tables-test.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 39c1e24..11e07be 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -195,11 +195,14 @@ static void dump_aml_files(test_data *data, bool rebuild) sdt->aml, ext); fd = g_open(aml_file, O_WRONLY|O_TRUNC|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); + if (fd < 0) { + perror(aml_file); + } + g_assert(fd >= 0); } else { fd = g_file_open_tmp("aml-XXXXXX", &sdt->aml_file, &error); g_assert_no_error(error); } - g_assert(fd >= 0); ret = qemu_write_full(fd, sdt->aml, sdt->aml_len); g_assert(ret == sdt->aml_len); |