yaffs Found another bug.
authorTimothy Manning <tfhmanning@gmail.com>
Wed, 3 Nov 2010 03:46:33 +0000 (16:46 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Wed, 3 Nov 2010 03:46:33 +0000 (16:46 +1300)
In test_yaffs_open_file_ENOENT the error code ENOSPC is been returned but the emfile in not full.
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/timothy_tests/quick_tests/Makefile
direct/timothy_tests/quick_tests/quick_tests.c
direct/timothy_tests/quick_tests/quick_tests.h
direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c

index c683dad..543cdbf 100644 (file)
@@ -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
index 035b4fa..6c548fb 100644 (file)
@@ -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"},
index bb9dd6f..18b0876 100644 (file)
@@ -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"
index 02c02bb..ed57e2d 100644 (file)
@@ -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;