projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[msvc] Update csproj files
[mono.git]
/
eglib
/
test
/
dir.c
diff --git
a/eglib/test/dir.c
b/eglib/test/dir.c
index d85a5cfd09ece3f284bd30b649778fdc01cb57eb..f8711217250b0d4772e55c84d7e805bca61369fe 100644
(file)
--- a/
eglib/test/dir.c
+++ b/
eglib/test/dir.c
@@
-1,8
+1,13
@@
+#include <config.h>
#include <glib.h>
#include <string.h>
#include <stdio.h>
#include <glib.h>
#include <string.h>
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#include <unistd.h>
+#endif
+#ifdef G_OS_UNIX
#include <pthread.h>
#include <pthread.h>
+#endif
#include "test.h"
/* This test is just to be used with valgrind */
#include "test.h"
/* This test is just to be used with valgrind */
@@
-37,11
+42,16
@@
test_dir ()
return FAILED ("5 opendir should succeed");
if (error != NULL)
return FAILED ("6 got an error");
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");
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;
}
g_dir_close (dir);
return OK;
}
@@
-53,3
+63,4
@@
static Test dir_tests [] = {
DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests)
DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests)
+