yaffs Added more tests to direct/timothy_tests/quick_tests
authorTimothy Manning <tfhmanning@gmail.com>
Tue, 30 Nov 2010 21:22:30 +0000 (10:22 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Tue, 30 Nov 2010 21:23:59 +0000 (10:23 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
42 files changed:
direct/timothy_tests/quick_tests/Makefile
direct/timothy_tests/quick_tests/quick_tests.h
direct/timothy_tests/quick_tests/test_yaffs_freespace_NULL.c [moved from direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.c with 69% similarity]
direct/timothy_tests/quick_tests/test_yaffs_freespace_NULL.h [moved from direct/timothy_tests/quick_tests/test_yaffs_flush_NULL.h with 76% similarity]
direct/timothy_tests/quick_tests/test_yaffs_inodecount_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_inodecount_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_NULL2.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_link_NULL2.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_lstat_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_lstat_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_mkdir_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_mkdir_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_mount_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_mount_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_open_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_open_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_remount_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_remount_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_NULL2.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rename_NULL2.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rmdir_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_rmdir_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_stat_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_stat_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL2.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL2.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_sync_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_sync_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_totalspace_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_totalspace_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_truncate_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_truncate_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_unlink_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_unlink_NULL.h [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c [new file with mode: 0644]
direct/timothy_tests/quick_tests/test_yaffs_unmount_NULL.h [new file with mode: 0644]

index 906e0df..dbefa93 100644 (file)
@@ -47,17 +47,20 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
 
 TESTFILES =    quick_tests.o lib.o \
                test_yaffs_mount.o test_yaffs_mount_ENODEV.o test_yaffs_mount_ENAMETOOLONG.o test_yaffs_mount_EBUSY.o \
+               test_yaffs_mount_NULL.o \
                test_yaffs_unmount.o test_yaffs_unmount_ENODEV.o test_yaffs_unmount_ENAMETOOLONG.o test_yaffs_unmount_EBUSY.o \
                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_open_ELOOP.o \
-               test_yaffs_open_ELOOP_dir.o test_yaffs_open_EROFS.o test_yaffs_open_EACCES.o \
+               test_yaffs_open_ELOOP_dir.o test_yaffs_open_EROFS.o test_yaffs_open_EACCES.o test_yaffs_open_NULL.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_unlink_ENOENT2.o test_yaffs_unlink_ELOOP_dir.o test_yaffs_unlink_EROFS.o \
+               test_yaffs_unlink_NULL.o \
                test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_big_file.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_ENAMETOOLONG.o \
+               test_yaffs_truncate_NULL.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 \
@@ -65,7 +68,7 @@ TESTFILES =   quick_tests.o lib.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_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_ENAMETOOLONG.o \
+               test_yaffs_stat_ELOOP_dir.o test_yaffs_stat_ENAMETOOLONG.o test_yaffs_stat_NULL.o \
                test_yaffs_fstat.o test_yaffs_fstat_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 \
@@ -75,31 +78,34 @@ TESTFILES =         quick_tests.o lib.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_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_mkdir_ENAMETOOLONG.o \
+               test_yaffs_mkdir_ELOOP_dir.o test_yaffs_mkdir_EROFS.o test_yaffs_mkdir_ENAMETOOLONG.o test_yaffs_mkdir_NULL.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_ENAMETOOLONG.o\
+               test_yaffs_symlink_NULL.o test_yaffs_symlink_NULL2.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_ENAMETOOLONG.o \
+               test_yaffs_sync_NULL.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_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_remount_EINVAL.o test_yaffs_remount_ENAMETOOLONG.o test_yaffs_remount_NULL.o test_yaffs_unmount_NULL.o \
+               test_yaffs_freespace.o test_yaffs_freespace_EINVAL.o test_yaffs_freespace_ENAMETOOLONG.o test_yaffs_freespace_NULL.o \
+               test_yaffs_totalspace.o test_yaffs_totalspace_EINVAL.o test_yaffs_totalspace_ENAMETOOLONG.o test_yaffs_totalspace_NULL.o\
+               test_yaffs_inodecount.o test_yaffs_inodecount_EINVAL.o test_yaffs_inodecount_ENAMETOOLONG.o test_yaffs_inodecount_NULL.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_ENAMETOOLONG.o \
-               test_yaffs_link_ENAMETOOLONG2.o \
+               test_yaffs_link_ENAMETOOLONG2.o test_yaffs_link_NULL.o test_yaffs_link_NULL2.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_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_rename_ENAMETOOLONG.o test_yaffs_rename_ENAMETOOLONG2.o \
+               test_yaffs_rename_ENAMETOOLONG.o test_yaffs_rename_ENAMETOOLONG2.o test_yaffs_rename_NULL.o test_yaffs_rename_NULL2.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
+               test_yaffs_lstat_NULL.o \
+               test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o 
 
 
                  
index 05b8503..e046eec 100644 (file)
@@ -21,6 +21,7 @@
 #include "test_yaffs_mount_ENODEV.h"
 #include "test_yaffs_mount_ENAMETOOLONG.h"
 #include "test_yaffs_mount_EBUSY.h"
+#include "test_yaffs_mount_NULL.h"
 
 #include "test_yaffs_unmount.h"
 #include "test_yaffs_unmount_ENODEV.h"
@@ -39,6 +40,7 @@
 #include "test_yaffs_open_ELOOP_dir.h"
 #include "test_yaffs_open_EROFS.h"
 #include "test_yaffs_open_EACCES.h"
+#include "test_yaffs_open_NULL.h"
 
 #include "test_yaffs_close_EBADF.h"
 #include "test_yaffs_close_NULL.h"
@@ -52,6 +54,7 @@
 #include "test_yaffs_unlink_ENOENT2.h"
 #include "test_yaffs_unlink_ELOOP_dir.h"
 #include "test_yaffs_unlink_EROFS.h"
+#include "test_yaffs_unlink_NULL.h"
 
 #include "test_yaffs_ftruncate.h"
 #include "test_yaffs_ftruncate_EBADF.h"
@@ -71,6 +74,7 @@
 #include "test_yaffs_truncate_ELOOP_dir.h"
 #include "test_yaffs_truncate_EROFS.h"
 #include "test_yaffs_truncate_ENAMETOOLONG.h"
+#include "test_yaffs_truncate_NULL.h"
 
 #include "test_yaffs_write.h"
 #include "test_yaffs_write_EBADF.h"
 #include "test_yaffs_stat_ELOOP.h"
 #include "test_yaffs_stat_ELOOP_dir.h"
 #include "test_yaffs_stat_ENAMETOOLONG.h"
+#include "test_yaffs_stat_NULL.h"
 
 #include "test_yaffs_fstat.h"
 #include "test_yaffs_fstat_EBADF.h"
 #include "test_yaffs_mkdir_ELOOP_dir.h"
 #include "test_yaffs_mkdir_EROFS.h"
 #include "test_yaffs_mkdir_ENAMETOOLONG.h"
+#include "test_yaffs_mkdir_NULL.h"
 
 #include "test_yaffs_symlink.h"
 #include "test_yaffs_symlink_ENOTDIR.h"
 #include "test_yaffs_symlink_ELOOP_dir.h"
 #include "test_yaffs_symlink_EROFS.h"
 #include "test_yaffs_symlink_ENAMETOOLONG.h"
+#include "test_yaffs_symlink_NULL.h"
+#include "test_yaffs_symlink_NULL2.h"
 
 #include "test_yaffs_mount2.h"
 #include "test_yaffs_mount2_ENODEV.h"
 #include "test_yaffs_unmount2_EINVAL.h"
 #include "test_yaffs_unmount2_with_handle_open_and_forced_mode_on.h"
 #include "test_yaffs_unmount2_with_handle_open_and_forced_mode_off.h"
+#include "test_yaffs_unmount_NULL.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_sync_NULL.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_remount_NULL.h"
 
 #include "test_yaffs_freespace.h"
 #include "test_yaffs_freespace_EINVAL.h"
 #include "test_yaffs_freespace_ENAMETOOLONG.h"
+#include "test_yaffs_freespace_NULL.h"
 
 #include "test_yaffs_totalspace.h"
 #include "test_yaffs_totalspace_EINVAL.h"
 #include "test_yaffs_totalspace_ENAMETOOLONG.h"
+#include "test_yaffs_totalspace_NULL.h"
 
 #include "test_yaffs_inodecount.h"
 #include "test_yaffs_inodecount_EINVAL.h"
 #include "test_yaffs_inodecount_ENAMETOOLONG.h"
+#include "test_yaffs_inodecount_NULL.h"
 
 #include "test_yaffs_link.h"
 #include "test_yaffs_link_ENOENT.h"
 #include "test_yaffs_link_EROFS.h"
 #include "test_yaffs_link_ENAMETOOLONG.h"
 #include "test_yaffs_link_ENAMETOOLONG2.h"
+#include "test_yaffs_link_NULL.h"
+#include "test_yaffs_link_NULL2.h"
 
 #include "test_yaffs_rmdir.h"
 #include "test_yaffs_rmdir_EBUSY.h"
 #include "test_yaffs_rename_EROFS.h"
 #include "test_yaffs_rename_ENAMETOOLONG.h"
 #include "test_yaffs_rename_ENAMETOOLONG2.h"
+#include "test_yaffs_rename_NULL.h"
+#include "test_yaffs_rename_NULL2.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_lstat_NULL.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"
@@ -253,6 +271,7 @@ test_template test_list[]={
        {test_yaffs_mount_ENODEV,test_yaffs_mount_ENODEV_clean,"test_yaffs_mount_ENODEV"},
        {test_yaffs_mount_ENAMETOOLONG,test_yaffs_mount_ENAMETOOLONG_clean,"test_yaffs_mount_ENAMETOOLONG"},
        {test_yaffs_mount_EBUSY,test_yaffs_mount_EBUSY_clean,"test_yaffs_mount_EBUSY"},
+       {test_yaffs_mount_NULL,test_yaffs_mount_NULL_clean,"test_yaffs_mount_NULL"},
 
        {test_yaffs_unmount,test_yaffs_unmount_clean,"test_yaffs_unmount"},
        {test_yaffs_unmount_ENODEV,test_yaffs_unmount_ENODEV_clean,"test_yaffs_unmount_ENODEV"},
@@ -271,7 +290,9 @@ test_template test_list[]={
        {test_yaffs_open_ELOOP_dir,test_yaffs_open_ELOOP_dir_clean,"test_yaffs_open_ELOOP_dir"},
        {test_yaffs_open_EROFS,test_yaffs_open_EROFS_clean,"test_yaffs_open_EROFS"},
        {test_yaffs_open_EACCES,test_yaffs_open_EACCES_clean,"test_yaffs_open_EACCES"},
-       
+       {test_yaffs_open_NULL,test_yaffs_open_NULL_clean,"test_yaffs_open_NULL"},
+
+
        {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"},
 
@@ -296,7 +317,7 @@ test_template test_list[]={
        {test_yaffs_unlink_ENOENT2,test_yaffs_unlink_ENOENT2_clean,"test_yaffs_unlink_ENOENT2"},
        {test_yaffs_unlink_ELOOP_dir,test_yaffs_unlink_ELOOP_dir_clean,"test_yaffs_unlink_ELOOP_dir"},
        {test_yaffs_unlink_EROFS,test_yaffs_unlink_EROFS_clean,"test_yaffs_unlink_EROFS"},
-
+       {test_yaffs_unlink_NULL,test_yaffs_unlink_NULL_clean,"test_yaffs_unlink_NULL"},
 
        {test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"},
        {test_yaffs_lseek_EBADF,test_yaffs_lseek_EBADF_clean,"test_yaffs_lseek_EBADF"},
@@ -317,8 +338,8 @@ test_template test_list[]={
        {test_yaffs_stat_ENOTDIR,test_yaffs_stat_ENOTDIR_clean,"test_yaffs_stat_ENOTDIR"},
        {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_stat_NULL,test_yaffs_stat_NULL_clean,"test_yaffs_stat_NULL"},
 
        {test_yaffs_fstat,test_yaffs_fstat_clean,"test_yaffs_fstat"},
        {test_yaffs_fstat_EBADF,test_yaffs_fstat_EBADF_clean,"test_yaffs_fstat_EBADF"},
@@ -336,8 +357,10 @@ test_template test_list[]={
        {test_yaffs_truncate_ENOENT,test_yaffs_truncate_ENOENT_clean,"test_yaffs_truncate_ENOENT"},
        {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_ELOOP_dir,test_yaffs_truncate_ELOOP_dir_clean,"test_yaffs_truncate_ELOOP_dir"},
        {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_NULL,test_yaffs_truncate_NULL_clean,"test_yaffs_truncate_NULL"},
 //     {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"},
@@ -372,6 +395,7 @@ test_template test_list[]={
        {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_mkdir_NULL,test_yaffs_mkdir_NULL_clean,"test_yaffs_mkdir_NULL"},
 
 
        {test_yaffs_symlink,test_yaffs_symlink_clean,"test_yaffs_symlink"},
@@ -382,6 +406,8 @@ test_template test_list[]={
        {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_symlink_NULL,test_yaffs_symlink_NULL_clean,"test_yaffs_symlink_NULL"},
+       {test_yaffs_symlink_NULL2,test_yaffs_symlink_NULL2_clean,"test_yaffs_symlink_NULL2"},
 
        {test_yaffs_mount2,test_yaffs_mount2_clean,"test_yaffs_mount2"},
        {test_yaffs_mount2_ENODEV,test_yaffs_mount2_ENODEV_clean,"test_yaffs_mount2_ENODEV"},
@@ -392,11 +418,13 @@ test_template test_list[]={
        {test_yaffs_unmount2_EINVAL,test_yaffs_unmount2_EINVAL_clean,"test_yaffs_unmount2_EINVAL"},
 {test_yaffs_unmount2_with_handle_open_and_forced_mode_on,test_yaffs_unmount2_with_handle_open_and_forced_mode_on_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_on"},
 {test_yaffs_unmount2_with_handle_open_and_forced_mode_off,test_yaffs_unmount2_with_handle_open_and_forced_mode_off_clean,"test_yaffs_unmount2_with_handle_open_and_forced_mode_off"},
+       {test_yaffs_unmount_NULL,test_yaffs_unmount_NULL_clean,"test_yaffs_unmount_NULL"},
 
        {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_sync_NULL,test_yaffs_sync_NULL_clean,"test_yaffs_sync_NULL"},
 
 
        {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"},
@@ -404,18 +432,22 @@ test_template test_list[]={
        {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_remount_NULL,test_yaffs_remount_NULL_clean,"test_yaffs_remount_NULL"},
 
        {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_freespace_NULL,test_yaffs_freespace_NULL_clean,"test_yaffs_freespace_NULL"},
 
        {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_totalspace_NULL,test_yaffs_totalspace_NULL_clean,"test_yaffs_totalspace_NULL"},
 
        {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_inodecount_NULL,test_yaffs_inodecount_NULL_clean,"test_yaffs_inodecount_NULL"},
 
        {test_yaffs_link,test_yaffs_link_clean,"test_yaffs_link"},
        {test_yaffs_link_ENOENT,test_yaffs_link_ENOENT_clean,"test_yaffs_link_ENOENT"},
@@ -429,6 +461,8 @@ test_template test_list[]={
        {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_link_NULL,test_yaffs_link_NULL_clean,"test_yaffs_link_NULL"},
+       {test_yaffs_link_NULL2,test_yaffs_link_NULL2_clean,"test_yaffs_link_NULL2"},
 
        {test_yaffs_rmdir,test_yaffs_rmdir_clean,"test_yaffs_rmdir"},
        {test_yaffs_rmdir_EBUSY,test_yaffs_rmdir_EBUSY_clean,"test_yaffs_rmdir_EBUSY"},
@@ -455,16 +489,19 @@ test_template test_list[]={
        {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_rename_NULL,test_yaffs_rename_NULL_clean,"test_yaffs_rename_NULL"},
+       {test_yaffs_rename_NULL2,test_yaffs_rename_NULL2_clean,"test_yaffs_rename_NULL2"},
 
        {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_lstat_NULL,test_yaffs_lstat_NULL_clean,"test_yaffs_lstat_NULL"},
 
        {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_NULL,test_yaffs_flush_NULL_clean,"test_yaffs_flush_NULL"}
+
 
 
        };
  * published by the Free Software Foundation.
  */
 
-#include "test_yaffs_flush_NULL.h"
+#include "test_yaffs_freespace_NULL.h"
 
 
 
-int test_yaffs_flush_NULL(void)
+int test_yaffs_freespace_NULL(void)
 {
        int output=0;
-       int error =0;
-       output = yaffs_flush(NULL);
+       int error=0;
+       output = yaffs_freespace(NULL);
        if (output<0){
                error=yaffs_get_error();
-               if (abs(error)==EBADF){
+               if (abs(error)==EFAULT){
                        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);
+               print_message("got the free space of a NULL mountpoint (which is a bad thing)\n",2);
                return -1;
        }
-
 }
 
 
-int test_yaffs_flush_NULL_clean(void)
+int test_yaffs_freespace_NULL_clean(void)
 {
        return 1;
 }
  * 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__
+#ifndef __test_yaffs_freespace_NULL_h__
+#define __test_yaffs_freespace_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);
+int test_yaffs_freespace_NULL(void);
+int test_yaffs_freespace_NULL_clean(void);
 
 #endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_inodecount_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_inodecount_NULL.c
new file mode 100644 (file)
index 0000000..cc4c5c2
--- /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_inodecount_NULL.h"
+
+
+
+int test_yaffs_inodecount_NULL(void)
+{
+       int output=0;
+       int error=0;
+       output = yaffs_inodecount(NULL);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EFAULT){
+                       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_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_inodecount_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_inodecount_NULL.h
new file mode 100644 (file)
index 0000000..05dee0b
--- /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_NULL_h__
+#define __test_yaffs_inodecount_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_inodecount_NULL(void);
+int test_yaffs_inodecount_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_link_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_link_NULL.c
new file mode 100644 (file)
index 0000000..b0b5b73
--- /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_link_NULL.h"
+
+
+
+int test_yaffs_link_NULL(void)
+{
+       int output=0;   
+       int error =0;
+       output = yaffs_link(NULL,HARD_LINK_PATH);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a hard link to a non-existing-file (which is a bad thing)\n",2);
+               return -1;      
+       }
+}
+
+
+int test_yaffs_link_NULL_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_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_link_NULL.h
new file mode 100644 (file)
index 0000000..d8ff17c
--- /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_NULL_h__
+#define __test_yaffs_link_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_NULL(void);
+int test_yaffs_link_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_link_NULL2.c b/direct/timothy_tests/quick_tests/test_yaffs_link_NULL2.c
new file mode 100644 (file)
index 0000000..0f8530d
--- /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_link_NULL2.h"
+
+
+
+int test_yaffs_link_NULL2(void)
+{
+       int output=0;   
+       int error =0;
+       output = yaffs_link(FILE_PATH,NULL);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a hard link to a non-existing-file (which is a bad thing)\n",2);
+               return -1;      
+       }
+}
+
+
+int test_yaffs_link_NULL2_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_NULL2.h b/direct/timothy_tests/quick_tests/test_yaffs_link_NULL2.h
new file mode 100644 (file)
index 0000000..af10217
--- /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_NULL2_h__
+#define __test_yaffs_link_NULL2_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_link_NULL2(void);
+int test_yaffs_link_NULL2_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lstat_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_lstat_NULL.c
new file mode 100644 (file)
index 0000000..f5f41a7
--- /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_lstat_NULL.h"
+
+
+int test_yaffs_lstat_NULL(void)
+{
+       int output = -1;
+       int error_code = -1;
+       struct yaffs_stat stat;
+
+       output =yaffs_lstat(NULL,&stat);
+       if (output<0){
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       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_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lstat_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_lstat_NULL.h
new file mode 100644 (file)
index 0000000..a5d4c96
--- /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_NULL_h__
+#define __test_yaffs_lstat_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_lstat_NULL(void);
+int test_yaffs_lstat_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mkdir_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_mkdir_NULL.c
new file mode 100644 (file)
index 0000000..57832a9
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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_NULL.h"
+
+static int output = -1;
+
+int test_yaffs_mkdir_NULL(void)
+{
+       int error_code = 0;
+       
+
+       output = yaffs_mkdir(NULL,O_CREAT | O_RDWR);
+       if (output < 0){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == EFAULT){
+                       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_NULL_clean(void)
+{
+       if (output >= 0){
+               return yaffs_rmdir(DIR_PATH);
+       } else {
+               return 1;       
+       }
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mkdir_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_mkdir_NULL.h
new file mode 100644 (file)
index 0000000..0a84931
--- /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_NULL_h__
+#define __test_yaffs_mkdir_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_mkdir_NULL(void);
+int test_yaffs_mkdir_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mount_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_mount_NULL.c
new file mode 100644 (file)
index 0000000..9fc6a2e
--- /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_mount_NULL.h"
+
+
+
+int test_yaffs_mount_NULL(void)
+{
+       int output=0;
+       int error_code=0;
+
+       output = yaffs_mount(NULL);
+       if (output<0){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == EFAULT){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("mounted a null mount point.(which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+int test_yaffs_mount_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_mount_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_mount_NULL.h
new file mode 100644 (file)
index 0000000..010d884
--- /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_mount_NULL_h__
+#define __test_yaffs_mount_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_mount_NULL(void);
+int test_yaffs_mount_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_open_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_open_NULL.c
new file mode 100644 (file)
index 0000000..4e497cd
--- /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_open_NULL.h"
+
+static int handle = -1;
+
+int test_yaffs_open_NULL(void)
+{
+       int output = 0;
+       int error_code = 0;
+       /*printf("path %s\n",path); */
+       handle = yaffs_open(NULL, O_TRUNC| O_RDWR,FILE_MODE );
+       if (handle == -1){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == EFAULT){
+                       return 1;
+               }
+               else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("a null path was opened.(which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+int test_yaffs_open_NULL_clean(void)
+{
+       if (handle >=0){
+               return yaffs_close(handle);
+       }
+       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_open_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_open_NULL.h
new file mode 100644 (file)
index 0000000..28b9b0b
--- /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_open_NULL_h__
+#define __test_yaffs_open_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_open_NULL(void);
+int test_yaffs_open_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_remount_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_remount_NULL.c
new file mode 100644 (file)
index 0000000..c9be564
--- /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_remount_NULL.h"
+
+int test_yaffs_remount_NULL(void)
+{
+       int output = -1;
+       int error_code =0;
+
+
+       output = yaffs_remount(NULL,0,0);
+       if (output<0){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == EFAULT){
+                       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_NULL_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_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_remount_NULL.h
new file mode 100644 (file)
index 0000000..e5bf18e
--- /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_NULL__
+#define __test_yaffs_remount_NULL__
+
+#include "yaffsfs.h"
+#include "lib.h"
+#include "test_yaffs_unmount.h"
+
+int test_yaffs_remount_NULL(void);
+int test_yaffs_remount_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL.c
new file mode 100644 (file)
index 0000000..ea73a2f
--- /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_rename_NULL.h"
+
+
+int test_yaffs_rename_NULL(void)
+{
+       int output=0;
+       int error_code =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_rename(NULL , RENAME_PATH);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("renamed a null path (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+
+int test_yaffs_rename_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL.h
new file mode 100644 (file)
index 0000000..2844f32
--- /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_NULL_h__
+#define __test_yaffs_rename_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rename_NULL(void);
+int test_yaffs_rename_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL2.c b/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL2.c
new file mode 100644 (file)
index 0000000..998905a
--- /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_rename_NULL2.h"
+
+
+int test_yaffs_rename_NULL2(void)
+{
+       int output=0;
+       int error_code =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_rename(FILE_PATH , NULL);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("renamed a null path (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+
+int test_yaffs_rename_NULL2_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL2.h b/direct/timothy_tests/quick_tests/test_yaffs_rename_NULL2.h
new file mode 100644 (file)
index 0000000..ce3cf90
--- /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_NULL2_h__
+#define __test_yaffs_rename_NULL2_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rename_NULL2(void);
+int test_yaffs_rename_NULL2_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rmdir_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_rmdir_NULL.c
new file mode 100644 (file)
index 0000000..2a833b0
--- /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_rmdir_NULL.h"
+
+
+int test_yaffs_rmdir_NULL(void)
+{
+       int output=0;
+       int error_code =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(NULL);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("removed a NULL directory (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+
+int test_yaffs_rmdir_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_rmdir_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_rmdir_NULL.h
new file mode 100644 (file)
index 0000000..8edd10b
--- /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_NULL_h__
+#define __test_yaffs_rmdir_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_rmdir_NULL(void);
+int test_yaffs_rmdir_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_stat_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_stat_NULL.c
new file mode 100644 (file)
index 0000000..e2f37b6
--- /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_stat_NULL.h"
+
+int test_yaffs_stat_NULL(void)
+{
+       int error_code=0;
+       struct yaffs_stat stat;
+       int output=0;
+       char text[100];
+       text[0] ='\0';
+       output=yaffs_stat(NULL, &stat);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("stated a NULL file (which is a bad thing)\n",2);
+               return -1;
+       }       
+}
+
+int test_yaffs_stat_NULL_clean(void)
+{
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_stat_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_stat_NULL.h
new file mode 100644 (file)
index 0000000..3f4e2fd
--- /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_NULL_h__
+#define __test_yaffs_stat_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_stat_NULL(void);
+int test_yaffs_stat_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL.c
new file mode 100644 (file)
index 0000000..f7ab9dd
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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_NULL.h"
+
+static int output = 0;
+
+int test_yaffs_symlink_NULL(void)
+{
+       int error_code = 0;
+       output = yaffs_symlink(NULL,SYMLINK_PATH);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a symlink to a NULL path (which is a bad thing)\n",2);
+               return -1;
+       }       
+
+}
+
+int test_yaffs_symlink_NULL_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_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL.h
new file mode 100644 (file)
index 0000000..373436c
--- /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_NULL_h__
+#define __test_yaffs_symlink_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_symlink_NULL(void);
+int test_yaffs_symlink_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL2.c b/direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL2.c
new file mode 100644 (file)
index 0000000..d4b9d1c
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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_NULL2.h"
+
+static int output = 0;
+
+int test_yaffs_symlink_NULL2(void)
+{
+       int error_code = 0;
+       output = yaffs_symlink(FILE_PATH,NULL);
+       if (output<0){ 
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("created a symlink to a NULL path (which is a bad thing)\n",2);
+               return -1;
+       }       
+
+}
+
+int test_yaffs_symlink_NULL2_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_NULL2.h b/direct/timothy_tests/quick_tests/test_yaffs_symlink_NULL2.h
new file mode 100644 (file)
index 0000000..14a87b7
--- /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_NULL2_h__
+#define __test_yaffs_symlink_NULL2_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_symlink_NULL2(void);
+int test_yaffs_symlink_NULL2_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_sync_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_sync_NULL.c
new file mode 100644 (file)
index 0000000..c8c35df
--- /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_sync_NULL.h"
+
+
+int test_yaffs_sync_NULL(void)
+{
+       int error_code=-1;
+       int output = yaffs_sync(NULL);
+       
+       if (output<0){
+               error_code=yaffs_get_error();
+               if (abs(error_code)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("returned error does not match the the expected error\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("synced a NULL path (which is a bad thing)\n",2);
+               return -1;
+       }       
+
+
+}
+
+
+int test_yaffs_sync_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_sync_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_sync_NULL.h
new file mode 100644 (file)
index 0000000..2fa1ad1
--- /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_NULL_h__
+#define __test_yaffs_sync_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_sync_NULL(void);
+int test_yaffs_sync_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_totalspace_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_totalspace_NULL.c
new file mode 100644 (file)
index 0000000..359639d
--- /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_totalspace_NULL.h"
+
+
+
+int test_yaffs_totalspace_NULL(void)
+{
+       int output=0;
+       int error=0;
+       output = yaffs_totalspace(NULL);
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("got the totalspace of a NULL mountpoint (which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+
+int test_yaffs_totalspace_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_totalspace_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_totalspace_NULL.h
new file mode 100644 (file)
index 0000000..6f82e1d
--- /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_totalspace_NULL_h__
+#define __test_yaffs_totalspace_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_totalspace_NULL(void);
+int test_yaffs_totalspace_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_truncate_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_truncate_NULL.c
new file mode 100644 (file)
index 0000000..95827e9
--- /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_truncate_NULL.h"
+
+
+int test_yaffs_truncate_NULL(void)
+{
+       int error=0;
+       int output=0;
+
+
+       output= yaffs_truncate(NULL,FILE_SIZE_TRUNCATED );
+       if (output<0){
+               error=yaffs_get_error();
+               if (abs(error)==EFAULT){
+                       return 1;
+               } else {
+                       print_message("received a different error than expected\n",2);
+                       return -1;
+               }
+       } else{
+               print_message("truncated a NULL path\n",2);
+               return -1;
+       }               
+
+}
+
+int test_yaffs_truncate_NULL_clean(void)
+{
+       return 1;
+}
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_truncate_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_truncate_NULL.h
new file mode 100644 (file)
index 0000000..bbc96b5
--- /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_truncate_NULL_h__
+#define __test_yaffs_truncate_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_truncate_NULL(void);
+int test_yaffs_truncate_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_unlink_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_unlink_NULL.c
new file mode 100644 (file)
index 0000000..96bfcfa
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * 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_unlink_NULL.h"
+
+static int handle=-1;
+
+int test_yaffs_unlink_NULL(void)
+{
+       int error_code=0;
+
+       handle=yaffs_unlink(NULL);
+       if (handle==-1){
+               error_code=yaffs_get_error();
+               if (abs(error_code) == EFAULT){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else {
+               print_message("NULL path unlinked.(which is a bad thing)\n",2);
+               return -1;
+       }
+
+}
+int test_yaffs_unlink_NULL_clean(void)
+{
+       if (handle >= 0){
+               return test_yaffs_open();
+       } 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_unlink_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_unlink_NULL.h
new file mode 100644 (file)
index 0000000..a2f97a5
--- /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_unlink_NULL_h__
+#define __test_yaffs_unlink_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+#include "test_yaffs_open.h"
+
+int test_yaffs_unlink_NULL(void);
+int test_yaffs_unlink_NULL_clean(void);
+
+#endif
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c b/direct/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c
new file mode 100644 (file)
index 0000000..5788bde
--- /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_unmount_NULL.h"
+
+static int handle = 0;
+
+int test_yaffs_unmount_NULL(void)
+{
+       int output=0;
+       int error_code=0;
+
+       handle = yaffs_unmount(NULL);
+       if (handle==-1){
+               error_code = yaffs_get_error();
+               if (abs(error_code) == EFAULT){
+                       return 1;
+               } else {
+                       print_message("different error than expected\n",2);
+                       return -1;
+               }
+       } else if (output >=0){
+               print_message("NULL path opened.(which is a bad thing)\n",2);
+               return -1;
+       }
+}
+
+int test_yaffs_unmount_NULL_clean(void)
+{
+       return 1;
+}
+
diff --git a/direct/timothy_tests/quick_tests/test_yaffs_unmount_NULL.h b/direct/timothy_tests/quick_tests/test_yaffs_unmount_NULL.h
new file mode 100644 (file)
index 0000000..f088666
--- /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_unmount_NULL_h__
+#define __test_yaffs_unmount_NULL_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_unmount_NULL(void);
+int test_yaffs_unmount_NULL_clean(void);
+
+#endif