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>
# 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
//{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"},
#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"
#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;