8 /* This test is just to be used with valgrind */
17 dir = g_dir_open (NULL, 0, NULL);
19 dir
= g_dir_open ("", 0, NULL
);
21 return FAILED ("1 Should be an error");
23 dir
= g_dir_open ("", 9, NULL
);
25 return FAILED ("2 Should be an error");
28 dir
= g_dir_open (".ljasdslakjd", 9, &error
);
30 return FAILED ("3 opendir should fail");
32 return FAILED ("4 got no error");
35 dir
= g_dir_open (g_get_tmp_dir (), 9, &error
);
37 return FAILED ("5 opendir should succeed");
39 return FAILED ("6 got an error");
41 name
= g_dir_read_name (dir
);
43 return FAILED ("7 didn't read a file name");
44 while ((name
= g_dir_read_name (dir
)) != NULL
) {
45 if (strcmp (name
, ".") == 0)
46 return FAILED (". directory found");
47 if (strcmp (name
, "..") == 0)
48 return FAILED (".. directory found");
54 static Test dir_tests
[] = {
55 {"g_dir_*", test_dir
},
59 DEFINE_TEST_GROUP_INIT(dir_tests_init
, dir_tests
)