tests/qdict: check more get_try_int() cases
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170607163635.17635-42-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
ad664c1d4c
commit
269c20b2bb
@ -108,10 +108,17 @@ static void qdict_get_try_int_test(void)
|
||||
QDict *tests_dict = qdict_new();
|
||||
|
||||
qdict_put_int(tests_dict, key, value);
|
||||
qdict_put_str(tests_dict, "string", "test");
|
||||
|
||||
ret = qdict_get_try_int(tests_dict, key, 0);
|
||||
g_assert(ret == value);
|
||||
|
||||
ret = qdict_get_try_int(tests_dict, "missing", -42);
|
||||
g_assert_cmpuint(ret, ==, -42);
|
||||
|
||||
ret = qdict_get_try_int(tests_dict, "string", -42);
|
||||
g_assert_cmpuint(ret, ==, -42);
|
||||
|
||||
QDECREF(tests_dict);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user