summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTarnyko <tarnyko@tarnyko.net>2014-06-01 21:15:11 +0200
committerMilan Crha <mcrha@redhat.com>2014-06-01 21:15:11 +0200
commit9a10ad81dc3cebaa48d305939d193e397fdeb00a (patch)
tree2c195f77aaae1fbc2c592c3baca13a437ddc4b21 /tests
parent29069bce08f9986096710cc502584bb073064efe (diff)
downloadevolution-data-server-9a10ad81dc3cebaa48d305939d193e397fdeb00a.tar.gz
Bug 721128 - Make Evolution-Data-Server build under Win32
Diffstat (limited to 'tests')
-rw-r--r--tests/libedataserver/e-source-test.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/libedataserver/e-source-test.c b/tests/libedataserver/e-source-test.c
index 0f17a6612..a8b11fcf8 100644
--- a/tests/libedataserver/e-source-test.c
+++ b/tests/libedataserver/e-source-test.c
@@ -16,10 +16,13 @@
*/
#include <string.h>
-#include <gio/gunixoutputstream.h>
#include <libedataserver/libedataserver.h>
+#ifndef G_OS_WIN32
+#include <gio/gunixoutputstream.h>
+#endif
+
#define SIMPLE_KEY_FILE \
"[Data Source]\n" \
"DisplayName=Simple Test Case\n" \
@@ -53,7 +56,9 @@ static void
setup_test_source (TestESource *test,
const gchar *content)
{
+#ifndef G_OS_WIN32
GOutputStream *stream;
+#endif
gchar *filename;
gint fd;
GError *error = NULL;
@@ -63,11 +68,16 @@ setup_test_source (TestESource *test,
g_assert_no_error (error);
/* Write the given content to the temporary key file. */
+#ifdef G_OS_WIN32
+ close (fd);
+ g_file_set_contents (filename, content, strlen (content), &error);
+#else
stream = g_unix_output_stream_new (fd, TRUE);
g_output_stream_write_all (
stream, content, strlen (content), NULL, NULL, &error);
g_object_unref (stream);
g_assert_no_error (error);
+#endif
/* Create a GFile that points to the temporary key file. */
test->file = g_file_new_for_path (filename);