summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps-util.c
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2006-12-13 01:18:07 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2006-12-13 01:18:07 +0000
commit610a1786da5feb88b9cd8712e8b37d1f9f3b75b9 (patch)
tree5c0e18910c18cd4d0faae2f424bdb61a9ae642f4 /dbus/dbus-sysdeps-util.c
parentf2e17db66f2e07e165fc90bba030a9f1d430834b (diff)
2006-12-13 Ralf Habacker <ralf.habacker@freenet.de>
* dbus-sysdeps-util.c (_dbus_sysdeps_test): added win32 related tests.
Diffstat (limited to 'dbus/dbus-sysdeps-util.c')
-rw-r--r--dbus/dbus-sysdeps-util.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/dbus/dbus-sysdeps-util.c b/dbus/dbus-sysdeps-util.c
index 698b893e..37f2c13a 100644
--- a/dbus/dbus-sysdeps-util.c
+++ b/dbus/dbus-sysdeps-util.c
@@ -81,7 +81,28 @@ _dbus_sysdeps_test (void)
DBusString str;
double val;
int pos;
-
+
+#ifdef DBUS_WIN
+ check_dirname ("foo\\bar", "foo");
+ check_dirname ("foo\\\\bar", "foo");
+ check_dirname ("foo/\\/bar", "foo");
+ check_dirname ("foo\\bar/", "foo");
+ check_dirname ("foo//bar\\", "foo");
+ check_dirname ("foo\\bar/", "foo");
+ check_dirname ("foo/bar\\\\", "foo");
+ check_dirname ("\\foo", "\\");
+ check_dirname ("\\\\foo", "\\");
+ check_dirname ("\\", "\\");
+ check_dirname ("\\\\", "\\");
+ check_dirname ("\\/", "\\");
+ check_dirname ("/\\/", "/");
+ check_dirname ("c:\\foo\\bar", "c:\\foo");
+ check_dirname ("c:\\foo", "c:\\");
+ check_dirname ("c:/foo", "c:/");
+ check_dirname ("c:\\", "c:\\");
+ check_dirname ("c:/", "c:/");
+ check_dirname ("", ".");
+#else
check_dirname ("foo", ".");
check_dirname ("foo/bar", "foo");
check_dirname ("foo//bar", "foo");
@@ -100,7 +121,7 @@ _dbus_sysdeps_test (void)
check_dirname ("/", "/");
check_dirname ("///", "/");
check_dirname ("", ".");
-
+#endif
_dbus_string_init_const (&str, "3.5");
if (!_dbus_string_parse_double (&str,
@@ -137,12 +158,27 @@ _dbus_sysdeps_test (void)
_dbus_warn ("_dbus_string_parse_double of \"0xff\" returned wrong position %d", pos);
exit (1);
}
-
+#ifdef DBUS_WIN
+ check_path_absolute ("c:/", TRUE);
+ check_path_absolute ("c:/foo", TRUE);
+ check_path_absolute ("", FALSE);
+ check_path_absolute ("foo", FALSE);
+ check_path_absolute ("foo/bar", FALSE);
+ check_path_absolute ("", FALSE);
+ check_path_absolute ("foo\\bar", FALSE);
+ check_path_absolute ("c:\\", TRUE);
+ check_path_absolute ("c:\\foo", TRUE);
+ check_path_absolute ("c:", TRUE);
+ check_path_absolute ("c:\\foo\\bar", TRUE);
+ check_path_absolute ("\\", TRUE);
+ check_path_absolute ("/", TRUE);
+#else
check_path_absolute ("/", TRUE);
check_path_absolute ("/foo", TRUE);
check_path_absolute ("", FALSE);
check_path_absolute ("foo", FALSE);
check_path_absolute ("foo/bar", FALSE);
+#endif
return TRUE;
}