aboutsummaryrefslogtreecommitdiff
path: root/tests/test-char.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2019-02-11 18:24:33 +0000
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-02-12 17:35:56 +0100
commit0bf62dc89ecb43f2fb0850f938d692024eb8ec52 (patch)
treeec98267be69ee240a61944e030373c016b3fc255 /tests/test-char.c
parent5981c3a2326a1eb758bd6b950c1471e19f77d3f0 (diff)
downloadqemu-0bf62dc89ecb43f2fb0850f938d692024eb8ec52.zip
qemu-0bf62dc89ecb43f2fb0850f938d692024eb8ec52.tar.gz
qemu-0bf62dc89ecb43f2fb0850f938d692024eb8ec52.tar.bz2
chardev: ensure qemu_chr_parse_compat reports missing driver error
If no valid char driver was identified the qemu_chr_parse_compat method was silent, leaving callers no clue what failed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20190211182442.8542-8-berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'tests/test-char.c')
-rw-r--r--tests/test-char.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test-char.c b/tests/test-char.c
index 018e2ee..45203f5 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -932,9 +932,10 @@ static void char_null_test(void)
static void char_invalid_test(void)
{
Chardev *chr;
-
+ g_setenv("QTEST_SILENT_ERRORS", "1", 1);
chr = qemu_chr_new("label-invalid", "invalid");
g_assert_null(chr);
+ g_unsetenv("QTEST_SILENT_ERRORS");
}
static int chardev_change(void *opaque)