- testing for getcwd on windows
authorSree Harsha Totakura <totakura@in.tum.de>
Mon, 16 Sep 2013 12:31:08 +0000 (12:31 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Mon, 16 Sep 2013 12:31:08 +0000 (12:31 +0000)
src/testbed/Makefile.am
src/testbed/test_getcwd.c [new file with mode: 0644]

index 31738814d0661955f2f1c3540cb0931282a5017b..7b1e73fb7bd7fc2857fdb42503f6aa08831f4b48 100644 (file)
@@ -39,8 +39,8 @@ CLEANFILES = $(check_SCRIPTS) \
   buildvars.pyc
 
 noinst_PROGRAMS = \
-  gnunet-service-test-barriers
-
+  gnunet-service-test-barriers \
+  test-getcwd
 gnunet_service_testbed_SOURCES = \
   gnunet-service-testbed.h \
   gnunet-service-testbed.c \
@@ -400,3 +400,5 @@ EXTRA_DIST = \
   sample.job \
   buildvars.py.in \
   test_testbed_api_barriers.py
+
+test_getcwd_SOURCES = test_getcwd.c
\ No newline at end of file
diff --git a/src/testbed/test_getcwd.c b/src/testbed/test_getcwd.c
new file mode 100644 (file)
index 0000000..9730a02
--- /dev/null
@@ -0,0 +1,16 @@
+#include "platform.h"
+#include "gnunet_common.h"
+
+int main ()
+{
+  char buf[PATH_MAX];
+  char *out;
+  
+#ifdef MIGW
+  out = _getcwd (buf, PATH_MAX);
+#else
+  out = getcwd (buf, PATH_MAX);
+#endif  /* MIGW */
+  (void) printf ("CWD: %s\n", out);
+  return 0;
+}