From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: afaerber@suse.de, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH v2 2/2] qdev-monitor-test: Don't test human-readable error message
Date: Thu, 6 Mar 2014 10:12:53 +0100 [thread overview]
Message-ID: <1394097173-14432-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1394097173-14432-1-git-send-email-armbru@redhat.com>
Test the error class instead. Expecting a specific message is
fragile. In fact, it broke once already, in commit 75884af. Restore
the test of error member "class" dropped there, and drop the test of
error member "desc".
There are no other tests of "desc" as far as I can tell.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/qdev-monitor-test.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tests/qdev-monitor-test.c b/tests/qdev-monitor-test.c
index eefaab8..e20ffd6 100644
--- a/tests/qdev-monitor-test.c
+++ b/tests/qdev-monitor-test.c
@@ -32,9 +32,7 @@ static void test_device_add(void)
"}}");
g_assert(response);
error = qdict_get_qdict(response, "error");
- g_assert_cmpstr(qdict_get_try_str(error, "desc"),
- ==,
- "Device needs media, but drive is empty");
+ g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, "GenericError");
QDECREF(response);
/* Delete the drive */
--
1.8.1.4
next prev parent reply other threads:[~2014-03-06 9:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 9:12 [Qemu-devel] [PATCH v2 0/2] qdev-monitor-test: Simplify & make more robust Markus Armbruster
2014-03-06 9:12 ` [Qemu-devel] [PATCH v2 1/2] qdev-monitor-test: simplify using g_assert_cmpstr() Markus Armbruster
2014-03-06 9:12 ` Markus Armbruster [this message]
2014-03-06 16:26 ` [Qemu-devel] [PATCH v2 0/2] qdev-monitor-test: Simplify & make more robust Eric Blake
2014-03-06 16:55 ` Stefan Hajnoczi
2014-03-06 19:16 ` Andreas Färber
2014-03-07 9:59 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394097173-14432-3-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=afaerber@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).