X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fdtest.c;h=f22babd454fe0931ad4f550040454b48f6ce88b0;hp=06a190ec2f77c6fd7013377129605fb6aa7a82b2;hb=acd9c3e51c4aa2f3b3810cc502026dab23253338;hpb=84875495636bc4c91fa330851f25af98325aa38e diff --git a/direct/dtest.c b/direct/dtest.c index 06a190e..f22babd 100644 --- a/direct/dtest.c +++ b/direct/dtest.c @@ -1440,6 +1440,53 @@ void fill_empty_files_test(const char *mountpt) } +void long_name_test(const char *mountpt) +{ + int i; + yaffs_StartUp(); + char fullName[1000]; + char name[300]; + int result = 0; + + int d,f; + + // Make a 256 byte name + memset(name,0,sizeof(name)); + for(i = 0; i < 256; i++) + name[i] = '0' + i % 10; + + sprintf(fullName,"%s/%s",mountpt,name); + + for(i = 0; i < 1; i++) + { + yaffs_mount(mountpt); + + printf("Files at start\n"); + dumpDir(mountpt); + + printf("Creating file %s\n",fullName); + + f = yaffs_open(fullName,O_CREAT | O_RDWR,0); + yaffs_close(f); + + printf("Result %d\n",f); + + printf("Files\n"); + dumpDir(mountpt); + + printf("Deleting %s\n",fullName); + result = yaffs_unlink(fullName); + printf("Result %d\n",result); + + printf("Files\n"); + + dumpDir(mountpt); + + yaffs_unmount(mountpt); + } + +} + void lookup_test(const char *mountpt) @@ -2360,7 +2407,8 @@ int main(int argc, char *argv[]) //rename_over_test("//////////////////flash///////////////////yaffs1///////////"); - fill_empty_files_test("/yaffs2/"); + //fill_empty_files_test("/yaffs2/"); + long_name_test("/yaffs2"); //scan_pattern_test("/flash",10000,10); //short_scan_test("/flash/flash",40000,200);