yaffs More tests added to direct/timothy_tests/quick_tests
authorTimothy Manning <tfhmanning@gmail.com>
Mon, 29 Nov 2010 20:23:31 +0000 (09:23 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Mon, 29 Nov 2010 20:24:54 +0000 (09:24 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
49 files changed:
direct/timothy_tests/quick_tests/Makefile
direct/timothy_tests/quick_tests/README.txt
direct/timothy_tests/quick_tests/quick_tests.h
direct/timothy_tests/quick_tests/test_yaffs_access_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_access_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_access_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_access_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_chmod_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_chmod_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_chmod_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_chmod_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_close_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_close_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_freespace_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_freespace_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_inodecount_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_inodecount_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG2.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG2.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_lstat_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_lstat_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_mkdir_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_mkdir_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_remount_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_remount_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG2.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG2.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rmdir_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rmdir_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_symlink_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_symlink_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_sync_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_sync_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_totalspace_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_totalspace_ENAMETOOLONG.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_truncate_ENAMETOOLONG.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_truncate_ENAMETOOLONG.h [new file with mode: 0644]

index 1d8a025..fe507d9 100644 (file)
@@ -57,46 +57,49 @@ TESTFILES =         quick_tests.o lib.o \
                test_yaffs_ftruncate_EROFS.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_big_file.o test_yaffs_truncate_ENOENT2.o test_yaffs_truncate_ELOOP.o \
-               test_yaffs_truncate_ELOOP_dir.o test_yaffs_truncate_EROFS.o \
+               test_yaffs_truncate_ELOOP_dir.o test_yaffs_truncate_EROFS.o test_yaffs_truncate_ENAMETOOLONG.o \
                test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_big_file.o test_yaffs_write_EROFS.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_big_file.o \
                test_yaffs_access.o test_yaffs_access_EINVAL.o test_yaffs_access_ENOTDIR.o test_yaffs_access_ENOENT.o \
                test_yaffs_access_ENOENT2.o test_yaffs_access_ELOOP_dir.o test_yaffs_access_ELOOP.o test_yaffs_access_EROFS.o \
-               test_yaffs_access_EACCES.o \
+               test_yaffs_access_EACCES.o test_yaffs_access_ENAMETOOLONG.o test_yaffs_access_NULL.o \
                test_yaffs_stat.o test_yaffs_stat_ENOENT.o test_yaffs_stat_ENOTDIR.o test_yaffs_stat_ENOENT2.o test_yaffs_stat_ELOOP.o \
-               test_yaffs_stat_ELOOP_dir.o\
+               test_yaffs_stat_ELOOP_dir.o test_yaffs_stat_ENAMETOOLONG.o \
                test_yaffs_fstat.o test_yaffs_fstat_EBADF.o  \
-               test_yaffs_close_EBADF.o\
+               test_yaffs_close_EBADF.o test_yaffs_close_NULL.o \
                test_yaffs_chmod.o test_yaffs_chmod_ENOENT.o test_yaffs_chmod_ENOTDIR.o test_yaffs_chmod_EINVAL.o \
                test_yaffs_chmod_ENOENT2.o test_yaffs_chmod_ELOOP_dir.o test_yaffs_chmod_ELOOP.o test_yaffs_chmod_EROFS.o \
+               test_yaffs_chmod_ENAMETOOLONG.o test_yaffs_chmod_NULL.o \
                test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EROFS.o test_yaffs_fchmod_EINVAL.o\
                test_yaffs_fsync.o test_yaffs_fsync_EBADF.o test_yaffs_fsync_EROFS.o \
-               test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o test_yaffs_fdatasync_EROFS.o\
+               test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o test_yaffs_fdatasync_EROFS.o test_yaffs_fdatasync_NULL.o \
                test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.o test_yaffs_mkdir_ENOENT.o \
-               test_yaffs_mkdir_ELOOP_dir.o test_yaffs_mkdir_EROFS.o \
-               test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EINVAL.o \
+               test_yaffs_mkdir_ELOOP_dir.o test_yaffs_mkdir_EROFS.o test_yaffs_mkdir_ENAMETOOLONG.o \
+               test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EINVAL.o test_yaffs_fchmod_NULL.o \
                test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o test_yaffs_symlink_EEXIST.o test_yaffs_symlink_ENOENT.o \
-               test_yaffs_symlink_ENOENT2.o test_yaffs_symlink_ELOOP_dir.o test_yaffs_symlink_EROFS.o \
+               test_yaffs_symlink_ENOENT2.o test_yaffs_symlink_ELOOP_dir.o test_yaffs_symlink_EROFS.o test_yaffs_symlink_ENAMETOOLONG.o\
                test_yaffs_mount2.o test_yaffs_mount2_ENODEV.o \
                test_yaffs_unmount2.o test_yaffs_unmount2_ENODEV.o test_yaffs_unmount2_EINVAL.o \
                test_yaffs_unmount2_with_handle_open_and_forced_mode_on.o test_yaffs_unmount2_with_handle_open_and_forced_mode_off.o\
-               test_yaffs_sync.o test_yaffs_sync_ENODEV.o  test_yaffs_sync_EROFS.o \
+               test_yaffs_sync.o test_yaffs_sync_ENODEV.o  test_yaffs_sync_EROFS.o test_yaffs_sync_ENAMETOOLONG.o \
                test_yaffs_remount_force_off_read_only_off.o test_yaffs_remount_force_on_read_only_off.o test_yaffs_remount_ENODEV.o \
-               test_yaffs_remount_EINVAL.o \
-               test_yaffs_freespace.o test_yaffs_freespace_EINVAL.o \
-               test_yaffs_totalspace.o test_yaffs_totalspace_EINVAL.o \
-               test_yaffs_inodecount.o test_yaffs_inodecount_EINVAL.o \
+               test_yaffs_remount_EINVAL.o test_yaffs_remount_ENAMETOOLONG.o\
+               test_yaffs_freespace.o test_yaffs_freespace_EINVAL.o test_yaffs_freespace_ENAMETOOLONG.o \
+               test_yaffs_totalspace.o test_yaffs_totalspace_EINVAL.o test_yaffs_totalspace_ENAMETOOLONG.o \
+               test_yaffs_inodecount.o test_yaffs_inodecount_EINVAL.o test_yaffs_inodecount_ENAMETOOLONG.o \
                test_yaffs_link.o test_yaffs_link_ENOENT.o test_yaffs_link_EEXIST.o test_yaffs_link_ENOTDIR.o \
                test_yaffs_link_ENOTDIR2.o test_yaffs_link_ENOENT2.o test_yaffs_link_ENOENT3.o test_yaffs_link_ENOENT3.o \
-               test_yaffs_link_ENOENT4.o test_yaffs_link_ELOOP_dir.o test_yaffs_link_EROFS.o \
+               test_yaffs_link_ENOENT4.o test_yaffs_link_ELOOP_dir.o test_yaffs_link_EROFS.o test_yaffs_link_ENAMETOOLONG.o \
+               test_yaffs_link_ENAMETOOLONG2.o \
                test_yaffs_rmdir.o test_yaffs_rmdir_EBUSY.o test_yaffs_rmdir_EINVAL.o test_yaffs_rmdir_ENOENT.o \
-               test_yaffs_rmdir_ENOTDIR.o test_yaffs_rmdir_ELOOP_dir.o test_yaffs_rmdir_EROFS.o \
+               test_yaffs_rmdir_ENOTDIR.o test_yaffs_rmdir_ELOOP_dir.o test_yaffs_rmdir_EROFS.o test_yaffs_rmdir_ENAMETOOLONG.o \
                test_yaffs_rename.o test_yaffs_rename_ENOENT.o test_yaffs_rename_ENOTDIR.o test_yaffs_rename_EINVAL.o \
                test_yaffs_rename_dir.o test_yaffs_rename_dir_ENOENT.o test_yaffs_rename_dir_ENOENT2.o test_yaffs_rename_dir_to_file.o \
                test_yaffs_rename_file_to_dir.o test_yaffs_rename_EEXISTS.o  test_yaffs_rename_ELOOP_dir.o test_yaffs_rename_EROFS.o \
-               test_yaffs_lstat.o test_yaffs_lstat_ENOENT.o test_yaffs_lstat_ENOTDIR.o \
-               test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o
+               test_yaffs_rename_ENAMETOOLONG.o test_yaffs_rename_ENAMETOOLONG2.o \
+               test_yaffs_lstat.o test_yaffs_lstat_ENOENT.o test_yaffs_lstat_ENOTDIR.o test_yaffs_lstat_ENAMETOOLONG.o \
+               test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o test_yaffs_flush_NULL.o
 
 
                  
index 39fa4ca..d16c9c7 100644 (file)
@@ -202,23 +202,16 @@ Tests to add
 
        test_yaffs_lstat_ENAMETOOLONG
 
-
        test_yaffs_readlink
        test_yaffs_readlink_ENOENT
        test_yaffs_readlink_ENOTDIR
        test_yaffs_readlink_ELOOP
        test_yaffs_readlink_ENAMETOOLONG
 
-       
-
        test_yaffs_mkdir_ENAMETOOLONG
 
-
-
-
        test_yaffs_symlink_ENAMETOOLONG
 
-
        test_yaffs_mount2_ENAMETOOLONG
        test_yaffs_mount2_with read only set
 
@@ -239,40 +232,20 @@ Tests to add
 
        test_yaffs_closedir
 
-
-
        test_yaffs_link_ENAMETOOLONG
        test_yaffs_link_EPERM
 
-
-
-
        test_yaffs_rmdir_ENOTEMPTY
 
-
-
-
-
-
        test_yaffs_rename_EMLINK
        test_yaffs_rename_EEXISTS or EPERM
 
-
        test_yaffs_dup
        test_yaffs_dup_EBADF            
 
-
-       test_yaffs_fchmod_ELOOP
-
-
-
        test_yaffs_open_ENOSPC
-       test_yaffs_open_ELOOP   
-       test yaffs_open_running_out_of_handles error
-
-       
-       
 
+       test yaffs_open_running_out_of_handles error
 
        test_yaffs_stat_ENAMETOOLONG
 
@@ -293,21 +266,11 @@ Tests to add
        test_yaffs_pwrite_big_file
        test_yaffs_pwrite_EINVAL
 
-
-
        test_yaffs_unlink_ENOMEM
 
-
-       test_yaffs_stat_ELOOP
-
-
        test_yaffs_access_ENAMETOOLONG
        test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
 
-
-
-
-
        test_yaffs_truncate_ENAMETOOLONG
        Add a truncate function for truncating a file size to -1.
 
index 2705479..05b8503 100644 (file)
@@ -41,7 +41,7 @@
 #include "test_yaffs_open_EACCES.h"
 
 #include "test_yaffs_close_EBADF.h"
-
+#include "test_yaffs_close_NULL.h"
 
 #include "test_yaffs_unlink.h"
 #include "test_yaffs_unlink_EISDIR.h"
@@ -70,6 +70,7 @@
 #include "test_yaffs_truncate_ELOOP.h"
 #include "test_yaffs_truncate_ELOOP_dir.h"
 #include "test_yaffs_truncate_EROFS.h"
+#include "test_yaffs_truncate_ENAMETOOLONG.h"
 
 #include "test_yaffs_write.h"
 #include "test_yaffs_write_EBADF.h"
@@ -94,6 +95,8 @@
 #include "test_yaffs_access_ELOOP.h"
 #include "test_yaffs_access_EROFS.h"
 #include "test_yaffs_access_EACCES.h"
+#include "test_yaffs_access_ENAMETOOLONG.h"
+#include "test_yaffs_access_NULL.h"
 
 #include "test_yaffs_stat.h"
 #include "test_yaffs_stat_ENOENT.h"
 #include "test_yaffs_stat_ENOENT2.h"
 #include "test_yaffs_stat_ELOOP.h"
 #include "test_yaffs_stat_ELOOP_dir.h"
+#include "test_yaffs_stat_ENAMETOOLONG.h"
 
 #include "test_yaffs_fstat.h"
 #include "test_yaffs_fstat_EBADF.h"
 #include "test_yaffs_chmod_ELOOP_dir.h"
 #include "test_yaffs_chmod_ELOOP.h"
 #include "test_yaffs_chmod_EROFS.h"
+#include "test_yaffs_chmod_ENAMETOOLONG.h"
+#include "test_yaffs_chmod_NULL.h"
 
 #include "test_yaffs_fchmod.h"
 #include "test_yaffs_fchmod_EBADF.h"
 #include "test_yaffs_fchmod_EINVAL.h"
 #include "test_yaffs_fchmod_EROFS.h"
+#include "test_yaffs_fchmod_NULL.h"
 
 #include "test_yaffs_fsync.h"
 #include "test_yaffs_fsync_EBADF.h"
 #include "test_yaffs_fdatasync.h"
 #include "test_yaffs_fdatasync_EBADF.h"
 #include "test_yaffs_fdatasync_EROFS.h"
+#include "test_yaffs_fdatasync_NULL.h"
 
 #include "test_yaffs_mkdir.h"
 #include "test_yaffs_mkdir_EEXIST.h"
 #include "test_yaffs_mkdir_ENOENT.h"
 #include "test_yaffs_mkdir_ELOOP_dir.h"
 #include "test_yaffs_mkdir_EROFS.h"
-
+#include "test_yaffs_mkdir_ENAMETOOLONG.h"
 
 #include "test_yaffs_symlink.h"
 #include "test_yaffs_symlink_ENOTDIR.h"
 #include "test_yaffs_symlink_ENOENT2.h"
 #include "test_yaffs_symlink_ELOOP_dir.h"
 #include "test_yaffs_symlink_EROFS.h"
+#include "test_yaffs_symlink_ENAMETOOLONG.h"
 
 #include "test_yaffs_mount2.h"
 #include "test_yaffs_mount2_ENODEV.h"
 #include "test_yaffs_sync.h"
 #include "test_yaffs_sync_ENODEV.h"
 #include "test_yaffs_sync_EROFS.h"
+#include "test_yaffs_sync_ENAMETOOLONG.h"
 
 #include "test_yaffs_remount_force_off_read_only_off.h"
 #include "test_yaffs_remount_force_on_read_only_off.h"
 #include "test_yaffs_remount_ENODEV.h"
 #include "test_yaffs_remount_EINVAL.h"
+#include "test_yaffs_remount_ENAMETOOLONG.h"
+
 
 #include "test_yaffs_freespace.h"
 #include "test_yaffs_freespace_EINVAL.h"
+#include "test_yaffs_freespace_ENAMETOOLONG.h"
 
 #include "test_yaffs_totalspace.h"
 #include "test_yaffs_totalspace_EINVAL.h"
+#include "test_yaffs_totalspace_ENAMETOOLONG.h"
 
 #include "test_yaffs_inodecount.h"
 #include "test_yaffs_inodecount_EINVAL.h"
+#include "test_yaffs_inodecount_ENAMETOOLONG.h"
 
 #include "test_yaffs_link.h"
 #include "test_yaffs_link_ENOENT.h"
 #include "test_yaffs_link_ENOENT4.h"
 #include "test_yaffs_link_ELOOP_dir.h"
 #include "test_yaffs_link_EROFS.h"
+#include "test_yaffs_link_ENAMETOOLONG.h"
+#include "test_yaffs_link_ENAMETOOLONG2.h"
 
 #include "test_yaffs_rmdir.h"
 #include "test_yaffs_rmdir_EBUSY.h"
 #include "test_yaffs_rmdir_ENOTDIR.h"
 #include "test_yaffs_rmdir_ELOOP_dir.h"
 #include "test_yaffs_rmdir_EROFS.h"
+#include "test_yaffs_rmdir_ENAMETOOLONG.h"
 
 #include "test_yaffs_rename.h"
 #include "test_yaffs_rename_ENOENT.h"
 #include "test_yaffs_rename_EEXISTS.h"
 #include "test_yaffs_rename_ELOOP_dir.h"
 #include "test_yaffs_rename_EROFS.h"
+#include "test_yaffs_rename_ENAMETOOLONG.h"
+#include "test_yaffs_rename_ENAMETOOLONG2.h"
 
 #include "test_yaffs_lstat.h"
 #include "test_yaffs_lstat_ENOENT.h"
 #include "test_yaffs_lstat_ENOTDIR.h"
+#include "test_yaffs_lstat_ENAMETOOLONG.h"
 
 #include "test_yaffs_flush.h"
 #include "test_yaffs_flush_EBADF.h"
 #include "test_yaffs_flush_EROFS.h"
+#include "test_yaffs_flush_NULL.h"
 
 #include "yaffsfs.h"
 #include "yaffs_error_converter.h"
@@ -251,6 +273,7 @@ test_template test_list[]={
        {test_yaffs_open_EACCES,test_yaffs_open_EACCES_clean,"test_yaffs_open_EACCES"},
        
        {test_yaffs_close_EBADF,test_yaffs_close_EBADF_clean,"test_yaffs_close_EBADF"},
+       {test_yaffs_close_NULL,test_yaffs_close_NULL_clean,"test_yaffs_close_NULL"},
 
        {test_yaffs_access,test_yaffs_access_clean,"test_yaffs_access"},
        {test_yaffs_access_EINVAL,test_yaffs_access_EINVAL_clean,"test_yaffs_access_EINVAL"},
@@ -261,6 +284,8 @@ test_template test_list[]={
        {test_yaffs_access_ELOOP,test_yaffs_access_ELOOP_clean,"test_yaffs_access_ELOOP"},
        {test_yaffs_access_EROFS,test_yaffs_access_EROFS_clean,"test_yaffs_access_EROFS"},
        {test_yaffs_access_EACCES,test_yaffs_access_EACCES_clean,"test_yaffs_access_EACCES"},
+       {test_yaffs_access_ENAMETOOLONG,test_yaffs_access_ENAMETOOLONG_clean,"test_yaffs_access_ENAMETOOLONG"},
+       {test_yaffs_access_NULL,test_yaffs_access_NULL_clean,"test_yaffs_access_NULL"},
 
        {test_yaffs_unlink, test_yaffs_unlink_clean,"test_yaffs_unlink"},
        {test_yaffs_unlink_EISDIR,test_yaffs_unlink_EISDIR_clean,"test_yaffs_unlink_EISDIR"},
@@ -293,6 +318,7 @@ test_template test_list[]={
        {test_yaffs_stat_ENOENT2,test_yaffs_stat_ENOENT2_clean,"test_yaffs_stat_ENOENT2"},
        {test_yaffs_stat_ELOOP,test_yaffs_stat_ELOOP_clean,"test_yaffs_stat_ELOOP"},
        {test_yaffs_truncate_ELOOP_dir,test_yaffs_truncate_ELOOP_dir_clean,"test_yaffs_truncate_ELOOP_dir"},
+       {test_yaffs_stat_ENAMETOOLONG,test_yaffs_stat_ENAMETOOLONG_clean,"test_yaffs_stat_ENAMETOOLONG"},
 
        {test_yaffs_fstat,test_yaffs_fstat_clean,"test_yaffs_fstat"},
        {test_yaffs_fstat_EBADF,test_yaffs_fstat_EBADF_clean,"test_yaffs_fstat_EBADF"},
@@ -311,6 +337,7 @@ test_template test_list[]={
        {test_yaffs_truncate_ENOENT2,test_yaffs_truncate_ENOENT2_clean,"test_yaffs_truncate_ENOENT2"},
        {test_yaffs_truncate_ELOOP,test_yaffs_truncate_ELOOP_clean,"test_yaffs_truncate_ELOOP"},
        {test_yaffs_truncate_EROFS,test_yaffs_truncate_EROFS_clean,"test_yaffs_truncate_EROFS"},
+       {test_yaffs_truncate_ENAMETOOLONG,test_yaffs_truncate_ENAMETOOLONG_clean,"test_yaffs_truncate_ENAMETOOLONG"},
 //     {test_yaffs_truncate_big_file,test_yaffs_truncate_big_file_clean,"test_yaffs_truncate_big_file"}, //this test does not work because the large number becomes 0 when the file is compiled.
 
        {test_yaffs_chmod,test_yaffs_chmod_clean,"test_yaffs_chmod"},
@@ -320,11 +347,14 @@ test_template test_list[]={
        {test_yaffs_chmod_ELOOP_dir,test_yaffs_chmod_ELOOP_dir_clean,"test_yaffs_chmod_ELOOP_dir"},
        {test_yaffs_chmod_ELOOP,test_yaffs_chmod_ELOOP_clean,"test_yaffs_chmod_ELOOP"},
        {test_yaffs_chmod_EROFS,test_yaffs_chmod_EROFS_clean,"test_yaffs_chmod_EROFS"},
+       {test_yaffs_chmod_ENAMETOOLONG,test_yaffs_chmod_ENAMETOOLONG_clean,"test_yaffs_chmod_ENAMETOOLONG"},
+       {test_yaffs_chmod_NULL,test_yaffs_chmod_NULL_clean,"test_yaffs_chmod_NULL"},
 
        {test_yaffs_fchmod,test_yaffs_fchmod_clean,"test_yaffs_fchmod"},
        {test_yaffs_fchmod_EBADF,test_yaffs_fchmod_EBADF_clean,"test_yaffs_fchmod_EBADF"},
        {test_yaffs_fchmod_EINVAL,test_yaffs_fchmod_EINVAL_clean,"test_yaffs_fchmod_EINVAL"},
        {test_yaffs_fchmod_EROFS,test_yaffs_fchmod_EROFS_clean,"test_yaffs_fchmod_EROFS"},
+       {test_yaffs_fchmod_NULL,test_yaffs_fchmod_NULL_clean,"test_yaffs_fchmod_NULL"},
 
        {test_yaffs_fsync,test_yaffs_fsync_clean,"test_yaffs_fsync"},
        {test_yaffs_fsync_EBADF,test_yaffs_fsync_EBADF_clean,"test_yaffs_fsync_EBADF"},
@@ -333,6 +363,7 @@ test_template test_list[]={
        {test_yaffs_fdatasync,test_yaffs_fdatasync_clean,"test_yaffs_fdatasync"},
        {test_yaffs_fdatasync_EBADF,test_yaffs_fdatasync_EBADF_clean,"test_yaffs_fdatasync_EBADF"},
        {test_yaffs_fdatasync_EROFS,test_yaffs_fdatasync_EROFS_clean,"test_yaffs_fdatasync_EROFS"},
+       {test_yaffs_fdatasync_NULL,test_yaffs_fdatasync_NULL_clean,"test_yaffs_fdatasync_NULL"},
 
        {test_yaffs_mkdir,test_yaffs_mkdir_clean,"test_yaffs_mkdir"},
        {test_yaffs_mkdir_EEXIST,test_yaffs_mkdir_EEXIST_clean,"test_yaffs_mkdir_EEXIST"},
@@ -340,6 +371,7 @@ test_template test_list[]={
        {test_yaffs_mkdir_ENOENT,test_yaffs_mkdir_ENOENT_clean,"test_yaffs_mkdir_ENOENT"},
        {test_yaffs_mkdir_ELOOP_dir,test_yaffs_mkdir_ELOOP_dir_clean,"test_yaffs_mkdir_ELOOP_dir"},
        {test_yaffs_mkdir_EROFS,test_yaffs_mkdir_EROFS_clean,"test_yaffs_mkdir_EROFS"},
+       {test_yaffs_mkdir_ENAMETOOLONG,test_yaffs_mkdir_ENAMETOOLONG_clean,"test_yaffs_mkdir_ENAMETOOLONG"},
 
 
        {test_yaffs_symlink,test_yaffs_symlink_clean,"test_yaffs_symlink"},
@@ -349,6 +381,7 @@ test_template test_list[]={
        {test_yaffs_symlink_ENOENT2,test_yaffs_symlink_ENOENT2_clean,"test_yaffs_symlink_ENOENT2"},
        {test_yaffs_symlink_ELOOP_dir,test_yaffs_symlink_ELOOP_dir_clean,"test_yaffs_symlink_ELOOP_dir"},
        {test_yaffs_symlink_EROFS,test_yaffs_symlink_EROFS_clean,"test_yaffs_symlink_EROFS"},
+       {test_yaffs_symlink_ENAMETOOLONG,test_yaffs_symlink_ENAMETOOLONG_clean,"test_yaffs_symlink_ENAMETOOLONG"},
 
        {test_yaffs_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"},
        {test_yaffs_mount2_ENODEV,test_yaffs_mount2_ENODEV_clean,"test_yaffs_mount2_ENODEV"},
@@ -363,21 +396,26 @@ test_template test_list[]={
        {test_yaffs_sync,test_yaffs_sync_clean,"test_yaffs_sync"},
        {test_yaffs_sync_ENODEV,test_yaffs_sync_ENODEV_clean,"test_yaffs_sync_ENODEV"},
        {test_yaffs_sync_EROFS,test_yaffs_sync_EROFS_clean,"test_yaffs_sync_EROFS"},
+       {test_yaffs_sync_ENAMETOOLONG,test_yaffs_sync_ENAMETOOLONG_clean,"test_yaffs_sync_ENAMETOOLONG"},
 
 
        {test_yaffs_remount_force_off_read_only_off,test_yaffs_remount_force_off_read_only_off_clean,"test_yaffs_remount_force_off_read_only_off"},
 {test_yaffs_remount_force_on_read_only_off,test_yaffs_remount_force_on_read_only_off_clean,"test_yaffs_remount_force_on_read_only_off"},
        {test_yaffs_remount_ENODEV,test_yaffs_remount_ENODEV_clean,"test_yaffs_remount_ENODEV"},
        {test_yaffs_remount_EINVAL,test_yaffs_remount_EINVAL_clean,"test_yaffs_remount_EINVAL"},
+       {test_yaffs_remount_ENAMETOOLONG,test_yaffs_remount_ENAMETOOLONG_clean,"test_yaffs_remount_ENAMETOOLONG"},
 
        {test_yaffs_freespace,test_yaffs_freespace_clean,"test_yaffs_freespace"},
        {test_yaffs_freespace_EINVAL,test_yaffs_freespace_EINVAL_clean,"test_yaffs_freespace_EINVAL"},
+       {test_yaffs_freespace_ENAMETOOLONG,test_yaffs_freespace_ENAMETOOLONG_clean,"test_yaffs_freespace_ENAMETOOLONG"},
 
        {test_yaffs_totalspace,test_yaffs_totalspace_clean,"test_yaffs_totalspace"},
        {test_yaffs_totalspace_EINVAL,test_yaffs_totalspace_EINVAL_clean,"test_yaffs_totalspace_EINVAL"},
+       {test_yaffs_totalspace_ENAMETOOLONG,test_yaffs_totalspace_ENAMETOOLONG_clean,"test_yaffs_totalspace_ENAMETOOLONG"},
 
        {test_yaffs_inodecount,test_yaffs_inodecount_clean,"test_yaffs_inodecount"},
        {test_yaffs_inodecount_EINVAL,test_yaffs_inodecount_EINVAL_clean,"test_yaffs_inodecount_EINVAL"},
+       {test_yaffs_inodecount_ENAMETOOLONG,test_yaffs_inodecount_ENAMETOOLONG_clean,"test_yaffs_inodecount_ENAMETOOLONG"},
 
        {test_yaffs_link,test_yaffs_link_clean,"test_yaffs_link"},
        {test_yaffs_link_ENOENT,test_yaffs_link_ENOENT_clean,"test_yaffs_link_ENOENT"},
@@ -389,6 +427,8 @@ test_template test_list[]={
        {test_yaffs_link_ENOENT4,test_yaffs_link_ENOENT4_clean,"test_yaffs_link_ENOENT4"},
        {test_yaffs_link_ELOOP_dir,test_yaffs_link_ELOOP_dir_clean,"test_yaffs_link_ELOOP_dir"},
        {test_yaffs_link_EROFS,test_yaffs_link_EROFS_clean,"test_yaffs_link_EROFS"},
+       {test_yaffs_link_ENAMETOOLONG,test_yaffs_link_ENAMETOOLONG_clean,"test_yaffs_link_ENAMETOOLONG"},
+       {test_yaffs_link_ENAMETOOLONG2,test_yaffs_link_ENAMETOOLONG2_clean,"test_yaffs_link_ENAMETOOLONG2"},
 
        {test_yaffs_rmdir,test_yaffs_rmdir_clean,"test_yaffs_rmdir"},
        {test_yaffs_rmdir_EBUSY,test_yaffs_rmdir_EBUSY_clean,"test_yaffs_rmdir_EBUSY"},
@@ -397,6 +437,7 @@ test_template test_list[]={
        {test_yaffs_rmdir_ENOTDIR,test_yaffs_rmdir_ENOTDIR_clean,"test_yaffs_rmdir_ENOTDIR"},
        {test_yaffs_rmdir_ELOOP_dir,test_yaffs_rmdir_ELOOP_dir_clean,"test_yaffs_rmdir_ELOOP_dir"},
        {test_yaffs_rmdir_EROFS,test_yaffs_rmdir_EROFS_clean,"test_yaffs_rmdir_EROFS"},
+       {test_yaffs_rmdir_ENAMETOOLONG,test_yaffs_rmdir_ENAMETOOLONG_clean,"test_yaffs_rmdir_ENAMETOOLONG"},
 
        {test_yaffs_stat_ELOOP_dir,test_yaffs_stat_ELOOP_dir_clean,"test_yaffs_stat_ELOOP_dir"},
 
@@ -412,14 +453,19 @@ test_template test_list[]={
        {test_yaffs_rename_EEXISTS,test_yaffs_rename_EEXISTS_clean,"test_yaffs_rename_EEXISTS"},
        {test_yaffs_rename_ELOOP_dir,test_yaffs_rename_ELOOP_dir_clean,"test_yaffs_rename_ELOOP_dir"},
        {test_yaffs_rename_EROFS,test_yaffs_rename_EROFS_clean,"test_yaffs_rename_EROFS"},
+       {test_yaffs_rename_ENAMETOOLONG,test_yaffs_rename_ENAMETOOLONG_clean,"test_yaffs_rename_ENAMETOOLONG"},
+       {test_yaffs_rename_ENAMETOOLONG2,test_yaffs_rename_ENAMETOOLONG2_clean,"test_yaffs_rename_ENAMETOOLONG2"},
 
        {test_yaffs_lstat,test_yaffs_lstat_clean,"test_yaffs_lstat"},
        {test_yaffs_lstat_ENOENT,test_yaffs_lstat_ENOENT_clean,"test_yaffs_lstat_ENOENT"},
        {test_yaffs_lstat_ENOTDIR,test_yaffs_lstat_ENOTDIR_clean,"test_yaffs_lstat_ENOTDIR"},
+       {test_yaffs_lstat_ENAMETOOLONG,test_yaffs_lstat_ENAMETOOLONG_clean,"test_yaffs_lstat_ENAMETOOLONG"},
 
        {test_yaffs_flush,test_yaffs_flush_clean,"test_yaffs_flush"},
        {test_yaffs_flush_EBADF,test_yaffs_flush_EBADF_clean,"test_yaffs_flush_EBADF"},
-       {test_yaffs_flush_EROFS,test_yaffs_flush_EROFS_clean,"test_yaffs_flush_EROFS"}
+       {test_yaffs_flush_EROFS,test_yaffs_flush_EROFS_clean,"test_yaffs_flush_EROFS"},
+       {test_yaffs_flush_NULL,test_yaffs_flush_NULL_clean,"test_yaffs_flush_NULL"}
+
 
        };
 
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_access_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_access_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..a233250
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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_access_ENAMETOOLONG.h"
+
+int test_yaffs_access_ENAMETOOLONG(void)
+{
+       int output=0;
+       int error=0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output= yaffs_access(file_name ,R_OK |W_OK);
+       if (output<0){
+               error=yaffs_get_error();
+               if ( abs(error)== ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("error does not match expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("accessed an existing file with the file system mounted as read only (which is a bad thing)\n",2);
+
+               return -1;
+       }
+}
+
+int test_yaffs_access_ENAMETOOLONG_clean(void)
+{
+       return EROFS_clean();
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_access_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_access_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..40dc027
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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_access_ENAMETOOLONG_h__
+#define __test_yaffs_access_ENAMETOOLONG_h__
+#include "lib.h"
+#include "yaffsfs.h"
+int test_yaffs_access_ENAMETOOLONG(void);
+int test_yaffs_access_ENAMETOOLONG_clean(void);
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_access_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_access_NULL.c
new file mode 100644 (file)
index 0000000..d9b2310
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * 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_access_NULL.h"
+
+int test_yaffs_access_NULL(void)
+{
+       int output=0;
+       int error=0;
+       if (set_up_ELOOP()<0){
+               print_message("failed to setup symlinks\n",2);
+               return -1;
+       }
+       output= yaffs_access(NULL,0);
+       if (output<0){
+               error=yaffs_get_error();
+               if ( abs(error)== ELOOP){
+                       return 1;
+               } else {
+                       print_message("error does not match expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("accessed an existing file with bad mode (which is a bad thing\n",2);
+
+               return -1;
+       }
+}
+
+int test_yaffs_access_NULL_clean(void)
+{
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_access_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_access_NULL.h
new file mode 100644 (file)
index 0000000..f9e2bf8
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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_access_NULL_h__
+#define __test_yaffs_access_NULL_h__
+#include "lib.h"
+#include "yaffsfs.h"
+int test_yaffs_access_NULL(void);
+int test_yaffs_access_NULL_clean(void);
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_chmod_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_chmod_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..9c7faa3
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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_chmod_ENAMETOOLONG.h"
+
+int test_yaffs_chmod_ENAMETOOLONG(void)
+{
+       int error=0;
+       int output;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output = yaffs_chmod(file_name,S_IREAD|S_IWRITE);
+
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("chmoded with EROFS setup (which is a bad thing)\n",2);
+               return -1;
+       }
+
+}
+
+int test_yaffs_chmod_ENAMETOOLONG_clean(void)
+{
+       return test_yaffs_chmod() ;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_chmod_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_chmod_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..5d6686e
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_chmod_ENAMETOOLONG_h__
+#define __test_yaffs_chmod_ENAMETOOLONG_h__
+       
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_chmod.h"
+
+int test_yaffs_chmod_ENAMETOOLONG(void);       
+int test_yaffs_chmod_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_chmod_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_chmod_NULL.c
new file mode 100644 (file)
index 0000000..b0c1793
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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_chmod_NULL.h"
+
+int test_yaffs_chmod_NULL(void)
+{
+       int error=0;
+       int output;
+
+       output = yaffs_chmod(NULL,11111);
+
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EINVAL){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("chmoded the file (which is a bad thing)\n",2);
+               return -1;
+       }
+
+}
+
+int test_yaffs_chmod_NULL_clean(void)
+{
+       return test_yaffs_chmod();
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_chmod_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_chmod_NULL.h
new file mode 100644 (file)
index 0000000..ec589e8
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_chmod_NULL_h__
+#define __test_yaffs_chmod_NULL_h__
+       
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_chmod.h"
+
+int test_yaffs_chmod_NULL(void);       
+int test_yaffs_chmod_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_close_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_close_NULL.c
new file mode 100644 (file)
index 0000000..096f783
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/* generates a EBADF error by closing a handle twice */
+
+#include "test_yaffs_close_NULL.h"
+
+static int handle = -1;
+
+int test_yaffs_close_NULL(void)
+{
+       int output = 0;
+       int error_code = 0;
+
+
+       output = yaffs_close(NULL);
+       if (output < 0){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == EBADF){
+                       handle =-1;
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("closed a NULL handle. (which is a bad thing)\n", 2);
+               return -1;
+       }
+
+}
+
+
+int test_yaffs_close_NULL_clean(void)
+{
+       if (handle >= 0){
+               printf("handle %d\n",handle);
+               return yaffs_close(handle);
+       } else {
+               return 1;
+       }
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_close_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_close_NULL.h
new file mode 100644 (file)
index 0000000..901d2d2
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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_close_NULL_h__
+#define __test_yaffs_close_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_close_NULL(void);
+int test_yaffs_close_NULL_clean(void);
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c
new file mode 100644 (file)
index 0000000..2bc5005
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * 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_fchmod_NULL.h"
+
+
+int test_yaffs_fchmod_NULL(void)
+{
+       int error = 0;
+       int output = 0;
+
+       output = yaffs_fchmod(NULL,S_IREAD|S_IWRITE);
+
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EBADF){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("chmoded an non-existing file (which is a bad thing)\n",2);
+               return -1;
+       }
+
+
+}
+
+int test_yaffs_fchmod_NULL_clean(void)
+{
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.h
new file mode 100644 (file)
index 0000000..0197876
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_fchmod_NULL_h__
+#define __test_yaffs_fchmod_NULL_h__
+       
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_fchmod_NULL(void);      
+int test_yaffs_fchmod_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c
new file mode 100644 (file)
index 0000000..801d7a9
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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_fdatasync_NULL.h"
+
+
+
+int test_yaffs_fdatasync_NULL(void)
+{
+       int output = 0;
+       int error_code = 0;
+       output = yaffs_fdatasync(NULL);
+       if (output==-1){
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EBADF){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("non existant file synced.(which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_fdatasync_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.h
new file mode 100644 (file)
index 0000000..5c2b8df
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_fdatasync_NULL_h__
+#define __test_yaffs_fdatasync_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_fdatasync_NULL(void);
+int test_yaffs_fdatasync_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.c
new file mode 100644 (file)
index 0000000..d6bd625
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * 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_flush_NULL.h"
+
+
+
+int test_yaffs_flush_NULL(void)
+{
+       int output=0;
+       int error =0;
+       output = yaffs_flush(NULL);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EBADF){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("flushed a bad handle (which is a bad thing)\n",2);
+               return -1;
+       }
+
+}
+
+
+int test_yaffs_flush_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.h
new file mode 100644 (file)
index 0000000..deb98ff
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_flush_NULL_h__
+#define __test_yaffs_flush_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_close.h"
+
+int test_yaffs_flush_NULL(void);
+int test_yaffs_flush_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_freespace_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_freespace_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..40f2d35
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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_freespace_ENAMETOOLONG.h"
+
+
+
+int test_yaffs_freespace_ENAMETOOLONG(void)
+{
+       int output=0;
+       int error=0;
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+       output = yaffs_freespace(file_name);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("got the free space of a non existing mountpoint (which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_freespace_ENAMETOOLONG_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_freespace_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_freespace_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..11e4cbe
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_freespace_ENAMETOOLONG_h__
+#define __test_yaffs_freespace_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_freespace_ENAMETOOLONG(void);
+int test_yaffs_freespace_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_inodecount_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_inodecount_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..432c6ce
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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_inodecount_ENAMETOOLONG.h"
+
+
+
+int test_yaffs_inodecount_ENAMETOOLONG(void)
+{
+       int output=0;
+       int error=0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output = yaffs_inodecount(file_name);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("got the inodecount of a non existing mountpoint (which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_inodecount_ENAMETOOLONG_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_inodecount_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_inodecount_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..a0d91ac
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_inodecount_ENAMETOOLONG_h__
+#define __test_yaffs_inodecount_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_inodecount_ENAMETOOLONG(void);
+int test_yaffs_inodecount_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..ed3ddb5
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * 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_link_ENAMETOOLONG.h"
+
+
+
+int test_yaffs_link_ENAMETOOLONG(void)
+{
+       int output=0;   
+       int error =0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+
+       output = yaffs_link(file_name,HARD_LINK_PATH);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a hard link with EROFS set (which is a bad thing)\n",2);
+               return -1;      
+       }
+}
+
+
+int test_yaffs_link_ENAMETOOLONG_clean(void)
+{
+       int output=0;   
+       int error =0;
+       output= yaffs_unlink(HARD_LINK_PATH);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENOENT){
+                       //if the file does not exist then the error should be ENOENT.
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               return 1;       /* the file failed to open so there is no need to close it */
+       }
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..271002d
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_link_ENAMETOOLONG_h__
+#define __test_yaffs_link_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_ENAMETOOLONG(void);
+int test_yaffs_link_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG2.c b/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG2.c
new file mode 100644 (file)
index 0000000..b7d917d
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * 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_link_ENAMETOOLONG2.h"
+
+
+
+int test_yaffs_link_ENAMETOOLONG2(void)
+{
+       int output=0;   
+       int error =0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+
+       output = yaffs_link(FILE_PATH,file_name);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a hard link with EROFS set (which is a bad thing)\n",2);
+               return -1;      
+       }
+}
+
+
+int test_yaffs_link_ENAMETOOLONG2_clean(void)
+{
+       int output=0;   
+       int error =0;
+       output= yaffs_unlink(HARD_LINK_PATH);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENOENT){
+                       //if the file does not exist then the error should be ENOENT.
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               return 1;       /* the file failed to open so there is no need to close it */
+       }
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG2.h b/direct/timothy_tests/quick_tests/test_yaffs_link_ENAMETOOLONG2.h
new file mode 100644 (file)
index 0000000..11e636e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_link_ENAMETOOLONG2_h__
+#define __test_yaffs_link_ENAMETOOLONG2_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_ENAMETOOLONG2(void);
+int test_yaffs_link_ENAMETOOLONG2_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lstat_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_lstat_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..466890c
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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_lstat_ENAMETOOLONG.h"
+
+
+int test_yaffs_lstat_ENAMETOOLONG(void)
+{
+       int output = -1;
+       int error_code = -1;
+       struct yaffs_stat stat;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+       output =yaffs_lstat(file_name,&stat);
+       if (output<0){
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n", 2);
+                       return -1;
+               }
+       } else {
+               print_message("lstatted a non-existing file\n", 2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_lstat_ENAMETOOLONG_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lstat_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_lstat_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..5b3baa6
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_lstat_ENAMETOOLONG_h__
+#define __test_yaffs_lstat_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_lstat_ENAMETOOLONG(void);
+int test_yaffs_lstat_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mkdir_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_mkdir_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..dba259e
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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_mkdir_ENAMETOOLONG.h"
+
+static int output = -1;
+
+int test_yaffs_mkdir_ENAMETOOLONG(void)
+{
+       int error_code = 0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output = yaffs_mkdir(file_name,O_CREAT | O_RDWR);
+       if (output < 0){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n", 2);
+                       return -1;
+               }
+       } else {
+               print_message("created a new directory on top of an non-existing directory (which is a bad thing)\n", 2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_mkdir_ENAMETOOLONG_clean(void)
+{
+       if (output >= 0){
+               return yaffs_rmdir(DIR_PATH);
+       } else {
+               return 1;       
+       }
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mkdir_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_mkdir_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..5b8528c
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_mkdir_ENAMETOOLONG_h__
+#define __test_yaffs_mkdir_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_mkdir_ENAMETOOLONG(void);
+int test_yaffs_mkdir_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_remount_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_remount_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..6bde97c
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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_remount_ENAMETOOLONG.h"
+
+int test_yaffs_remount_ENAMETOOLONG(void)
+{
+       int output = -1;
+       int error_code =0;
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+       output = yaffs_remount(file_name,0,0);
+       if (output<0){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("remounted a non-existing-dir\n",2);
+               return -1;
+       }
+}
+
+int test_yaffs_remount_ENAMETOOLONG_clean(void)
+{
+       int output=0;
+       int error_code =0;
+       output= yaffs_mount(YAFFS_MOUNT_POINT);
+       if (output<0){
+               error_code=yaffs_get_error();
+               if (abs(error_code) == EBUSY){
+                       return 1;
+               } else {
+                       return -1;
+               }
+       }
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_remount_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_remount_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..f4b5b67
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_remount_ENAMETOOLONG__
+#define __test_yaffs_remount_ENAMETOOLONG__
+
+#include "yaffsfs.h"
+#include "lib.h"
+#include "test_yaffs_unmount.h"
+
+int test_yaffs_remount_ENAMETOOLONG(void);
+int test_yaffs_remount_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..0c45302
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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_rename_ENAMETOOLONG.h"
+
+
+int test_yaffs_rename_ENAMETOOLONG(void)
+{
+       int output=0;
+       int error_code =0;
+
+       
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output = yaffs_rename(file_name , RENAME_PATH);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("renamed a ELOOP (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+
+int test_yaffs_rename_ENAMETOOLONG_clean(void)
+{
+       return 1;
+
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..56d4ce3
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_rename_ENAMETOOLONG_h__
+#define __test_yaffs_rename_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rename_ENAMETOOLONG(void);
+int test_yaffs_rename_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG2.c b/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG2.c
new file mode 100644 (file)
index 0000000..d3cfcc3
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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_rename_ENAMETOOLONG2.h"
+
+
+int test_yaffs_rename_ENAMETOOLONG2(void)
+{
+       int output=0;
+       int error_code =0;
+
+       
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output = yaffs_rename(FILE_PATH, file_name);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("renamed a ELOOP (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+
+int test_yaffs_rename_ENAMETOOLONG2_clean(void)
+{
+       return 1;
+
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG2.h b/direct/timothy_tests/quick_tests/test_yaffs_rename_ENAMETOOLONG2.h
new file mode 100644 (file)
index 0000000..8a1d9ce
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_rename_ENAMETOOLONG2_h__
+#define __test_yaffs_rename_ENAMETOOLONG2_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rename_ENAMETOOLONG2(void);
+int test_yaffs_rename_ENAMETOOLONG2_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rmdir_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_rmdir_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..a7942df
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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_rmdir_ENAMETOOLONG.h"
+
+
+int test_yaffs_rmdir_ENAMETOOLONG(void)
+{
+       int output=0;
+       int error_code =0;
+
+       
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+
+       if (0 !=  yaffs_access(DIR_PATH,0)) {
+               output = yaffs_mkdir(DIR_PATH,S_IWRITE | S_IREAD);
+               if (output < 0) {
+                       print_message("failed to create directory\n",2);
+                       return -1;
+               }
+       }
+       output = yaffs_rmdir(file_name);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("removed /yaffs2/ directory (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+
+int test_yaffs_rmdir_ENAMETOOLONG_clean(void)
+{
+       int output = 0;
+       if (0 ==  yaffs_access(DIR_PATH,0)) {
+               output = yaffs_rmdir(DIR_PATH);
+               if (output < 0) {
+                       print_message("failed to remove the directory\n",2);
+                       return -1;
+               }
+       }
+       return 1;
+
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rmdir_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_rmdir_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..7ed43b8
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_rmdir_ENAMETOOLONG_h__
+#define __test_yaffs_rmdir_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rmdir_ENAMETOOLONG(void);
+int test_yaffs_rmdir_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..826a2d2
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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_stat_ENAMETOOLONG.h"
+
+int test_yaffs_stat_ENAMETOOLONG(void)
+{
+       int error_code=0;
+       struct yaffs_stat stat;
+       int output=0;
+       char text[100];
+       text[0] ='\0';
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output=yaffs_stat(file_name, &stat);;
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("stated a ELOOP (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+int test_yaffs_stat_ENAMETOOLONG_clean(void)
+{
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..b4b0260
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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_stat_ENAMETOOLONG_h__
+#define __test_yaffs_stat_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_stat_ENAMETOOLONG(void);
+int test_yaffs_stat_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_symlink_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_symlink_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..f4b0072
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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_ENAMETOOLONG.h"
+
+static int output = 0;
+
+int test_yaffs_symlink_ENAMETOOLONG(void)
+{
+       int error_code = 0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+       output = yaffs_symlink(file_name,SYMLINK_PATH);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a symlink with ENAMETOOLONG (which is a bad thing)\n",2);
+               return -1;
+       }       
+
+}
+
+int test_yaffs_symlink_ENAMETOOLONG_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 */
+       }
+}
+
+
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_symlink_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_symlink_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..4d05ab2
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_ENAMETOOLONG_h__
+#define __test_yaffs_symlink_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_symlink_ENAMETOOLONG(void);
+int test_yaffs_symlink_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_sync_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_sync_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..d899836
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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_sync_ENAMETOOLONG.h"
+
+
+int test_yaffs_sync_ENAMETOOLONG(void)
+{
+       int error_code=-1;
+       int output=0;
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+       
+
+
+       output = yaffs_sync(file_name);
+       
+       if (output<0){
+               error_code=yaffs_get_error();
+               if (abs(error_code)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("synced a file in a non-existing directory (which is a bad thing)\n",2);
+               return -1;
+       }       
+
+
+}
+
+
+int test_yaffs_sync_ENAMETOOLONG_clean(void)
+{
+       return  1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_sync_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_sync_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..1db7146
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_sync_ENAMETOOLONG_h__
+#define __test_yaffs_sync_ENAMETOOLONG_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_sync_ENAMETOOLONG(void);
+int test_yaffs_sync_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_totalspace_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_totalspace_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..c31f389
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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_totalspace_ENAMETOOLONG.h"
+
+
+
+int test_yaffs_totalspace_ENAMETOOLONG(void)
+{
+       int output=0;
+       int error=0;
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+
+       output = yaffs_totalspace(file_name);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("got the totalspace of a non existing mountpoint (which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_totalspace_ENAMETOOLONG_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_totalspace_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_totalspace_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..487ae8d
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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_ENAMETOOLONG_EINVAL_h__
+#define __test_yaffs_ENAMETOOLONG_EINVAL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_totalspace_ENAMETOOLONG(void);
+int test_yaffs_totalspace_ENAMETOOLONG_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_truncate_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_truncate_ENAMETOOLONG.c
new file mode 100644 (file)
index 0000000..cbd91da
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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_truncate_ENAMETOOLONG.h"
+
+
+
+int test_yaffs_truncate_ENAMETOOLONG(void)
+{
+       int error=0;
+       int output=0;
+
+       int file_name_length=1000000;
+       char file_name[file_name_length];
+       int x=0;
+       for (x=0; x<file_name_length -1; x++){
+               file_name[x]='a';
+       }
+       file_name[file_name_length-2]='\0';
+
+       output= yaffs_truncate(file_name,FILE_SIZE_TRUNCATED );
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==ENAMETOOLONG){
+                       return 1;
+               } else {
+                       print_message("received a different error than expected\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("truncated a nonexisting file\n",2);
+               return -1;
+       }
+}
+
+int test_yaffs_truncate_ENAMETOOLONG_clean(void)
+{
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_truncate_ENAMETOOLONG.h b/direct/timothy_tests/quick_tests/test_yaffs_truncate_ENAMETOOLONG.h
new file mode 100644 (file)
index 0000000..fd4ef73
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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_truncate_ENAMETOOLONG_h__
+#define __test_yaffs_truncate_ENAMETOOLONG_h__
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+int test_yaffs_truncate_ENAMETOOLONG(void);
+int test_yaffs_truncate_ENAMETOOLONG_clean(void); 
+#endif