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 c683dad1274611e3a05841001928673c5132a6ce..543cdbf706fdc670ffe25a98838aff4c594db05f 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 035b4fac1be4a3c68b5a083cfa28a84cbd3b6c61..6c548fbbc3803e1c2e8c25f908ffdc3e857bf076 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 bb9dd6f861452aa76bd1610986332d86072a88a0..18b08766ceeff9ae73b79b7097f405736c0d3af4 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 02c02bbc38b3f85341a7a9a0eb72ced2fa99fcd2..ed57e2d6f8432c99d37d6e274ab67cd0e7c2488f 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;