From 24f00634ca4584100b60d7b68675c1c9c4646ee8 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Tue, 16 Nov 2010 16:12:31 +1300 Subject: [PATCH] yaffs More tests. Signed-off-by: Timothy Manning --- direct/timothy_tests/quick_tests/Makefile | 10 ++-- direct/timothy_tests/quick_tests/README.txt | 16 +++--- .../quick_tests/current_bugs.txt | 9 +-- .../timothy_tests/quick_tests/quick_tests.h | 20 ++++--- ...FBIG.c => test_yaffs_ftruncate_big_file.c} | 8 +-- ...FBIG.h => test_yaffs_ftruncate_big_file.h} | 8 +-- ...ek_EFBIG.c => test_yaffs_lseek_big_file.c} | 6 +- ...ek_EFBIG.h => test_yaffs_lseek_big_file.h} | 8 +-- .../quick_tests/test_yaffs_symlink_EEXIST.c | 55 +++++++++++++++++++ .../quick_tests/test_yaffs_symlink_EEXIST.h | 25 +++++++++ ...EFBIG.c => test_yaffs_truncate_big_file.c} | 8 +-- ...EFBIG.h => test_yaffs_truncate_big_file.h} | 8 +-- .../test_yaffs_unlink_ENAMETOOLONG.c | 2 +- ...te_EFBIG.c => test_yaffs_write_big_file.c} | 6 +- ...te_EFBIG.h => test_yaffs_write_big_file.h} | 8 +-- 15 files changed, 137 insertions(+), 60 deletions(-) rename direct/timothy_tests/quick_tests/{test_yaffs_ftruncate_EFBIG.c => test_yaffs_ftruncate_big_file.c} (89%) rename direct/timothy_tests/quick_tests/{test_yaffs_truncate_EFBIG.h => test_yaffs_ftruncate_big_file.h} (76%) rename direct/timothy_tests/quick_tests/{test_yaffs_lseek_EFBIG.c => test_yaffs_lseek_big_file.c} (90%) rename direct/timothy_tests/quick_tests/{test_yaffs_lseek_EFBIG.h => test_yaffs_lseek_big_file.h} (78%) create mode 100644 direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.c create mode 100644 direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.h rename direct/timothy_tests/quick_tests/{test_yaffs_truncate_EFBIG.c => test_yaffs_truncate_big_file.c} (87%) rename direct/timothy_tests/quick_tests/{test_yaffs_ftruncate_EFBIG.h => test_yaffs_truncate_big_file.h} (77%) rename direct/timothy_tests/quick_tests/{test_yaffs_write_EFBIG.c => test_yaffs_write_big_file.c} (94%) rename direct/timothy_tests/quick_tests/{test_yaffs_write_EFBIG.h => test_yaffs_write_big_file.h} (80%) diff --git a/direct/timothy_tests/quick_tests/Makefile b/direct/timothy_tests/quick_tests/Makefile index 157abde..00ef9f1 100644 --- a/direct/timothy_tests/quick_tests/Makefile +++ b/direct/timothy_tests/quick_tests/Makefile @@ -50,12 +50,12 @@ TESTFILES = quick_tests.o lib.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_unlink.o test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o test_yaffs_unlink_ENOTDIR.o\ - test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_EFBIG.o \ + test_yaffs_ftruncate.o test_yaffs_ftruncate_EBADF.o test_yaffs_ftruncate_EINVAL.o test_yaffs_ftruncate_big_file.o \ test_yaffs_truncate.o test_yaffs_truncate_ENOTDIR.o test_yaffs_truncate_EISDIR.o test_yaffs_truncate_ENOENT.o test_yaffs_truncate_EINVAL.o \ - test_yaffs_truncate_EFBIG.o\ - test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_EFBIG.o \ + test_yaffs_truncate_big_file.o\ + test_yaffs_write.o test_yaffs_write_EBADF.o test_yaffs_write_big_file.o \ test_yaffs_read.o test_yaffs_read_EBADF.o test_yaffs_read_EINVAL.o\ - test_yaffs_lseek.o test_yaffs_lseek_EBADF.o test_yaffs_lseek_EINVAL.o test_yaffs_lseek_EFBIG.o \ + test_yaffs_lseek.o test_yaffs_lseek_EBADF.o test_yaffs_lseek_EINVAL.o test_yaffs_lseek_big_file.o \ test_yaffs_access.o test_yaffs_access_EINVAL.o test_yaffs_access_ENOTDIR.o test_yaffs_access_ENOENT.o\ test_yaffs_stat.o test_yaffs_stat_ENOENT.o test_yaffs_stat_ENOTDIR.o \ test_yaffs_fstat.o test_yaffs_fstat_EBADF.o \ @@ -66,7 +66,7 @@ TESTFILES = quick_tests.o lib.o \ test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o \ test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.o \ test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EINVAL.o \ - test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o + test_yaffs_symlink.o test_yaffs_symlink_ENOTDIR.o test_yaffs_symlink_EEXIST.o diff --git a/direct/timothy_tests/quick_tests/README.txt b/direct/timothy_tests/quick_tests/README.txt index f98e419..a1cb4b7 100644 --- a/direct/timothy_tests/quick_tests/README.txt +++ b/direct/timothy_tests/quick_tests/README.txt @@ -32,12 +32,12 @@ Tests made test_yaffs_ftruncate test_yaffs_ftruncate_EBADF test_yaffs_ftruncate_ENIVAL - test_yaffs_ftruncate_EFBIG + test_yaffs_ftruncate_big_file test_yaffs_lseek test_yaffs_lseek_EBADF test_yaffs_lseek_EINVAL - test_yaffs_lseek_EFBIG + test_yaffs_lseek_big_file test_yaffs_open test_yaffs_open_EEXIST @@ -61,6 +61,7 @@ Tests made test_yaffs_stat_ENOTDIR test_yaffs_symlink + test_yaffs_symlink_ENOTDIR test_yaffs_fstat test_yaffs_fstat_EBADF @@ -70,7 +71,7 @@ Tests made test_yaffs_truncate_EISDIR test_yaffs_truncate_ENOENT test_yaffs_truncate_ENIVAL - test_yaffs_truncate_EFBIG + test_yaffs_truncate_big_file test_yaffs_unlink test_yaffs_unlink_EISDIR @@ -120,7 +121,6 @@ Tests to add test_yaffs_symlink_ELOOP test_yaffs_symlink_ENAMETOOLONG test_yaffs_symlink_ENOENT //if there is a slash on the end - test_yaffs_symlink_ENOTDIR test_yaffs_symlink_EROFS test_yaffs_mknod @@ -231,21 +231,21 @@ Tests to add - test_yaffs_read_EFBIG + test_yaffs_read_big_file test what happens if you read off the end of the file? test_yaffs_pread test_yaffs_pread_EBADF test_yaffs_pread_EINVAL - test_yaffs_pread_EFBIG + test_yaffs_pread_big_file - test_yaffs_write_EFBIG + test_yaffs_write_big_file test_yaffs_write_EINVAL What happens when you run out of space? test_yaffs_write_EBADF test_yaffs_write - test_yaffs_pwrite_EFBIG + test_yaffs_pwrite_big_file test_yaffs_pwrite_EINVAL test_yaffs_unlink_EACCES diff --git a/direct/timothy_tests/quick_tests/current_bugs.txt b/direct/timothy_tests/quick_tests/current_bugs.txt index 534df7c..b46434f 100644 --- a/direct/timothy_tests/quick_tests/current_bugs.txt +++ b/direct/timothy_tests/quick_tests/current_bugs.txt @@ -46,15 +46,10 @@ Current BUGS Bug with unmounting a non-existing mountpoint. The function returns ENODEV but should be returning EINVAL. - Unmount2 forcing the unmount needs to break the handles so they return EBADF. - - Bug with reading -1 bytes of a file without an error (test is in test_yaffs_read_EINVAL). - It should return EINVAL. This is because it was reading an empty file. - When text is added to the file a read of -1 bytes tries to read 4 gig of data Bug when writing a file. The writing to the file causes the file size to exceed the size of yaffs file system memory. Output of test: - test_yaffs_write_EFBIG + test_yaffs_write_big_file AddrToChunk of offset -2147483648 gives chunk -1048576 start 0 AddrToChunk of offset -2147481600 gives chunk -1048575 start 0 AddrToChunk of offset -2147479552 gives chunk -1048574 start 0 @@ -66,7 +61,7 @@ Current BUGS AddrToChunk of offset -2147467264 gives chunk -1048568 start 0 AddrToChunk of offset -2147465216 gives chunk -1048567 start 0 wrote a large amount of text to a file.(which is a bad thing) - test: test_yaffs_write_EFBIG failed + test: test_yaffs_write_big_file failed yaffs_error code 0 error is : Unknown error code diff --git a/direct/timothy_tests/quick_tests/quick_tests.h b/direct/timothy_tests/quick_tests/quick_tests.h index d157d11..f17a19c 100644 --- a/direct/timothy_tests/quick_tests/quick_tests.h +++ b/direct/timothy_tests/quick_tests/quick_tests.h @@ -49,7 +49,7 @@ #include "test_yaffs_ftruncate.h" #include "test_yaffs_ftruncate_EBADF.h" #include "test_yaffs_ftruncate_EINVAL.h" -#include "test_yaffs_ftruncate_EFBIG.h" +#include "test_yaffs_ftruncate_big_file.h" #include "test_yaffs_truncate.h" @@ -57,11 +57,11 @@ #include "test_yaffs_truncate_EISDIR.h" #include "test_yaffs_truncate_ENOENT.h" #include "test_yaffs_truncate_EINVAL.h" -#include "test_yaffs_truncate_EFBIG.h" +#include "test_yaffs_truncate_big_file.h" #include "test_yaffs_write.h" #include "test_yaffs_write_EBADF.h" -#include "test_yaffs_write_EFBIG.h" +#include "test_yaffs_write_big_file.h" #include "test_yaffs_read.h" #include "test_yaffs_read_EBADF.h" @@ -70,7 +70,7 @@ #include "test_yaffs_lseek.h" #include "test_yaffs_lseek_EBADF.h" #include "test_yaffs_lseek_EINVAL.h" -#include "test_yaffs_lseek_EFBIG.h" +#include "test_yaffs_lseek_big_file.h" #include "test_yaffs_access.h" #include "test_yaffs_access_EINVAL.h" @@ -106,6 +106,7 @@ #include "test_yaffs_symlink.h" #include "test_yaffs_symlink_ENOTDIR.h" +#include "test_yaffs_symlink_EEXIST.h" #include "yaffsfs.h" @@ -161,11 +162,11 @@ test_template test_list[]={ {test_yaffs_lseek,test_yaffs_lseek_clean,"test_yaffs_lseek"}, {test_yaffs_lseek_EBADF,test_yaffs_lseek_EBADF_clean,"test_yaffs_lseek_EBADF"}, {test_yaffs_lseek_EINVAL,test_yaffs_lseek_EINVAL_clean,"test_yaffs_lseek_EINVAL"}, - {test_yaffs_lseek_EFBIG,test_yaffs_lseek_EFBIG_clean,"test_yaffs_lseek_EFBIG"}, + {test_yaffs_lseek_big_file,test_yaffs_lseek_big_file_clean,"test_yaffs_lseek_big_file"}, {test_yaffs_write,test_yaffs_write_clean,"test_yaffs_write"}, {test_yaffs_write_EBADF,test_yaffs_write_EBADF_clean,"test_yaffs_write_EBADF"}, -// {test_yaffs_write_EFBIG,test_yaffs_write_EFBIG_clean,"test_yaffs_write_EFBIG"}, +// {test_yaffs_write_big_file,test_yaffs_write_big_file_clean,"test_yaffs_write_big_file"}, {test_yaffs_read,test_yaffs_read_clean,"test_yaffs_read"}, {test_yaffs_read_EBADF,test_yaffs_read_EBADF_clean,"test_yaffs_read_EBADF"}, @@ -181,14 +182,14 @@ test_template test_list[]={ {test_yaffs_ftruncate,test_yaffs_ftruncate_clean,"test_yaffs_ftruncate"}, {test_yaffs_ftruncate_EBADF,test_yaffs_ftruncate_EBADF_clean,"test_yaffs_ftruncate_EBADF"}, {test_yaffs_ftruncate_EINVAL,test_yaffs_ftruncate_EINVAL_clean,"test_yaffs_ftruncate_EINVAL"}, - {test_yaffs_ftruncate_EFBIG,test_yaffs_ftruncate_EFBIG_clean,"test_yaffs_ftruncate_EFBIG"}, + {test_yaffs_ftruncate_big_file,test_yaffs_ftruncate_big_file_clean,"test_yaffs_ftruncate_big_file"}, {test_yaffs_truncate,test_yaffs_truncate_clean,"test_yaffs_truncate"}, {test_yaffs_truncate_ENOTDIR,test_yaffs_truncate_ENOTDIR_clean,"test_yaffs_truncate_ENOTDIR"}, {test_yaffs_truncate_EISDIR,test_yaffs_truncate_EISDIR_clean,"test_yaffs_truncate_EISDIR"}, {test_yaffs_truncate_EINVAL,test_yaffs_truncate_EINVAL_clean,"test_yaffs_truncate_EINVAL"}, {test_yaffs_truncate_ENOENT,test_yaffs_truncate_ENOENT_clean,"test_yaffs_truncate_ENOENT"}, - {test_yaffs_truncate_EFBIG,test_yaffs_truncate_EFBIG_clean,"test_yaffs_truncate_EFBIG"}, + {test_yaffs_truncate_big_file,test_yaffs_truncate_big_file_clean,"test_yaffs_truncate_big_file"}, {test_yaffs_chmod,test_yaffs_chmod_clean,"test_yaffs_chmod"}, {test_yaffs_chmod_ENOENT,test_yaffs_chmod_ENOENT_clean,"test_yaffs_chmod_ENOENT"}, @@ -210,7 +211,8 @@ test_template test_list[]={ {test_yaffs_mkdir_ENOTDIR,test_yaffs_mkdir_ENOTDIR_clean,"test_yaffs_mkdir_ENOTDIR"}, {test_yaffs_symlink,test_yaffs_symlink_clean,"test_yaffs_symlink"}, - {test_yaffs_symlink_ENOTDIR,test_yaffs_symlink_ENOTDIR_clean,"test_yaffs_symlink_ENOTDIR"} + {test_yaffs_symlink_ENOTDIR,test_yaffs_symlink_ENOTDIR_clean,"test_yaffs_symlink_ENOTDIR"}, + {test_yaffs_symlink_EEXIST,test_yaffs_symlink_EEXIST_clean,"test_yaffs_symlink_EEXIST"} diff --git a/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_EFBIG.c b/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c similarity index 89% rename from direct/timothy_tests/quick_tests/test_yaffs_ftruncate_EFBIG.c rename to direct/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c index cff9ee0..dcb25fa 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_EFBIG.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.c @@ -11,11 +11,11 @@ * published by the Free Software Foundation. */ -#include "test_yaffs_ftruncate_EFBIG.h" +#include "test_yaffs_ftruncate_big_file.h" static int handle = -1; -int test_yaffs_ftruncate_EFBIG(void) +int test_yaffs_ftruncate_big_file(void) { int output = 0; int error_code = 0; @@ -25,7 +25,7 @@ int test_yaffs_ftruncate_EFBIG(void) output = yaffs_ftruncate(handle,10000000000000000000000000000000); if (output < 0){ error_code = yaffs_get_error(); - if (abs(error_code) == EINVAL){ /* yaffs uses the error EINVAL instead of EFBIG */ + if (abs(error_code) == EINVAL){ /* yaffs uses the error EINVAL instead of big_file */ return 1; } else { print_message("different error than expected\n", 2); @@ -41,7 +41,7 @@ int test_yaffs_ftruncate_EFBIG(void) } } -int test_yaffs_ftruncate_EFBIG_clean(void){ +int test_yaffs_ftruncate_big_file_clean(void){ /* change file size back to orignal size */ int output = 0; if (handle >= 0){ diff --git a/direct/timothy_tests/quick_tests/test_yaffs_truncate_EFBIG.h b/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.h similarity index 76% rename from direct/timothy_tests/quick_tests/test_yaffs_truncate_EFBIG.h rename to direct/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.h index 5a459ad..7ae0038 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_truncate_EFBIG.h +++ b/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_big_file.h @@ -13,14 +13,14 @@ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. */ -#ifndef __test_yaffs_truncate_EFBIG_h__ -#define __test_yaffs_truncate_EFBIG_h__ +#ifndef __test_yaffs_ftruncate_big_file_h__ +#define __test_yaffs_ftruncate_big_file_h__ #include "lib.h" #include "yaffsfs.h" #include "test_yaffs_open.h" -int test_yaffs_truncate_EFBIG(void); -int test_yaffs_truncate_EFBIG_clean(void); +int test_yaffs_ftruncate_big_file(void); +int test_yaffs_ftruncate_big_file_clean(void); #endif diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c b/direct/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c similarity index 90% rename from direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c rename to direct/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c index 6263c56..8e2c3e0 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_lseek_big_file.c @@ -11,11 +11,11 @@ * published by the Free Software Foundation. */ -#include "test_yaffs_lseek_EFBIG.h" +#include "test_yaffs_lseek_big_file.h" static int handle = -1; -int test_yaffs_lseek_EFBIG(void) +int test_yaffs_lseek_big_file(void) { handle = test_yaffs_open(); int error_code = 0; @@ -42,7 +42,7 @@ int test_yaffs_lseek_EFBIG(void) } } -int test_yaffs_lseek_EFBIG_clean(void) +int test_yaffs_lseek_big_file_clean(void) { if (handle >= 0){ return yaffs_close(handle); diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.h b/direct/timothy_tests/quick_tests/test_yaffs_lseek_big_file.h similarity index 78% rename from direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.h rename to direct/timothy_tests/quick_tests/test_yaffs_lseek_big_file.h index e14350d..d14af52 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.h +++ b/direct/timothy_tests/quick_tests/test_yaffs_lseek_big_file.h @@ -13,14 +13,14 @@ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. */ -#ifndef __test_yaffs_lseek_EFBIG_h__ -#define __test_yaffs_lseek_EFBIG_h__ +#ifndef __test_yaffs_lseek_big_file_h__ +#define __test_yaffs_lseek_big_file_h__ #include "lib.h" #include "yaffsfs.h" #include "test_yaffs_open.h" -int test_yaffs_lseek_EFBIG(void); -int test_yaffs_lseek_EFBIG_clean(void); +int test_yaffs_lseek_big_file(void); +int test_yaffs_lseek_big_file_clean(void); #endif diff --git a/direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.c b/direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.c new file mode 100644 index 0000000..b7768ac --- /dev/null +++ b/direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.c @@ -0,0 +1,55 @@ +/* + * YAFFS: Yet another FFS. A NAND-flash specific file system. + * + * Copyright (C) 2002-2010 Aleph One Ltd. + * for Toby Churchill Ltd and Brightstar Engineering + * + * Created by Timothy Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "test_yaffs_symlink_EEXIST.h" + +static int output = 0; + +int test_yaffs_symlink_EEXIST(void) +{ + int error_code = 0; + if (0==yaffs_access(SYMLINK_PATH,0)){ + output=yaffs_symlink(FILE_PATH,SYMLINK_PATH); + if (output>0){ + print_message("failed to create the first symlink\n",2); + return -1; + } + } + + output = yaffs_symlink(FILE_PATH,SYMLINK_PATH); + if (output<0){ + error_code=yaffs_get_error(); + if (abs(error_code)==EEXIST){ + return 1; + } else { + print_message("returned error does not match the the expected error\n",2); + return -1; + } + } else { + print_message("created a symlink over an existing symlink (which is a bad thing)\n",2); + return -1; + } + +} + +int test_yaffs_symlink_EEXIST_clean(void) +{ + if (output >= 0){ + return yaffs_unlink(SYMLINK_PATH); + } else { + return 1; /* the file failed to open so there is no need to close it */ + } +} + + + diff --git a/direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.h b/direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.h new file mode 100644 index 0000000..04359f7 --- /dev/null +++ b/direct/timothy_tests/quick_tests/test_yaffs_symlink_EEXIST.h @@ -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 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. + */ + +#ifndef __test_yaffs_symlink_EEXIST_h__ +#define __test_yaffs_symlink_EEXIST_h__ + +#include "lib.h" +#include "yaffsfs.h" + +int test_yaffs_symlink_EEXIST(void); +int test_yaffs_symlink_EEXIST_clean(void); + +#endif diff --git a/direct/timothy_tests/quick_tests/test_yaffs_truncate_EFBIG.c b/direct/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c similarity index 87% rename from direct/timothy_tests/quick_tests/test_yaffs_truncate_EFBIG.c rename to direct/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c index 0d69865..270bf49 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_truncate_EFBIG.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_truncate_big_file.c @@ -11,10 +11,10 @@ * published by the Free Software Foundation. */ -#include "test_yaffs_truncate_EFBIG.h" +#include "test_yaffs_truncate_big_file.h" static int handle = -1; -int test_yaffs_truncate_EFBIG(void) +int test_yaffs_truncate_big_file(void) { int error=0; int output=0; @@ -23,7 +23,7 @@ int test_yaffs_truncate_EFBIG(void) output= yaffs_truncate("/yaffs2/foo",10000000000000000000000000000000000000000000 ); if (output<0){ error=yaffs_get_error(); - if (abs(error)==EINVAL){ /*in yaffs EINVAL is used instead of EFBIG */ + if (abs(error)==EINVAL){ /*in yaffs EINVAL is used instead of big_file */ return 1; } else { print_message("received a different error than expected\n",2); @@ -40,7 +40,7 @@ int test_yaffs_truncate_EFBIG(void) } } -int test_yaffs_truncate_EFBIG_clean(void) +int test_yaffs_truncate_big_file_clean(void) { return 1; } diff --git a/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_EFBIG.h b/direct/timothy_tests/quick_tests/test_yaffs_truncate_big_file.h similarity index 77% rename from direct/timothy_tests/quick_tests/test_yaffs_ftruncate_EFBIG.h rename to direct/timothy_tests/quick_tests/test_yaffs_truncate_big_file.h index c00b5fa..654673f 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_ftruncate_EFBIG.h +++ b/direct/timothy_tests/quick_tests/test_yaffs_truncate_big_file.h @@ -13,14 +13,14 @@ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. */ -#ifndef __test_yaffs_ftruncate_EFBIG_h__ -#define __test_yaffs_ftruncate_EFBIG_h__ +#ifndef __test_yaffs_truncate_big_file_h__ +#define __test_yaffs_truncate_big_file_h__ #include "lib.h" #include "yaffsfs.h" #include "test_yaffs_open.h" -int test_yaffs_ftruncate_EFBIG(void); -int test_yaffs_ftruncate_EFBIG_clean(void); +int test_yaffs_truncate_big_file(void); +int test_yaffs_truncate_big_file_clean(void); #endif diff --git a/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c index d675d01..0515ab1 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c @@ -32,7 +32,7 @@ int test_yaffs_unlink_ENAMETOOLONG(void) output=yaffs_unlink(file_name); if (output==-1){ error_code=yaffs_get_error(); - if (abs(error_code)== EISDIR){ + if (abs(error_code)== ENAMETOOLONG){ return 1; } else { print_message("different error than expected\n",2); diff --git a/direct/timothy_tests/quick_tests/test_yaffs_write_EFBIG.c b/direct/timothy_tests/quick_tests/test_yaffs_write_big_file.c similarity index 94% rename from direct/timothy_tests/quick_tests/test_yaffs_write_EFBIG.c rename to direct/timothy_tests/quick_tests/test_yaffs_write_big_file.c index bfc591e..6d50331 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_write_EFBIG.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_write_big_file.c @@ -11,11 +11,11 @@ * published by the Free Software Foundation. */ -#include "test_yaffs_write_EFBIG.h" +#include "test_yaffs_write_big_file.h" static int handle=0; static char *file_name = NULL; -int test_yaffs_write_EFBIG(void) +int test_yaffs_write_big_file(void) { int output=0; int error_code=0; @@ -69,7 +69,7 @@ int test_yaffs_write_EFBIG(void) } -int test_yaffs_write_EFBIG_clean(void) +int test_yaffs_write_big_file_clean(void) { int output=1; if(file_name){ diff --git a/direct/timothy_tests/quick_tests/test_yaffs_write_EFBIG.h b/direct/timothy_tests/quick_tests/test_yaffs_write_big_file.h similarity index 80% rename from direct/timothy_tests/quick_tests/test_yaffs_write_EFBIG.h rename to direct/timothy_tests/quick_tests/test_yaffs_write_big_file.h index cb2a9b2..1596e44 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_write_EFBIG.h +++ b/direct/timothy_tests/quick_tests/test_yaffs_write_big_file.h @@ -13,14 +13,14 @@ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. */ -#ifndef __test_yaffs_write_EFBIG_h__ -#define __test_yaffs_write_EFBIG_h__ +#ifndef __test_yaffs_write_big_file_h__ +#define __test_yaffs_write_big_file_h__ #include "lib.h" #include "yaffsfs.h" #include "test_yaffs_open.h" #include "test_yaffs_write.h" #include "test_yaffs_truncate.h" -int test_yaffs_write_EFBIG(void); -int test_yaffs_write_EFBIG_clean(void); +int test_yaffs_write_big_file(void); +int test_yaffs_write_big_file_clean(void); #endif -- 2.30.2