X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_unlink_ENOENT.c;h=113b14840fd045734db81907d27dcfc248465139;hp=882125780431f55fe2a0f23f6a3d1191db1ecfea;hb=a32621e0d7f5f391e9152cfe710fa6c99ca44c50;hpb=4adb62b1e4338eaa34d02fdcb0c5d99cebea6747 diff --git a/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENOENT.c b/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENOENT.c index 8821257..113b148 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENOENT.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENOENT.c @@ -13,33 +13,32 @@ #include "test_yaffs_unlink_ENOENT.h" -static int handle=0; -int test_yaffs_unlink_ENOENT(void){ - int output=0; +static int handle=-1; + +int test_yaffs_unlink_ENOENT(void) +{ int error_code=0; - /*printf("path %s\n",path); */ + handle=yaffs_unlink("/yaffs2/non_existant_file"); if (handle==-1){ error_code=yaffs_get_error(); - if (abs(error_code)==ENOENT){ + if (abs(error_code) == ENOENT){ return 1; - } - else { - printf("different error than expected\n"); + } else { + print_message("different error than expected\n",2); return -1; } - } - else if (output >=0){ - printf("non existant file unlinked.(which is a bad thing)\n"); + } else { + print_message("non existant file unlinked.(which is a bad thing)\n",2); return -1; } } -int test_yaffs_unlink_ENOENT_clean(void){ - if (handle >=0){ +int test_yaffs_unlink_ENOENT_clean(void) +{ + if (handle >= 0){ return test_yaffs_open(); - } - else { + } else { return 1; /* the file failed to open so there is no need to close it*/ } }