X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_open_file_ENOENT.c;h=ed57e2d6f8432c99d37d6e274ab67cd0e7c2488f;hp=02c02bbc38b3f85341a7a9a0eb72ced2fa99fcd2;hb=c118b37070fa47650ca61c8c740da7461450d139;hpb=d1be8e430d1b95bb0ff3b6af63132df9956173d6 diff --git a/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c b/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c index 02c02bb..ed57e2d 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_open_file_ENOENT.c @@ -1,19 +1,22 @@ #include "test_yaffs_open_file_ENOENT.h" - +static int handle=0; int test_yaffs_open_file_ENOENT(void){ - int output=0; - + int error_code=0; /*printf("path %s\n",path); */ - output=yaffs_open(FILE_PATH, O_TRUNC| O_RDWR, "/yaffs2/non_existant_file"); - if (output==ENOENT){ - return output; + handle=yaffs_open("/yaffs2/non_existant_file", O_TRUNC| O_RDWR,FILE_MODE ); + if (handle==-1){ + error_code=yaffs_get_error(); + if (error_code==ENOENT){ + return 1; + } } else if (output >=0){ printf("non existant file opened.(which is a bad thing)\n"); return -1; } + } int test_yaffs_open_file_ENOENT_clean(void){ return 1;