Module: wine Branch: master Commit: c7093febab51ca3cf79fb10ff17e74459b158618 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c7093febab51ca3cf79fb10ff1...
Author: Jeff Zaroyko jeffz@jeffz.name Date: Tue Aug 26 18:32:35 2008 +1000
msvcrt: Add a test for unlinking non-empty directories.
---
dlls/msvcrt/tests/file.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 45ffdce..0cf13fd 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -1085,6 +1085,19 @@ static void test_pipes(const char* selfname) ok(fclose(file) == 0, "unable to close the pipe: %d\n", errno); }
+static void test_unlink(void) +{ + FILE* file; + ok(mkdir("test_unlink") == 0, "unable to create test dir\n"); + file = fopen("test_unlink\empty", "w"); + ok(file != NULL, "unable to create test file\n"); + if(file) + fclose(file); + todo_wine ok(_unlink("test_unlink") != 0, "unlinking a non-empty directory must fail\n"); + unlink("test_unlink\empty"); + rmdir("test_unlink"); +} + START_TEST(file) { int arg_c; @@ -1109,6 +1122,7 @@ START_TEST(file) test_file_write_read(); test_chsize(); test_stat(); + test_unlink();
/* testing stream I/O */ test_fdopen();