summaryrefslogtreecommitdiff
path: root/tests/giomm_ioerror
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2014-09-17 13:03:36 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2014-09-17 19:19:14 +0800
commitd95bc55673127e8b70bfe40e634d79cd5812793d (patch)
treefdbd49a2074ed4bf576068b6f9d39e5a05973d64 /tests/giomm_ioerror
parent4f448748cc0413a7f6d4d44121fb04a8723f4d59 (diff)
downloadglibmm-d95bc55673127e8b70bfe40e634d79cd5812793d.tar.gz
Make giomm tests Run Under Windows
/etc/fstab is a *nix only file, which would not normally exist under Windows unless one is under Cygwin. Use the path for the Wordpad application on Windows, which is a standard part of Windows; and use /etc/fstab otherwise. * tests/giomm_ioerror/main.cc: * tests/giomm_simple/main.cc: Test for c:/windows/write.exe (Wordpad application) on Windows, and use /etc/fstab otherwise. https://bugzilla.gnome.org/show_bug.cgi?id=736778 https://bugzilla.gnome.org/show_bug.cgi?id=736778
Diffstat (limited to 'tests/giomm_ioerror')
-rw-r--r--tests/giomm_ioerror/main.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/giomm_ioerror/main.cc b/tests/giomm_ioerror/main.cc
index 0a44d330..ae51ec21 100644
--- a/tests/giomm_ioerror/main.cc
+++ b/tests/giomm_ioerror/main.cc
@@ -21,6 +21,12 @@ std::ostream& ostr = debug;
#error Forgot to #undef GIOMM_SAVED_HOST_NOT_FOUND
#endif
+#ifdef G_OS_WIN32
+#define TEST_FILE "c:/windows/write.exe"
+#else
+#define TEST_FILE "/etc/fstab"
+#endif
+
int main(int, char**)
{
Glib::init();
@@ -28,7 +34,7 @@ int main(int, char**)
try
{
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_path("/etc/fstab");
+ Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(TEST_FILE);
if(!file)
{
std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl;