12 dir
= g_dir_open (".", 0, &error
);
13 g_assert_no_error (error
);
16 while ((name
= g_dir_read_name (dir
)) != NULL
)
19 first
= g_strdup (name
);
20 g_assert_cmpstr (name
, !=, ".");
21 g_assert_cmpstr (name
, !=, "..");
25 g_assert_cmpstr (g_dir_read_name (dir
), ==, first
);
32 test_dir_nonexisting (void)
38 dir
= g_dir_open ("/pfrkstrf", 0, &error
);
39 g_assert (dir
== NULL
);
40 g_assert_error (error
, G_FILE_ERROR
, G_FILE_ERROR_NOENT
);
45 main (int argc
, char *argv
[])
47 g_test_init (&argc
, &argv
, NULL
);
49 g_test_add_func ("/dir/read", test_dir_read
);
50 g_test_add_func ("/dir/nonexisting", test_dir_nonexisting
);