test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o test_yaffs_open_EISDIR.o test_yaffs_open_ENAMETOOLONG.o \
test_yaffs_open_EINVAL.o test_yaffs_open_EINVAL2.o \
test_yaffs_unlink.o test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o test_yaffs_unlink_ENOTDIR.o\
- test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_EFBIG.o \
+ test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_big_file.o \
test_yaffs_truncate.o test_yaffs_truncate_ENOTDIR.o test_yaffs_truncate_EISDIR.o test_yaffs_truncate_ENOENT.o test_yaffs_truncate_EINVAL.o \
- test_yaffs_truncate_EFBIG.o\
- test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_EFBIG.o \
+ test_yaffs_truncate_big_file.o\
+ test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_big_file.o \
test_yaffs_read.o test_yaffs_read_EBADF.o test_yaffs_read_EINVAL.o\
- test_yaffs_lseek.o test_yaffs_lseek_EBADF.o test_yaffs_lseek_EINVAL.o test_yaffs_lseek_EFBIG.o \
+ test_yaffs_lseek.o test_yaffs_lseek_EBADF.o test_yaffs_lseek_EINVAL.o test_yaffs_lseek_big_file.o \
test_yaffs_access.o test_yaffs_access_EINVAL.o test_yaffs_access_ENOTDIR.o test_yaffs_access_ENOENT.o\
test_yaffs_stat.o test_yaffs_stat_ENOENT.o test_yaffs_stat_ENOTDIR.o \
test_yaffs_fstat.o test_yaffs_fstat_EBADF.o \
test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o \
test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.o \
test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EINVAL.o \
- test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o
+ test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o test_yaffs_symlink_EEXIST.o
test_yaffs_ftruncate
test_yaffs_ftruncate_EBADF
test_yaffs_ftruncate_ENIVAL
- test_yaffs_ftruncate_EFBIG
+ test_yaffs_ftruncate_big_file
test_yaffs_lseek
test_yaffs_lseek_EBADF
test_yaffs_lseek_EINVAL
- test_yaffs_lseek_EFBIG
+ test_yaffs_lseek_big_file
test_yaffs_open
test_yaffs_open_EEXIST
test_yaffs_stat_ENOTDIR
test_yaffs_symlink
+ test_yaffs_symlink_ENOTDIR
test_yaffs_fstat
test_yaffs_fstat_EBADF
test_yaffs_truncate_EISDIR
test_yaffs_truncate_ENOENT
test_yaffs_truncate_ENIVAL
- test_yaffs_truncate_EFBIG
+ test_yaffs_truncate_big_file
test_yaffs_unlink
test_yaffs_unlink_EISDIR
test_yaffs_symlink_ELOOP
test_yaffs_symlink_ENAMETOOLONG
test_yaffs_symlink_ENOENT //if there is a slash on the end
- test_yaffs_symlink_ENOTDIR
test_yaffs_symlink_EROFS
test_yaffs_mknod
- test_yaffs_read_EFBIG
+ test_yaffs_read_big_file
test what happens if you read off the end of the file?
test_yaffs_pread
test_yaffs_pread_EBADF
test_yaffs_pread_EINVAL
- test_yaffs_pread_EFBIG
+ test_yaffs_pread_big_file
- test_yaffs_write_EFBIG
+ test_yaffs_write_big_file
test_yaffs_write_EINVAL
What happens when you run out of space?
test_yaffs_write_EBADF
test_yaffs_write
- test_yaffs_pwrite_EFBIG
+ test_yaffs_pwrite_big_file
test_yaffs_pwrite_EINVAL
test_yaffs_unlink_EACCES
Bug with unmounting a non-existing mountpoint. The function returns ENODEV
but should be returning EINVAL.
- Unmount2 forcing the unmount needs to break the handles so they return EBADF.
-
- Bug with reading -1 bytes of a file without an error (test is in test_yaffs_read_EINVAL).
- It should return EINVAL. This is because it was reading an empty file.
- When text is added to the file a read of -1 bytes tries to read 4 gig of data
Bug when writing a file. The writing to the file causes the file size to exceed the size of yaffs file system memory.
Output of test:
- test_yaffs_write_EFBIG
+ test_yaffs_write_big_file
AddrToChunk of offset -2147483648 gives chunk -1048576 start 0
AddrToChunk of offset -2147481600 gives chunk -1048575 start 0
AddrToChunk of offset -2147479552 gives chunk -1048574 start 0
AddrToChunk of offset -2147467264 gives chunk -1048568 start 0
AddrToChunk of offset -2147465216 gives chunk -1048567 start 0
wrote a large amount of text to a file.(which is a bad thing)
- test: test_yaffs_write_EFBIG failed
+ test: test_yaffs_write_big_file failed
yaffs_error code 0
error is : Unknown error code
#include "test_yaffs_ftruncate.h"
#include "test_yaffs_ftruncate_EBADF.h"
#include "test_yaffs_ftruncate_EINVAL.h"
-#include "test_yaffs_ftruncate_EFBIG.h"
+#include "test_yaffs_ftruncate_big_file.h"
#include "test_yaffs_truncate.h"
#include "test_yaffs_truncate_EISDIR.h"
#include "test_yaffs_truncate_ENOENT.h"
#include "test_yaffs_truncate_EINVAL.h"
-#include "test_yaffs_truncate_EFBIG.h"
+#include "test_yaffs_truncate_big_file.h"
#include "test_yaffs_write.h"
#include "test_yaffs_write_EBADF.h"
-#include "test_yaffs_write_EFBIG.h"
+#include "test_yaffs_write_big_file.h"
#include "test_yaffs_read.h"
#include "test_yaffs_read_EBADF.h"
#include "test_yaffs_lseek.h"
#include "test_yaffs_lseek_EBADF.h"
#include "test_yaffs_lseek_EINVAL.h"
-#include "test_yaffs_lseek_EFBIG.h"
+#include "test_yaffs_lseek_big_file.h"
#include "test_yaffs_access.h"
#include "test_yaffs_access_EINVAL.h"
#include "test_yaffs_symlink.h"
#include "test_yaffs_symlink_ENOTDIR.h"
+#include "test_yaffs_symlink_EEXIST.h"
#include "yaffsfs.h"
{test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
{test_yaffs_lseek_EBADF,test_yaffs_lseek_EBADF_clean,"test_yaffs_lseek_EBADF"},
{test_yaffs_lseek_EINVAL,test_yaffs_lseek_EINVAL_clean,"test_yaffs_lseek_EINVAL"},
- {test_yaffs_lseek_EFBIG,test_yaffs_lseek_EFBIG_clean,"test_yaffs_lseek_EFBIG"},
+ {test_yaffs_lseek_big_file,test_yaffs_lseek_big_file_clean,"test_yaffs_lseek_big_file"},
{test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"},
{test_yaffs_write_EBADF,test_yaffs_write_EBADF_clean,"test_yaffs_write_EBADF"},
-// {test_yaffs_write_EFBIG,test_yaffs_write_EFBIG_clean,"test_yaffs_write_EFBIG"},
+// {test_yaffs_write_big_file,test_yaffs_write_big_file_clean,"test_yaffs_write_big_file"},
{test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"},
{test_yaffs_read_EBADF,test_yaffs_read_EBADF_clean,"test_yaffs_read_EBADF"},
{test_yaffs_ftruncate,test_yaffs_ftruncate_clean,"test_yaffs_ftruncate"},
{test_yaffs_ftruncate_EBADF,test_yaffs_ftruncate_EBADF_clean,"test_yaffs_ftruncate_EBADF"},
{test_yaffs_ftruncate_EINVAL,test_yaffs_ftruncate_EINVAL_clean,"test_yaffs_ftruncate_EINVAL"},
- {test_yaffs_ftruncate_EFBIG,test_yaffs_ftruncate_EFBIG_clean,"test_yaffs_ftruncate_EFBIG"},
+ {test_yaffs_ftruncate_big_file,test_yaffs_ftruncate_big_file_clean,"test_yaffs_ftruncate_big_file"},
{test_yaffs_truncate,test_yaffs_truncate_clean,"test_yaffs_truncate"},
{test_yaffs_truncate_ENOTDIR,test_yaffs_truncate_ENOTDIR_clean,"test_yaffs_truncate_ENOTDIR"},
{test_yaffs_truncate_EISDIR,test_yaffs_truncate_EISDIR_clean,"test_yaffs_truncate_EISDIR"},
{test_yaffs_truncate_EINVAL,test_yaffs_truncate_EINVAL_clean,"test_yaffs_truncate_EINVAL"},
{test_yaffs_truncate_ENOENT,test_yaffs_truncate_ENOENT_clean,"test_yaffs_truncate_ENOENT"},
- {test_yaffs_truncate_EFBIG,test_yaffs_truncate_EFBIG_clean,"test_yaffs_truncate_EFBIG"},
+ {test_yaffs_truncate_big_file,test_yaffs_truncate_big_file_clean,"test_yaffs_truncate_big_file"},
{test_yaffs_chmod,test_yaffs_chmod_clean,"test_yaffs_chmod"},
{test_yaffs_chmod_ENOENT,test_yaffs_chmod_ENOENT_clean,"test_yaffs_chmod_ENOENT"},
{test_yaffs_mkdir_ENOTDIR,test_yaffs_mkdir_ENOTDIR_clean,"test_yaffs_mkdir_ENOTDIR"},
{test_yaffs_symlink,test_yaffs_symlink_clean,"test_yaffs_symlink"},
- {test_yaffs_symlink_ENOTDIR,test_yaffs_symlink_ENOTDIR_clean,"test_yaffs_symlink_ENOTDIR"}
+ {test_yaffs_symlink_ENOTDIR,test_yaffs_symlink_ENOTDIR_clean,"test_yaffs_symlink_ENOTDIR"},
+ {test_yaffs_symlink_EEXIST,test_yaffs_symlink_EEXIST_clean,"test_yaffs_symlink_EEXIST"}
* published by the Free Software Foundation.
*/
-#include "test_yaffs_ftruncate_EFBIG.h"
+#include "test_yaffs_ftruncate_big_file.h"
static int handle = -1;
-int test_yaffs_ftruncate_EFBIG(void)
+int test_yaffs_ftruncate_big_file(void)
{
int output = 0;
int error_code = 0;
output = yaffs_ftruncate(handle,10000000000000000000000000000000);
if (output < 0){
error_code = yaffs_get_error();
- if (abs(error_code) == EINVAL){ /* yaffs uses the error EINVAL instead of EFBIG */
+ if (abs(error_code) == EINVAL){ /* yaffs uses the error EINVAL instead of big_file */
return 1;
} else {
print_message("different error than expected\n", 2);
}
}
-int test_yaffs_ftruncate_EFBIG_clean(void){
+int test_yaffs_ftruncate_big_file_clean(void){
/* change file size back to orignal size */
int output = 0;
if (handle >= 0){
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_truncate_EFBIG_h__
-#define __test_yaffs_truncate_EFBIG_h__
+#ifndef __test_yaffs_ftruncate_big_file_h__
+#define __test_yaffs_ftruncate_big_file_h__
#include "lib.h"
#include "yaffsfs.h"
#include "test_yaffs_open.h"
-int test_yaffs_truncate_EFBIG(void);
-int test_yaffs_truncate_EFBIG_clean(void);
+int test_yaffs_ftruncate_big_file(void);
+int test_yaffs_ftruncate_big_file_clean(void);
#endif
* published by the Free Software Foundation.
*/
-#include "test_yaffs_lseek_EFBIG.h"
+#include "test_yaffs_lseek_big_file.h"
static int handle = -1;
-int test_yaffs_lseek_EFBIG(void)
+int test_yaffs_lseek_big_file(void)
{
handle = test_yaffs_open();
int error_code = 0;
}
}
-int test_yaffs_lseek_EFBIG_clean(void)
+int test_yaffs_lseek_big_file_clean(void)
{
if (handle >= 0){
return yaffs_close(handle);
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_lseek_EFBIG_h__
-#define __test_yaffs_lseek_EFBIG_h__
+#ifndef __test_yaffs_lseek_big_file_h__
+#define __test_yaffs_lseek_big_file_h__
#include "lib.h"
#include "yaffsfs.h"
#include "test_yaffs_open.h"
-int test_yaffs_lseek_EFBIG(void);
-int test_yaffs_lseek_EFBIG_clean(void);
+int test_yaffs_lseek_big_file(void);
+int test_yaffs_lseek_big_file_clean(void);
#endif
--- /dev/null
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "test_yaffs_symlink_EEXIST.h"
+
+static int output = 0;
+
+int test_yaffs_symlink_EEXIST(void)
+{
+ int error_code = 0;
+ if (0==yaffs_access(SYMLINK_PATH,0)){
+ output=yaffs_symlink(FILE_PATH,SYMLINK_PATH);
+ if (output>0){
+ print_message("failed to create the first symlink\n",2);
+ return -1;
+ }
+ }
+
+ output = yaffs_symlink(FILE_PATH,SYMLINK_PATH);
+ if (output<0){
+ error_code=yaffs_get_error();
+ if (abs(error_code)==EEXIST){
+ return 1;
+ } else {
+ print_message("returned error does not match the the expected error\n",2);
+ return -1;
+ }
+ } else {
+ print_message("created a symlink over an existing symlink (which is a bad thing)\n",2);
+ return -1;
+ }
+
+}
+
+int test_yaffs_symlink_EEXIST_clean(void)
+{
+ if (output >= 0){
+ return yaffs_unlink(SYMLINK_PATH);
+ } else {
+ return 1; /* the file failed to open so there is no need to close it */
+ }
+}
+
+
+
--- /dev/null
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
+ */
+
+#ifndef __test_yaffs_symlink_EEXIST_h__
+#define __test_yaffs_symlink_EEXIST_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_symlink_EEXIST(void);
+int test_yaffs_symlink_EEXIST_clean(void);
+
+#endif
* published by the Free Software Foundation.
*/
-#include "test_yaffs_truncate_EFBIG.h"
+#include "test_yaffs_truncate_big_file.h"
static int handle = -1;
-int test_yaffs_truncate_EFBIG(void)
+int test_yaffs_truncate_big_file(void)
{
int error=0;
int output=0;
output= yaffs_truncate("/yaffs2/foo",10000000000000000000000000000000000000000000 );
if (output<0){
error=yaffs_get_error();
- if (abs(error)==EINVAL){ /*in yaffs EINVAL is used instead of EFBIG */
+ if (abs(error)==EINVAL){ /*in yaffs EINVAL is used instead of big_file */
return 1;
} else {
print_message("received a different error than expected\n",2);
}
}
-int test_yaffs_truncate_EFBIG_clean(void)
+int test_yaffs_truncate_big_file_clean(void)
{
return 1;
}
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_ftruncate_EFBIG_h__
-#define __test_yaffs_ftruncate_EFBIG_h__
+#ifndef __test_yaffs_truncate_big_file_h__
+#define __test_yaffs_truncate_big_file_h__
#include "lib.h"
#include "yaffsfs.h"
#include "test_yaffs_open.h"
-int test_yaffs_ftruncate_EFBIG(void);
-int test_yaffs_ftruncate_EFBIG_clean(void);
+int test_yaffs_truncate_big_file(void);
+int test_yaffs_truncate_big_file_clean(void);
#endif
output=yaffs_unlink(file_name);
if (output==-1){
error_code=yaffs_get_error();
- if (abs(error_code)== EISDIR){
+ if (abs(error_code)== ENAMETOOLONG){
return 1;
} else {
print_message("different error than expected\n",2);
* published by the Free Software Foundation.
*/
-#include "test_yaffs_write_EFBIG.h"
+#include "test_yaffs_write_big_file.h"
static int handle=0;
static char *file_name = NULL;
-int test_yaffs_write_EFBIG(void)
+int test_yaffs_write_big_file(void)
{
int output=0;
int error_code=0;
}
-int test_yaffs_write_EFBIG_clean(void)
+int test_yaffs_write_big_file_clean(void)
{
int output=1;
if(file_name){
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __test_yaffs_write_EFBIG_h__
-#define __test_yaffs_write_EFBIG_h__
+#ifndef __test_yaffs_write_big_file_h__
+#define __test_yaffs_write_big_file_h__
#include "lib.h"
#include "yaffsfs.h"
#include "test_yaffs_open.h"
#include "test_yaffs_write.h"
#include "test_yaffs_truncate.h"
-int test_yaffs_write_EFBIG(void);
-int test_yaffs_write_EFBIG_clean(void);
+int test_yaffs_write_big_file(void);
+int test_yaffs_write_big_file_clean(void);
#endif