Merge branch 'wip/3v1n0/clang-warning-fixes' into 'main'

tests: Fix few new clang warnings

See merge request GNOME/glib!3013
This commit is contained in:
Philip Withnall 2022-10-25 16:04:10 +00:00
commit e562c3b8a3
2 changed files with 8 additions and 6 deletions

View File

@ -122,7 +122,7 @@ check_integrity (SequenceInfo *info)
{
GList *list;
GSequenceIter *iter;
int i;
unsigned int i;
g_sequence_check (info->sequence);
@ -149,6 +149,7 @@ check_integrity (SequenceInfo *info)
i++;
}
g_assert_cmpuint (i, ==, info->n_items);
g_assert (info->n_items == g_queue_get_length (info->queue));
g_assert ((guint) g_sequence_get_length (info->sequence) == info->n_items);
}

View File

@ -2593,20 +2593,21 @@ static void
test_set_str (void)
{
char *str = NULL;
const char *empty_str = "";
g_assert_false (g_set_str (&str, NULL));
g_assert_null (str);
g_assert_true (g_set_str (&str, ""));
g_assert_false (g_set_str (&str, ""));
g_assert_true (g_set_str (&str, empty_str));
g_assert_false (g_set_str (&str, empty_str));
g_assert_nonnull (str);
g_assert_true ((gpointer)str != (gpointer)"");
g_assert_cmpstr (str, ==, "");
g_assert_true ((gpointer)str != (gpointer)empty_str);
g_assert_cmpstr (str, ==, empty_str);
g_assert_true (g_set_str (&str, NULL));
g_assert_null (str);
g_assert_true (g_set_str (&str, ""));
g_assert_true (g_set_str (&str, empty_str));
g_assert_true (g_set_str (&str, "test"));
g_assert_cmpstr (str, ==, "test");