X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_unlink_ENAMETOOLONG.c;fp=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_unlink_ENAMETOOLONG.c;h=1803c839bb87798c6bb40530227f6c481c1524f4;hb=250248634f57704c06d3ae5050febb33ad5c67d8;hp=0000000000000000000000000000000000000000;hpb=9af5d90f5726655f1d5da3920fa6f3f0974041c2;p=yaffs2.git diff --git a/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c b/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c new file mode 100644 index 0000000..1803c83 --- /dev/null +++ b/direct/timothy_tests/quick_tests/test_yaffs_unlink_ENAMETOOLONG.c @@ -0,0 +1,59 @@ +/* + * 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_unlink_ENAMETOOLONG.h" + + +static int handle=0; +int test_yaffs_unlink_ENAMETOOLONG(void){ + int output=0; + int error_code=0; + int x=0; + int file_name_length=1000000; + char file_name[file_name_length]; + + strcat(file_name,YAFFS_MOUNT_POINT); + for (x=strlen(YAFFS_MOUNT_POINT); x=0){ + printf("directory unlinked opened.(which is a bad thing)\n"); + return -1; + } + /* the program should not get here but the compiler is complaining */ + return -1; +} +int test_yaffs_unlink_ENAMETOOLONG_clean(void){ + if (handle >=0){ + return yaffs_close(handle); + } + else { + return 1; /* the file failed to open so there is no need to close it*/ + } +} +