X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=direct%2Fdtest.c;h=ed552e75d5232b1e496135d4ba80a0d5b36d2f71;hb=b9d0902ef84af3e242f6a95fb7a1b79e1eb94aa8;hp=13e55c7196786fb022df7b6f1e6fcf66af21717f;hpb=1e45565bfda1879e1a661d8b2d1f4075b9fe1061;p=yaffs2.git diff --git a/direct/dtest.c b/direct/dtest.c index 13e55c7..ed552e7 100644 --- a/direct/dtest.c +++ b/direct/dtest.c @@ -1723,7 +1723,7 @@ void multi_mount_test(const char *mountpt,int nmounts) write_200k_file(b,"",""); - printf("######## Iteration %d Start\n",i); + printf("######## Iteration %d End\n",i); dump_directory_tree(mountpt); yaffs_unmount(mountpt); @@ -1731,6 +1731,58 @@ void multi_mount_test(const char *mountpt,int nmounts) } +void yaffs_touch(const char *fn) +{ + yaffs_chmod(fn, S_IREAD | S_IWRITE); +} + +void checkpoint_fill_test(const char *mountpt,int nmounts) +{ + + char a[50]; + char b[50]; + char c[50]; + + int i; + int j; + int h; + + sprintf(a,"%s/a",mountpt); + + + + + yaffs_StartUp(); + + for(i = 0; i < nmounts; i++){ + printf("############### Iteration %d Start\n",i); + yaffs_mount(mountpt); + dump_directory_tree(mountpt); + yaffs_mkdir(a,0); + + sprintf(b,"%s/zz",a); + + h = yaffs_open(b,O_CREAT | O_RDWR,S_IREAD |S_IWRITE); + + + while(yaffs_write(h,c,50) == 50){} + + yaffs_close(h); + + for(j = 0; j < 100; j++){ + printf("touch %d\n",j); + yaffs_touch(b); + yaffs_unmount(mountpt); + yaffs_mount(mountpt); + } + + dump_directory_tree(mountpt); + yaffs_unmount(mountpt); + } +} + + + int main(int argc, char *argv[]) { //return long_test(argc,argv); @@ -1747,7 +1799,8 @@ int main(int argc, char *argv[]) //scan_pattern_test("/flash",10000,10); //short_scan_test("/flash/flash",40000,200); - multi_mount_test("/flash/flash",20); + //multi_mount_test("/flash/flash",20); + checkpoint_fill_test("/flash/flash",20);