/*
* YAFFS: Yet another FFS. A NAND-flash specific file system.
*
- * Copyright (C) 2002-2010 Aleph One Ltd.
+ * Copyright (C) 2002-2011 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Timothy Manning <timothy@yaffs.net>
int test_yaffs_read_EINVAL(void)
{
int error_code = 0;
- handle=test_yaffs_open();
- char text[2000000]="\0";
+ handle=yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE);
+ char text[2000000];
int output=0;
if (handle<0){
{
int output=0;
if (handle>=0){
- output=test_yaffs_read_EINVAL_init_clean();
+ if(file_name){
+ free(file_name);
+ file_name = NULL;
+ }
+
+
+ output= yaffs_truncate(FILE_PATH,FILE_SIZE );
+ if (output>=0){
+ output=test_yaffs_write();
+ if (output<0){
+ print_message("failed to write to file\n",2);
+ return -1;
+ } else {
+ output=test_yaffs_write_clean();
+ if (output<0){
+ print_message("failed to clean the write_to_file function\n",2);
+ }
+ }
+ } else {
+ print_message("failed to truncate file\n",2);
+ return -1;
+ }
+
if(output>=0){
output=yaffs_close(handle);
if (output>=0){
}
} else {
print_message("no open handle\n",2);
+ return -1;
}
}
return -1;
}
- strcat(file_name,YAFFS_MOUNT_POINT);
+ strcpy(file_name,YAFFS_MOUNT_POINT);
for (x=strlen(YAFFS_MOUNT_POINT); x<file_name_length -1; x++){
file_name[x]='a';
}
}
-int test_yaffs_read_EINVAL_init_clean(void)
-{
- int output=1;
- if(file_name){
- free(file_name);
- file_name = NULL;
- }
-
-
- output= yaffs_truncate(FILE_PATH,FILE_SIZE );
- if (output>=0){
- output=test_yaffs_write();
- if (output>=0){
- return 1;
- } else {
- print_message("failed to write to file\n",2);
- return -1;
- }
- } else {
- print_message("failed to truncate file\n",2);
- return -1;
- }
-
-}