X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_fstat_EBADF.c;h=dace9f98e09316012d7e65807d8dabf12f82d025;hp=e44482ded45ec40b49a00157b33efe181b7de6f7;hb=00ebf30805d631cd9bb3155aa249705b3a5777f5;hpb=4adb62b1e4338eaa34d02fdcb0c5d99cebea6747 diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fstat_EBADF.c b/direct/timothy_tests/quick_tests/test_yaffs_fstat_EBADF.c index e44482d..dace9f9 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_fstat_EBADF.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_fstat_EBADF.c @@ -1,7 +1,7 @@ /* * YAFFS: Yet another FFS. A NAND-flash specific file system. * - * Copyright (C) 2002-2010 Aleph One Ltd. + * Copyright (C) 2002-2011 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Timothy Manning @@ -14,29 +14,28 @@ #include "test_yaffs_fstat_EBADF.h" -int test_yaffs_fstat_EBADF(void){ - int output=0; +int test_yaffs_fstat_EBADF(void) +{ + int output = 0; struct yaffs_stat stat; - int error_code=0; - output=yaffs_fstat(-1 , &stat); - if (output<0){ - error_code=yaffs_get_error(); - //printf("EISDIR def %d, Error code %d\n", EISDIR,error_code); - if (abs(error_code)== EBADF){ + int error_code = 0; + + output = yaffs_fstat(-1 , &stat); + if (output < 0){ + error_code = yaffs_get_error(); + if (abs(error_code) == EBADF){ return 1; - } - else { - printf("different error than expected\n"); + } else { + print_message("different error than expected\n", 2); return -1; } - } - else { - printf("non existant file truncated.(which is a bad thing)\n"); + } else { + print_message("non existant file truncated.(which is a bad thing)\n", 2 ); return -1; } } -int test_yaffs_fstat_EBADF_clean(void){ - return 1; - +int test_yaffs_fstat_EBADF_clean(void) +{ + return 1; }