tests: Add missing assertion to guard against infinite loop

Since the loop variable changed signedness, it’s now possible for there
to be an infinite loop if `get_match_count()` returns an error. Guard
against that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Coverity CID: #1436405
This commit is contained in:
Philip Withnall 2020-11-17 10:38:12 +00:00
parent 065dea99f4
commit 51f322b74c

View File

@ -1316,6 +1316,7 @@ test_match_all (gconstpointer d)
g_assert (match_ok);
match_count = g_match_info_get_match_count (match_info);
g_assert_cmpint (match_count, >=, 0);
if (match_count != g_slist_length (data->expected))
{