From: Charles Manning Date: Fri, 8 Jul 2016 00:43:57 +0000 (+1200) Subject: Get timothy quick tests building cleanly. X-Git-Tag: aleph1-release~9 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=4ae1d4603da3b68c82e8563191743000fa91d403 Get timothy quick tests building cleanly. Signed-off-by: Charles Manning --- diff --git a/direct/test-framework/timothy_tests/quick_tests/Makefile b/direct/test-framework/timothy_tests/quick_tests/Makefile index 431c883..f2bd02f 100644 --- a/direct/test-framework/timothy_tests/quick_tests/Makefile +++ b/direct/test-framework/timothy_tests/quick_tests/Makefile @@ -96,10 +96,10 @@ include $(YDI_FRAMEWORK_DIR)/FrameworkRules.mk yaffs_test: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) - gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) + gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) -lpthread quick_tests: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) - gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) + gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) -lpthread diff --git a/direct/test-framework/timothy_tests/quick_tests/lib.h b/direct/test-framework/timothy_tests/quick_tests/lib.h index 5e36ca0..61e734f 100644 --- a/direct/test-framework/timothy_tests/quick_tests/lib.h +++ b/direct/test-framework/timothy_tests/quick_tests/lib.h @@ -21,36 +21,38 @@ #include "yaffsfs.h" -#define YAFFS_MOUNT_POINT "/yaffs2/" +#define YAFFS_MOUNT_POINT "/yflash2/" #define FILE_NAME "test_dir/foo" #define FILE_SIZE 10 +#define YAFFS_TEST_LONG_VALUE (100000000000000000LL) + #define FILE_MODE (S_IREAD | S_IWRITE) #define FILE_SIZE_TRUNCATED 100 #define FILE_TEXT "file foo " /* keep space at end of string */ #define FILE_TEXT_NBYTES 10 -#define TEST_DIR "/yaffs2/test_dir" -#define DIR_PATH "/yaffs2/test_dir/new_directory" -#define DIR_PATH2 "/yaffs2/test_dir/new_directory2" -#define DIR_PATH2_FILE "/yaffs2/test_dir/new_directory2/foo" -#define SYMLINK_PATH "/yaffs2/test_dir/sym_foo" +#define TEST_DIR "/yflash2/test_dir" +#define DIR_PATH "/yflash2/test_dir/new_directory" +#define DIR_PATH2 "/yflash2/test_dir/new_directory2" +#define DIR_PATH2_FILE "/yflash2/test_dir/new_directory2/foo" +#define SYMLINK_PATH "/yflash2/test_dir/sym_foo" -#define HARD_LINK_PATH "/yaffs2/test_dir/hard_link" +#define HARD_LINK_PATH "/yflash2/test_dir/hard_link" -#define NODE_PATH "/yaffs2/test_dir/node" +#define NODE_PATH "/yflash2/test_dir/node" -#define RENAME_PATH "/yaffs2/test_dir/foo2" +#define RENAME_PATH "/yflash2/test_dir/foo2" -#define RENAME_DIR_PATH "/yaffs2/test_dir/dir2" +#define RENAME_DIR_PATH "/yflash2/test_dir/dir2" -#define ELOOP_PATH "/yaffs2/test_dir/ELOOP" -#define ELOOP2_PATH "/yaffs2/test_dir/ELOOP2" +#define ELOOP_PATH "/yflash2/test_dir/ELOOP" +#define ELOOP2_PATH "/yflash2/test_dir/ELOOP2" -#define RMDIR_PATH "/yaffs2/test_dir/RM_DIR" +#define RMDIR_PATH "/yflash2/test_dir/RM_DIR" /* warning do not define anything as FILE because there seems to be a conflict with stdio.h */ -#define FILE_PATH "/yaffs2/test_dir/foo" -#define FILE_PATH2 "/yaffs2/test_dir/foo2" +#define FILE_PATH "/yflash2/test_dir/foo" +#define FILE_PATH2 "/yflash2/test_dir/foo2" void join_paths(char *path1,char *path2,char *new_path ); void print_message(char *message,char print_level); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOENT2.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOENT2.c index 2015a65..013821e 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOENT2.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOENT2.c @@ -13,8 +13,6 @@ #include "test_yaffs_access_ENOENT2.h" -static int handle=0; - int test_yaffs_access_ENOENT2(void) { int output=0; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOTDIR.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOTDIR.c index a9718a8..021c03d 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOTDIR.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_access_ENOTDIR.c @@ -13,8 +13,6 @@ #include "test_yaffs_access_ENOTDIR.h" -static int handle=0; - int test_yaffs_access_ENOTDIR(void) { int output=0; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_close_NULL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_close_NULL.c index 99e5021..5af067e 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_close_NULL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_close_NULL.c @@ -11,7 +11,7 @@ * published by the Free Software Foundation. */ -/* generates a EBADF error by closing a handle twice */ +/* generates a EBADF error by closing a daft handle*/ #include "test_yaffs_close_NULL.h" @@ -23,7 +23,7 @@ int test_yaffs_close_NULL(void) int error_code = 0; - output = yaffs_close(NULL); + output = yaffs_close(999); if (output < 0){ error_code = yaffs_get_error(); if (abs(error_code) == EBADF){ diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_dup.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_dup.c index 2a0f63a..bb55862 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_dup.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_dup.c @@ -22,7 +22,7 @@ int test_yaffs_dup(void) handle2 =yaffs_dup(handle); return handle2; } - + return handle; } diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod.c index e1a0356..0b32620 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod.c @@ -12,6 +12,7 @@ */ #include "test_yaffs_fchmod.h" +#include "test_yaffs_open.h" static int handle = -1; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c index f96e0d2..4c70413 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fchmod_NULL.c @@ -19,7 +19,7 @@ int test_yaffs_fchmod_NULL(void) int error = 0; int output = 0; - output = yaffs_fchmod(NULL,S_IREAD|S_IWRITE); + output = yaffs_fchmod(999, S_IREAD|S_IWRITE); if (output<0){ error=yaffs_get_error(); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c index 1320ea4..67f711d 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_fdatasync_NULL.c @@ -19,7 +19,7 @@ int test_yaffs_fdatasync_NULL(void) { int output = 0; int error_code = 0; - output = yaffs_fdatasync(NULL); + output = yaffs_fdatasync(999); if (output==-1){ error_code=yaffs_get_error(); if (abs(error_code)==EBADF){ diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_flush.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_flush.c index c7380a6..3fc060d 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_flush.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_flush.c @@ -12,6 +12,7 @@ */ #include "test_yaffs_flush.h" +#include "test_yaffs_open.h" static int handle =-1; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_EBADF.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_EBADF.c index d384b98..08cc501 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_EBADF.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_EBADF.c @@ -13,8 +13,6 @@ #include "test_yaffs_ftruncate_EBADF.h" -static int handle = 0; - int test_yaffs_ftruncate_EBADF(void) { int output = 0; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c index 484447d..7fe8514 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c @@ -22,7 +22,7 @@ int test_yaffs_ftruncate_big_file(void) handle = test_yaffs_open(); if (handle >= 0){ - output = yaffs_ftruncate(handle,10000000000000000000000000000000); + output = yaffs_ftruncate(handle,YAFFS_TEST_LONG_VALUE); if (output < 0){ error_code = yaffs_get_error(); if (abs(error_code) == EINVAL){ /* yaffs uses the error EINVAL instead of big_file */ diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek.c index 84ed1c3..750d350 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek.c @@ -35,9 +35,8 @@ int test_yaffs_lseek(void) } } else { print_message("error opening file\n", 2); - return -1; } - + return -1; } int test_yaffs_lseek_clean(void) diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c index a0f6add..37e2814 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c @@ -26,7 +26,7 @@ int test_yaffs_lseek_big_file(void) return -1; } - output = yaffs_lseek(handle, 100000000000000000000000000000000000000, SEEK_SET); + output = yaffs_lseek(handle, YAFFS_TEST_LONG_VALUE, SEEK_SET); if (output < 0){ error_code = yaffs_get_error(); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lstat.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lstat.c index 835d86a..effc77e 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lstat.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_lstat.c @@ -12,7 +12,7 @@ */ #include "test_yaffs_lstat.h" - +#include "test_yaffs_open.h" int test_yaffs_lstat(void) { diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENAMETOOLONG.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENAMETOOLONG.c index 06d7581..fdd03f7 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENAMETOOLONG.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENAMETOOLONG.c @@ -19,7 +19,6 @@ static int handle = -1; int test_yaffs_open_ENAMETOOLONG(void) { - int output = 0; int x = 0; int error_code = 0; int file_name_length = 1000000; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENOENT.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENOENT.c index b5a8dd7..9456e08 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENOENT.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_ENOENT.c @@ -17,7 +17,6 @@ static int handle = -1; int test_yaffs_open_ENOENT(void) { - int output = 0; int error_code = 0; /*printf("path %s\n",path); */ handle = yaffs_open("/yaffs2/non_existant_file", O_TRUNC| O_RDWR,FILE_MODE ); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_NULL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_NULL.c index d076b59..d898f8c 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_NULL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_open_NULL.c @@ -17,7 +17,6 @@ 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 ); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_read_EINVAL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_read_EINVAL.c index 75bf704..e00e868 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_read_EINVAL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_read_EINVAL.c @@ -14,6 +14,7 @@ /*this is no longer relevent because it is not possiable to read -1 bytes*/ #include "test_yaffs_read_EINVAL.h" +#include "test_yaffs_write.h" static int handle = -1; static char *file_name = NULL; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_off_read_only_off.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_off_read_only_off.c index d8797ea..c00ef3b 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_off_read_only_off.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_off_read_only_off.c @@ -16,8 +16,6 @@ int test_yaffs_remount_force_off_read_only_off(void) { int output = -1; - int error_code =0; - output = yaffs_remount(YAFFS_MOUNT_POINT,0,0); if (output>=0){ diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_on_read_only_off.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_on_read_only_off.c index 276cb7c..d7e11d5 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_on_read_only_off.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_remount_force_on_read_only_off.c @@ -12,11 +12,12 @@ */ #include "test_yaffs_remount_force_on_read_only_off.h" +#include "test_yaffs_open.h" int test_yaffs_remount_force_on_read_only_off(void) { int output = -1; - int error_code =0; + output=test_yaffs_open(); if (output<0) { print_message("failed to open file\n",2); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename.c index 170081e..a95ae25 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename.c @@ -17,7 +17,6 @@ int test_yaffs_rename(void) { int output=0; - int error_code =0; if (0 != yaffs_access(FILE_PATH,0)) { output = test_yaffs_open(); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EROFS.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EROFS.c index f9821d2..7c8aa76 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EROFS.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_EROFS.c @@ -12,7 +12,7 @@ */ #include "test_yaffs_rename_EROFS.h" - +#include "test_yaffs_open.h" int test_yaffs_rename_EROFS(void) { diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_dir_over_dir.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_dir_over_dir.c index 1a46919..e11345d 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_dir_over_dir.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_dir_over_dir.c @@ -20,7 +20,6 @@ int test_yaffs_rename_dir_over_dir(void) { int output=0; - int error_code =0; if (yaffs_mkdir(DIR_PATH,O_CREAT | O_RDWR)==-1){ print_message("failed to create dir\n",1); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_file_over_file.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_file_over_file.c index 70652d6..14d76ab 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_file_over_file.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_file_over_file.c @@ -20,7 +20,6 @@ int test_yaffs_rename_file_over_file(void) { int output=0; - int error_code =0; if (yaffs_close(yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE))==-1){ print_message("failed to create file\n",1); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_full_dir_over_dir.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_full_dir_over_dir.c index 64317ce..9bcd6bc 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_full_dir_over_dir.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rename_full_dir_over_dir.c @@ -20,7 +20,6 @@ int test_yaffs_rename_full_dir_over_dir(void) { int output=0; - int error_code =0; if (yaffs_mkdir(DIR_PATH,O_CREAT | O_RDWR)==-1){ print_message("failed to create dir\n",1); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_EBUSY.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_EBUSY.c index 738a56a..482ad16 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_EBUSY.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_EBUSY.c @@ -19,7 +19,6 @@ int test_yaffs_rmdir_EBUSY(void) int output=0; int error_code =0; - output = yaffs_rmdir("/yaffs2/"); if (output<0){ error_code=yaffs_get_error(); @@ -38,9 +37,6 @@ int test_yaffs_rmdir_EBUSY(void) int test_yaffs_rmdir_EBUSY_clean(void) { - int output = 0; - return 1; - } diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_ENOENT.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_ENOENT.c index f5d6271..8ac1f16 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_ENOENT.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_rmdir_ENOENT.c @@ -37,7 +37,6 @@ int test_yaffs_rmdir_ENOENT(void) int test_yaffs_rmdir_ENOENT_clean(void) { - int output = 0; return 1; } diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat.c index 5b5cd31..5c6005f 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat.c @@ -15,11 +15,8 @@ int test_yaffs_stat(void) { - char message[100]; - int mode=0; - int size=0; - message[0]='\0'; struct yaffs_stat stat; + if (yaffs_close(yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE))==-1){ print_message("failed to create file \n",1); return -1; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP.c index eee9ada..b7600b3 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP.c @@ -18,8 +18,6 @@ int test_yaffs_stat_ELOOP(void) int error_code=0; struct yaffs_stat stat; int output=0; - char text[100]; - text[0] ='\0'; if (set_up_ELOOP()<0){ print_message("failed to setup symlinks\n",2); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP_dir.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP_dir.c index c4d9f35..2763aee 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP_dir.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ELOOP_dir.c @@ -18,8 +18,6 @@ int test_yaffs_stat_ELOOP_dir(void) int error_code=0; struct yaffs_stat stat; int output=0; - char text[100]; - text[0] ='\0'; if (set_up_ELOOP()<0){ print_message("failed to setup symlinks\n",2); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c index 47ac8c6..a0d4598 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENAMETOOLONG.c @@ -18,8 +18,6 @@ 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]; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT.c index 92938e2..21f7958 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT.c @@ -18,8 +18,7 @@ int test_yaffs_stat_ENOENT(void) int error_code=0; struct yaffs_stat stat; int output=0; - char text[100]; - text[0] ='\0'; + output=yaffs_stat("/yaffs2/non-existing_file", &stat); if (output<0){ error_code=yaffs_get_error(); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT2.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT2.c index 334cc61..c8facb2 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT2.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOENT2.c @@ -18,8 +18,7 @@ int test_yaffs_stat_ENOENT2(void) int error_code=0; struct yaffs_stat stat; int output=0; - char text[100]; - text[0] ='\0'; + output=yaffs_stat("/non-existing-dir/foo", &stat);; if (output<0){ error_code=yaffs_get_error(); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOTDIR.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOTDIR.c index ce22805..5c3ba77 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOTDIR.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_ENOTDIR.c @@ -18,8 +18,7 @@ int test_yaffs_stat_ENOTDIR(void) int error_code=0; struct yaffs_stat stat; int output=0; - char text[100]; - text[0] ='\0'; + if (yaffs_close(yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE))==-1){ print_message("failed to create file\n",1); return -1; diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_NULL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_NULL.c index 3fb07cd..d8e558b 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_NULL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_stat_NULL.c @@ -18,8 +18,7 @@ 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(); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_EISDIR.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_EISDIR.c index d6000d9..50efc1a 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_EISDIR.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_EISDIR.c @@ -12,7 +12,6 @@ */ #include "test_yaffs_truncate.h" -static int handle= -1; int test_yaffs_truncate_EISDIR(void) { diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c index 4570db1..c92a041 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c @@ -19,7 +19,7 @@ int test_yaffs_truncate_big_file(void) int error=0; int output=0; - output= yaffs_truncate("/yaffs2/foo",10000000000000000000000000000000000000000000 ); + output= yaffs_truncate("/yaffs2/foo", YAFFS_TEST_LONG_VALUE); if (output<0){ error=yaffs_get_error(); if (abs(error)==EINVAL){ /*in yaffs EINVAL is used instead of big_file */ diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unlink_EROFS.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unlink_EROFS.c index 152ef39..7b5fcb2 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unlink_EROFS.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unlink_EROFS.c @@ -12,6 +12,8 @@ */ #include "test_yaffs_open_EROFS.h" +#include "test_yaffs_open.h" + static int output =0; int test_yaffs_unlink_EROFS(void) diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_off.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_off.c index e18c803..c7f7651 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_off.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_off.c @@ -12,11 +12,13 @@ */ #include "test_yaffs_unmount2_with_handle_open_and_forced_mode_off.h" +#include "test_yaffs_open.h" int test_yaffs_unmount2_with_handle_open_and_forced_mode_off(void) { int output = -1; int error_code =0; + output=test_yaffs_open(); if (output<0) { print_message("failed to open file\n",2); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_on.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_on.c index 5a20f88..dc85207 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_on.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount2_with_handle_open_and_forced_mode_on.c @@ -12,11 +12,12 @@ */ #include "test_yaffs_unmount2_with_handle_open_and_forced_mode_on.h" +#include "test_yaffs_open.h" int test_yaffs_unmount2_with_handle_open_and_forced_mode_on(void) { int output = -1; - int error_code =0; + output=test_yaffs_open(); if (output<0) { print_message("failed to open file\n",2); diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_ENODEV.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_ENODEV.c index 74283a2..7646b46 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_ENODEV.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_ENODEV.c @@ -31,8 +31,8 @@ int test_yaffs_unmount_ENODEV(void) } } else if (output >=0){ print_message("non existant directory opened.(which is a bad thing)\n",2); - return -1; } + return -1; } int test_yaffs_unmount_ENODEV_clean(void) diff --git a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c index 9c318dd..94ea612 100644 --- a/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c +++ b/direct/test-framework/timothy_tests/quick_tests/test_yaffs_unmount_NULL.c @@ -33,6 +33,8 @@ int test_yaffs_unmount_NULL(void) print_message("NULL path opened.(which is a bad thing)\n",2); return -1; } + + return -1; } int test_yaffs_unmount_NULL_clean(void)