mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 10:26:16 +01:00
Merge branch 'test-skip-fix-win32' into 'main'
tests: Use g_test_skip() to skip a test on Windows See merge request GNOME/glib!2484
This commit is contained in:
commit
cfd245bc78
@ -1452,11 +1452,11 @@ test_set_contents_full_read_only_file (void)
|
|||||||
g_free (file_name);
|
g_free (file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
|
||||||
/* windows mostly ignores read-only flagged directoy, chmod doesn't work */
|
|
||||||
static void
|
static void
|
||||||
test_set_contents_full_read_only_directory (void)
|
test_set_contents_full_read_only_directory (void)
|
||||||
{
|
{
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
|
/* windows mostly ignores read-only flagged directories, chmod doesn't work */
|
||||||
GFileSetContentsFlags flags_mask =
|
GFileSetContentsFlags flags_mask =
|
||||||
G_FILE_SET_CONTENTS_ONLY_EXISTING |
|
G_FILE_SET_CONTENTS_ONLY_EXISTING |
|
||||||
G_FILE_SET_CONTENTS_DURABLE |
|
G_FILE_SET_CONTENTS_DURABLE |
|
||||||
@ -1510,8 +1510,10 @@ test_set_contents_full_read_only_directory (void)
|
|||||||
g_free (file_name);
|
g_free (file_name);
|
||||||
g_free (dir_name);
|
g_free (dir_name);
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
|
g_test_skip ("Windows doesn’t support read-only directories in the same way as Unix");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_read_link (void)
|
test_read_link (void)
|
||||||
@ -2161,9 +2163,7 @@ main (int argc,
|
|||||||
g_test_add_func ("/fileutils/set-contents", test_set_contents);
|
g_test_add_func ("/fileutils/set-contents", test_set_contents);
|
||||||
g_test_add_func ("/fileutils/set-contents-full", test_set_contents_full);
|
g_test_add_func ("/fileutils/set-contents-full", test_set_contents_full);
|
||||||
g_test_add_func ("/fileutils/set-contents-full/read-only-file", test_set_contents_full_read_only_file);
|
g_test_add_func ("/fileutils/set-contents-full/read-only-file", test_set_contents_full_read_only_file);
|
||||||
#ifndef G_OS_WIN32
|
|
||||||
g_test_add_func ("/fileutils/set-contents-full/read-only-directory", test_set_contents_full_read_only_directory);
|
g_test_add_func ("/fileutils/set-contents-full/read-only-directory", test_set_contents_full_read_only_directory);
|
||||||
#endif
|
|
||||||
g_test_add_func ("/fileutils/read-link", test_read_link);
|
g_test_add_func ("/fileutils/read-link", test_read_link);
|
||||||
g_test_add_func ("/fileutils/stdio-wrappers", test_stdio_wrappers);
|
g_test_add_func ("/fileutils/stdio-wrappers", test_stdio_wrappers);
|
||||||
g_test_add_func ("/fileutils/fopen-modes", test_fopen_modes);
|
g_test_add_func ("/fileutils/fopen-modes", test_fopen_modes);
|
||||||
|
@ -2970,10 +2970,10 @@ test_new_offset (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
|
||||||
static void
|
static void
|
||||||
test_time_zone_parse_rfc8536 (void)
|
test_time_zone_parse_rfc8536 (void)
|
||||||
{
|
{
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
const gchar *test_files[] =
|
const gchar *test_files[] =
|
||||||
{
|
{
|
||||||
/* Generated with `zic -b slim`; see
|
/* Generated with `zic -b slim`; see
|
||||||
@ -2999,8 +2999,10 @@ test_time_zone_parse_rfc8536 (void)
|
|||||||
g_time_zone_unref (tz);
|
g_time_zone_unref (tz);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
|
g_test_skip ("RFC 8536 format time zone files are not available on Windows");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Check GTimeZone instances are cached. */
|
/* Check GTimeZone instances are cached. */
|
||||||
static void
|
static void
|
||||||
@ -3152,9 +3154,7 @@ main (gint argc,
|
|||||||
g_test_add_func ("/GTimeZone/floating-point", test_GDateTime_floating_point);
|
g_test_add_func ("/GTimeZone/floating-point", test_GDateTime_floating_point);
|
||||||
g_test_add_func ("/GTimeZone/identifier", test_identifier);
|
g_test_add_func ("/GTimeZone/identifier", test_identifier);
|
||||||
g_test_add_func ("/GTimeZone/new-offset", test_new_offset);
|
g_test_add_func ("/GTimeZone/new-offset", test_new_offset);
|
||||||
#ifndef G_OS_WIN32
|
|
||||||
g_test_add_func ("/GTimeZone/parse-rfc8536", test_time_zone_parse_rfc8536);
|
g_test_add_func ("/GTimeZone/parse-rfc8536", test_time_zone_parse_rfc8536);
|
||||||
#endif
|
|
||||||
g_test_add_func ("/GTimeZone/caching", test_time_zone_caching);
|
g_test_add_func ("/GTimeZone/caching", test_time_zone_caching);
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
|
Loading…
Reference in New Issue
Block a user