X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=eglib%2Ftest%2Fdir.c;h=f8711217250b0d4772e55c84d7e805bca61369fe;hb=07bf83dd61a595f7ebba4e66267886b0d2ef18fd;hp=d85a5cfd09ece3f284bd30b649778fdc01cb57eb;hpb=0443306d611d0830e27327e1f0a3ef3457dfa535;p=mono.git diff --git a/eglib/test/dir.c b/eglib/test/dir.c index d85a5cfd09e..f8711217250 100644 --- a/eglib/test/dir.c +++ b/eglib/test/dir.c @@ -1,8 +1,13 @@ +#include #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef G_OS_UNIX #include +#endif #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"); - 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; } @@ -53,3 +63,4 @@ static Test dir_tests [] = { DEFINE_TEST_GROUP_INIT(dir_tests_init, dir_tests) +