tests: skip g-file-info test if atime unsupported

For example, g_file_query_info will not be able to determine access
time for files on ZFS with atime=off.
This commit is contained in:
Alyssa Ross 2022-09-14 09:03:24 +00:00
parent 1dfdcaf38b
commit 7162b3c496
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -282,6 +282,15 @@ test_g_file_info_access_time (void)
NULL, &error); NULL, &error);
g_assert_no_error (error); g_assert_no_error (error);
if (!g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_ACCESS))
{
g_test_skip ("Skipping testing access time as its not supported by the kernel");
g_file_delete (file, NULL, NULL);
g_clear_object (&file);
g_clear_object (&info);
return;
}
/* Check the access time is retrievable. */ /* Check the access time is retrievable. */
dt = g_file_info_get_access_date_time (info); dt = g_file_info_get_access_date_time (info);
g_assert_nonnull (dt); g_assert_nonnull (dt);