X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_lseek_EFBIG.c;h=6263c56b92e1f5767d6bcceade98ccad064a7c55;hp=5a001bb6f1f204661a6186e6cc791ecd31c00c09;hb=a32621e0d7f5f391e9152cfe710fa6c99ca44c50;hpb=4f90d524e3c666c53ae36ad2911e00e5b3741cca diff --git a/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c b/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c index 5a001bb..6263c56 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_lseek_EFBIG.c @@ -13,42 +13,40 @@ #include "test_yaffs_lseek_EFBIG.h" -static int handle=-1; +static int handle = -1; -int test_yaffs_lseek_EFBIG(void){ - handle=test_yaffs_open(); - int error_code=0; - int output=0; +int test_yaffs_lseek_EFBIG(void) +{ + handle = test_yaffs_open(); + int error_code = 0; + int output = 0; - if (handle<0){ - printf("failed to open file\n"); + if (handle < 0){ + print_message("failed to open file\n",2); return -1; } - yaffs_lseek(handle, 100000000000000000000000000000000000000, SEEK_SET); + output = yaffs_lseek(handle, 100000000000000000000000000000000000000, SEEK_SET); - if (output<0){ - error_code=yaffs_get_error(); - //printf("EISDIR def %d, Error code %d\n", ENOTDIR,error_code); - if (abs(error_code)==EINVAL){ + if (output < 0){ + error_code = yaffs_get_error(); + if (abs(error_code) == EINVAL){ return 1; - } - else { - printf("different error than expected\n"); + } else { + print_message("different error than expected\n", 2); return -1; } - } - else { - printf("lseeked to a very large size (which is a bad thing)\n"); + } else { + print_message("lseeked to a very large size (which is a bad thing)\n", 2); return -1; } } -int test_yaffs_lseek_EFBIG_clean(void){ - if (handle>=0){ +int test_yaffs_lseek_EFBIG_clean(void) +{ + if (handle >= 0){ return yaffs_close(handle); - } - else { + } else { return -1; /* no handle was opened so there is no need to close a handle */ } }