2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Timothy Manning <timothy@yaffs.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include "test_yaffs_write_EFBIG.h"
17 static char *file_name = NULL;
18 int test_yaffs_write_EFBIG(void)
22 handle=test_yaffs_open();
25 long int file_name_length=100000000000;
27 file_name = malloc(file_name_length);
29 printf("unable to create file text\n");
33 strcat(file_name,YAFFS_MOUNT_POINT);
34 for (x=strlen(YAFFS_MOUNT_POINT); x<file_name_length -1; x++){
37 file_name[file_name_length-2]='\0';
42 output= yaffs_write(handle, file_name, file_name_length-1);
44 error_code=yaffs_get_error();
45 //printf("EISDIR def %d, Error code %d\n", ENOTDIR,error_code);
46 if (abs(error_code)==EINVAL){
49 printf("different error than expected\n");
53 printf("wrote a large amount of text to a file.(which is a bad thing)\n");
58 printf("error opening file\n");
64 int test_yaffs_write_EFBIG_clean(void)
73 output=yaffs_close(handle);
77 output= test_yaffs_truncate_clean();
79 output=test_yaffs_write();
83 printf("failed to write to file\n");
87 printf("failed to truncate file\n");