summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2019-02-13 10:40:11 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2019-02-13 10:40:11 +0000
commitc5c9b29b9d1f2d35017c17b12fc81f6da3816ced (patch)
treed1abc777ad5e546debe1f9daa10414a678df5717 /tests
parent0f26836d733cfcd9a850197c34dcc9b287f0762d (diff)
parent1e74b5872e555ee1aee6fa623d200ebb9654d62d (diff)
downloadglib-c5c9b29b9d1f2d35017c17b12fc81f6da3816ced.tar.gz
Merge branch 'w32-testsuite-fixes-general' into 'master'
General fixes to W32 test suite Closes #875 See merge request GNOME/glib!665
Diffstat (limited to 'tests')
-rw-r--r--tests/testgdate.c5
-rw-r--r--tests/testglib.c22
2 files changed, 23 insertions, 4 deletions
diff --git a/tests/testgdate.c b/tests/testgdate.c
index a8ec4cfe8..18022bc74 100644
--- a/tests/testgdate.c
+++ b/tests/testgdate.c
@@ -133,10 +133,13 @@ int main(int argc, char** argv)
g_date_set_julian(d, 1);
TEST("GDate's \"Julian\" epoch's first day is valid", g_date_valid(d));
+#ifndef G_OS_WIN32
g_date_strftime(buf,100,"Our \"Julian\" epoch begins on a %A, in the month of %B, %x\n",
d);
g_print("%s", buf);
-
+#else
+ g_print ("But Windows FILETIME does not support dates before Jan 1 1601, so we can't strftime() the beginning of the \"Julian\" epoch.\n");
+#endif
g_date_set_dmy(d, 10, 1, 2000);
g_date_strftime(buf,100,"%x", d);
diff --git a/tests/testglib.c b/tests/testglib.c
index f29bbc664..687fadd5b 100644
--- a/tests/testglib.c
+++ b/tests/testglib.c
@@ -843,6 +843,7 @@ test_paths (void)
gchar *relative_path;
gchar *canonical_path;
} canonicalize_filename_checks[] = {
+#ifndef G_OS_WIN32
{ "/etc", "../usr/share", "/usr/share" },
{ "/", "/foo/bar", "/foo/bar" },
{ "/usr/bin", "../../foo/bar", "/foo/bar" },
@@ -857,7 +858,22 @@ test_paths (void)
{ "///triple/slash", ".", "/triple/slash" },
{ "//double/slash", ".", "//double/slash" },
{ "/cwd/../with/./complexities/", "./hello", "/with/complexities/hello" },
-#ifdef G_OS_WIN32
+#else
+ { "/etc", "../usr/share", "\\usr\\share" },
+ { "/", "/foo/bar", "\\foo\\bar" },
+ { "/usr/bin", "../../foo/bar", "\\foo\\bar" },
+ { "/", "../../foo/bar", "\\foo\\bar" },
+ { "/double//dash", "../../foo/bar", "\\foo\\bar" },
+ { "/usr/share/foo", ".././././bar", "\\usr\\share\\bar" },
+ { "/foo/bar", "../bar/./.././bar", "\\foo\\bar" },
+ { "/test///dir", "../../././foo/bar", "\\foo\\bar" },
+ { "/test///dir", "../../././/foo///bar", "\\foo\\bar" },
+ { "/etc", "///triple/slash", "\\triple\\slash" },
+ { "/etc", "//double/slash", "//double/slash" },
+ { "///triple/slash", ".", "\\triple\\slash" },
+ { "//double/slash", ".", "//double/slash\\" },
+ { "/cwd/../with/./complexities/", "./hello", "\\with\\complexities\\hello" },
+
{ "\\etc", "..\\usr\\share", "\\usr\\share" },
{ "\\", "\\foo\\bar", "\\foo\\bar" },
{ "\\usr\\bin", "..\\..\\foo\\bar", "\\foo\\bar" },
@@ -870,8 +886,8 @@ test_paths (void)
{ "\\etc", "\\\\\\triple\\slash", "\\triple\\slash" },
{ "\\etc", "\\\\double\\slash", "\\\\double\\slash" },
{ "\\\\\\triple\\slash", ".", "\\triple\\slash" },
- { "\\\\double\\slash", ".", "\\\\double\\slash" },
- { "\\cwd\\..\\with\\.\\complexities\\", ".\\hello", "\\cwd\\with\\complexities\\hello" },
+ { "\\\\double\\slash", ".", "\\\\double\\slash\\" },
+ { "\\cwd\\..\\with\\.\\complexities\\", ".\\hello", "\\with\\complexities\\hello" },
#endif
};
const guint n_canonicalize_filename_checks = G_N_ELEMENTS (canonicalize_filename_checks);