Merge branch 'macos-testfilemonitor-fix' into 'main'

testfilemonitor: treat `CHANGES_DONE_HINT` as optional when events don’t match

Closes #1181

See merge request GNOME/glib!4905
This commit is contained in:
Philip Withnall
2025-11-20 13:25:47 +00:00
2 changed files with 11 additions and 2 deletions

View File

@@ -139,8 +139,6 @@ gio_tests = {
'glistmodel' : {},
'testfilemonitor' : {
'suite' : ['slow'],
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
'can_fail' : host_system in ['darwin'],
},
'thumbnail-verification' : {},
'tls-certificate' : {'extra_sources' : ['gtesttlsbackend.c']},

View File

@@ -237,6 +237,17 @@ check_expected_events (RecordedEvent *expected,
li++, l = l->next;
continue;
}
/* The ordering of 'CHANGES_DONE_HINT' can not be guaranteed
* so treat it as optional. */
else if (e1->event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT &&
e2->event_type != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT)
{
g_test_message ("Skipping expected 'CHANGES_DONE_HINT' "
"at index %" G_GSIZE_FORMAT,
i);
i++;
continue;
}
/* If an event is marked as optional in the current environment and
* the event doesn't match, it means the expected event has lost. */
else if (env & e1->optional)