X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=direct%2Ftest-framework%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_rename_EEXISTS.c;h=3044e13d9ee610bab00335fb667b03a74a20f97e;hb=3de09ef5a181999f7340462154034b727827e4fa;hp=c5e2a261bc10f8b32893c147c4997fa1d00cf608;hpb=e5daa72b0083831ab762a650860687fe7d25d6b3;p=yaffs2.git diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EEXISTS.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EEXISTS.c index c5e2a26..3044e13 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EEXISTS.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EEXISTS.c @@ -1,8 +1,7 @@ /* * YAFFS: Yet another FFS. A NAND-flash specific file system. * - * Copyright (C) 2002-2011 Aleph One Ltd. - * for Toby Churchill Ltd and Brightstar Engineering + * Copyright (C) 2002-2018 Aleph One Ltd. * * Created by Timothy Manning * @@ -18,7 +17,10 @@ int test_yaffs_rename_EEXISTS(void) { int output=0; int error_code =0; - + if (yaffs_close(yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE))==-1){ + print_message("failed to create file\n",1); + return -1; + } if (0 != yaffs_access(DIR_PATH,0)) { output = yaffs_mkdir(DIR_PATH,S_IWRITE | S_IREAD); if (output < 0) { @@ -36,7 +38,7 @@ int test_yaffs_rename_EEXISTS(void) } } } - output= yaffs_open("/yaffs2/dir2/file",O_CREAT | O_RDWR, FILE_MODE); + output= yaffs_open(YAFFS_MOUNT_POINT "/test_dir/dir2/file",O_CREAT | O_RDWR, FILE_MODE); if (output<0){ print_message("failed to open file in the second directory\n",2); return -1; @@ -60,8 +62,8 @@ int test_yaffs_rename_EEXISTS(void) int test_yaffs_rename_EEXISTS_clean(void) { int output = 0; - if (0 == yaffs_access("/yaffs2/dir2/file",0) ) { - output = yaffs_unlink("/yaffs2/dir2/file"); + if (0 == yaffs_access(YAFFS_MOUNT_POINT "/dir2/file",0) ) { + output = yaffs_unlink(YAFFS_MOUNT_POINT "/dir2/file"); if (output < 0) { print_message("failed to remove the file\n",2); return -1;