+#include <config.h>
#include <glib.h>
#include <string.h>
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#ifdef G_OS_UNIX
#include <pthread.h>
+#endif
#include "test.h"
/* This test is just to be used with valgrind */
return FAILED ("5 opendir should succeed");
if (error != NULL)
return FAILED ("6 got an error");
-
name = NULL;
name = g_dir_read_name (dir);
if (name == NULL)
return FAILED ("7 didn't read a file name");
+ while ((name = g_dir_read_name (dir)) != NULL) {
+ if (strcmp (name, ".") == 0)
+ return FAILED (". directory found");
+ if (strcmp (name, "..") == 0)
+ return FAILED (".. directory found");
+ }
g_dir_close (dir);
return OK;
}
DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests)
+