13 /* This test is just to be used with valgrind */
22 dir = g_dir_open (NULL, 0, NULL);
24 dir
= g_dir_open ("", 0, NULL
);
26 return FAILED ("1 Should be an error");
28 dir
= g_dir_open ("", 9, NULL
);
30 return FAILED ("2 Should be an error");
33 dir
= g_dir_open (".ljasdslakjd", 9, &error
);
35 return FAILED ("3 opendir should fail");
37 return FAILED ("4 got no error");
40 dir
= g_dir_open (g_get_tmp_dir (), 9, &error
);
42 return FAILED ("5 opendir should succeed");
44 return FAILED ("6 got an error");
46 name
= g_dir_read_name (dir
);
48 return FAILED ("7 didn't read a file name");
49 while ((name
= g_dir_read_name (dir
)) != NULL
) {
50 if (strcmp (name
, ".") == 0)
51 return FAILED (". directory found");
52 if (strcmp (name
, "..") == 0)
53 return FAILED (".. directory found");
59 static Test dir_tests
[] = {
60 {"g_dir_*", test_dir
},
64 DEFINE_TEST_GROUP_INIT(dir_tests_init
, dir_tests
)