2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2018 Aleph One Ltd.
6 * Created by Timothy Manning <timothy@yaffs.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include "test_yaffs_rmdir_ENAMETOOLONG.h"
16 int test_yaffs_rmdir_ENAMETOOLONG(void)
22 int file_name_length=1000000;
23 char file_name[file_name_length];
25 for (x=0; x<file_name_length -1; x++){
28 file_name[file_name_length-2]='\0';
32 if (0 != yaffs_access(DIR_PATH,0)) {
33 output = yaffs_mkdir(DIR_PATH,S_IWRITE | S_IREAD);
35 print_message("failed to create directory\n",2);
39 output = yaffs_rmdir(file_name);
41 error_code=yaffs_get_error();
42 if (abs(error_code)==ENAMETOOLONG){
45 print_message("returned error does not match the the expected error\n",2);
49 print_message("removed /yaffs2/ directory (which is a bad thing)\n",2);
55 int test_yaffs_rmdir_ENAMETOOLONG_clean(void)
58 if (0 == yaffs_access(DIR_PATH,0)) {
59 output = yaffs_rmdir(DIR_PATH);
61 print_message("failed to remove the directory\n",2);