From: Timothy Manning Date: Wed, 3 Nov 2010 03:46:33 +0000 (+1300) Subject: yaffs Found another bug. X-Git-Tag: linux-mainline-patchset-4~117 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=c118b37070fa47650ca61c8c740da7461450d139;ds=sidebyside yaffs Found another bug. In test_yaffs_open_file_ENOENT the error code ENOSPC is been returned but the emfile in not full. Signed-off-by: Timothy Manning --- diff --git a/direct/timothy_tests/quick_tests/Makefile b/direct/timothy_tests/quick_tests/Makefile index c683dad..543cdbf 100644 --- a/direct/timothy_tests/quick_tests/Makefile +++ b/direct/timothy_tests/quick_tests/Makefile @@ -45,7 +45,7 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsf # yaffs_checkptrwtest.o\ YAFFSTESTOBJS = $(COMMONTESTOBJS) quick_tests.o lib.o test_mount_yaffs.o test_yaffs_unlinking.o test_yaffs_open_file.o test_yaffs_ftruncate.o test_yaffs_truncate.o \ - test_yaffs_write.o test_yaffs_read.o test_yaffs_lseek.o test_yaffs_access.o test_yaffs_stat.o + test_yaffs_write.o test_yaffs_read.o test_yaffs_lseek.o test_yaffs_access.o test_yaffs_stat.o test_yaffs_open_file_ENOENT.o PYTONOSYMLINKS = yaffs_error_converter.c yaffs_error_converter.h PYTHONOBJS = yaffs_error_converter.o diff --git a/direct/timothy_tests/quick_tests/quick_tests.c b/direct/timothy_tests/quick_tests/quick_tests.c index 035b4fa..6c548fb 100644 --- a/direct/timothy_tests/quick_tests/quick_tests.c +++ b/direct/timothy_tests/quick_tests/quick_tests.c @@ -32,6 +32,7 @@ test_template test_list[]={ //{dummy_test_fail,dummy_test_fail_clean,"dummy_test_fail"}, {mount_yaffs_test,mount_yaffs_test_clean,"mount_yaffs_test"}, {test_yaffs_open_file,test_yaffs_open_file_clean,"test_yaffs_open_file"}, + {test_yaffs_open_file_ENOENT,test_yaffs_open_file_ENOENT_clean,"test_yaffs_open_file_ENOENT"}, {test_yaffs_access,test_yaffs_access_clean,"test_yaffs_access"}, {test_yaffs_unlinking, test_yaffs_unlinking_clean,"test_yaffs_unlinking"}, diff --git a/direct/timothy_tests/quick_tests/quick_tests.h b/direct/timothy_tests/quick_tests/quick_tests.h index bb9dd6f..18b0876 100644 --- a/direct/timothy_tests/quick_tests/quick_tests.h +++ b/direct/timothy_tests/quick_tests/quick_tests.h @@ -4,6 +4,7 @@ #include "test_mount_yaffs.h" #include "test_yaffs_open_file.h" +#include "test_yaffs_open_file_ENOENT.h" #include "test_yaffs_unlinking.h" #include "test_yaffs_ftruncate.h" #include "test_yaffs_truncate.h" diff --git a/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c b/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c index 02c02bb..ed57e2d 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c @@ -1,19 +1,22 @@ #include "test_yaffs_open_file_ENOENT.h" - +static int handle=0; int test_yaffs_open_file_ENOENT(void){ - int output=0; - + int error_code=0; /*printf("path %s\n",path); */ - output=yaffs_open(FILE_PATH, O_TRUNC| O_RDWR, "/yaffs2/non_existant_file"); - if (output==ENOENT){ - return output; + handle=yaffs_open("/yaffs2/non_existant_file", O_TRUNC| O_RDWR,FILE_MODE ); + if (handle==-1){ + error_code=yaffs_get_error(); + if (error_code==ENOENT){ + return 1; + } } else if (output >=0){ printf("non existant file opened.(which is a bad thing)\n"); return -1; } + } int test_yaffs_open_file_ENOENT_clean(void){ return 1;