aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-10-02 16:51:34 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-10-04 19:28:14 +0100
commit37e153fe45020c38229a113adc1eda05757e2c37 (patch)
tree0c72e59be1ea6a996c1bb1600c2b0aeaef4d2151 /tests
parente319df669da92f6ba56595e486637108256da08f (diff)
blockdev-test: Simplify by using g_assert_cmpstr()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1412261496-24455-5-git-send-email-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/drive_del-test.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c
index 32516a251c..80917ad86b 100644
--- a/tests/drive_del-test.c
+++ b/tests/drive_del-test.c
@@ -17,7 +17,6 @@
static void test_drive_without_dev(void)
{
QDict *response;
- const char *response_return;
/* Start with an empty drive */
qtest_start("-drive if=none,id=drive0");
@@ -28,9 +27,7 @@ static void test_drive_without_dev(void)
" 'command-line': 'drive_del drive0'"
"}}");
g_assert(response);
- response_return = qdict_get_try_str(response, "return");
- g_assert(response_return);
- g_assert(strcmp(response_return, "") == 0);
+ g_assert_cmpstr(qdict_get_try_str(response, "return"), ==, "");
QDECREF(response);
/* Ensure re-adding the drive works - there should be no duplicate ID error
@@ -41,9 +38,7 @@ static void test_drive_without_dev(void)
" 'command-line': 'drive_add 0 if=none,id=drive0'"
"}}");
g_assert(response);
- response_return = qdict_get_try_str(response, "return");
- g_assert(response_return);
- g_assert(strcmp(response_return, "OK\r\n") == 0);
+ g_assert_cmpstr(qdict_get_try_str(response, "return"), ==, "OK\r\n");
QDECREF(response);
qtest_end();