mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 01:48:00 +02:00
signals: Add some missing assertions to inline unit tests
check_parse() can return NULL on OOM, which we might as well handle gracefully in the tests with an assertion, rather than an explosion. At least it will shut Coverity up. Coverity ID: 54724 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99643 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
2ab6913e79
commit
9f9b32dc5c
1 changed files with 3 additions and 0 deletions
|
|
@ -2562,7 +2562,9 @@ test_equality (void)
|
|||
_dbus_assert (second_str != NULL);
|
||||
_dbus_assert (strcmp (first_str, second_str) == 0);
|
||||
first_reparsed = check_parse (TRUE, first_str);
|
||||
_dbus_assert (first_reparsed != NULL);
|
||||
second_reparsed = check_parse (TRUE, second_str);
|
||||
_dbus_assert (second_reparsed != NULL);
|
||||
_dbus_assert (match_rule_equal (first, first_reparsed));
|
||||
_dbus_assert (match_rule_equal (second, second_reparsed));
|
||||
bus_match_rule_unref (first_reparsed);
|
||||
|
|
@ -2581,6 +2583,7 @@ test_equality (void)
|
|||
if (i != j)
|
||||
{
|
||||
second = check_parse (TRUE, equality_tests[j].second);
|
||||
_dbus_assert (second != NULL);
|
||||
|
||||
if (match_rule_equal (first, second))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue