319 |
319 |
320 if(!dir->isdir) { |
320 if(!dir->isdir) { |
321 return 1; |
321 return 1; |
322 } |
322 } |
323 |
323 |
324 CxIterator i = cxMapIteratorValues(vfs->files); |
324 CxMapIterator i = cxMapIteratorValues(vfs->files); |
325 cx_foreach(TestVFSFile *, f, i) { |
325 cx_foreach(TestVFSFile *, f, i) { |
326 if(f->path.length > dir->path.length && cx_strprefix(cx_strcast(f->path), cx_strcast(dir->path))){ |
326 if(f->path.length > dir->path.length && cx_strprefix(cx_strcast(f->path), cx_strcast(dir->path))){ |
327 return 1; // dir not empty |
327 return 1; // dir not empty |
328 } |
328 } |
329 } |
329 } |
452 VFSEntry entry; |
452 VFSEntry entry; |
453 while(vfs_readdir(dir, &entry)) { |
453 while(vfs_readdir(dir, &entry)) { |
454 cxMapPut(files, cx_hash_key_str(entry.name), dir); |
454 cxMapPut(files, cx_hash_key_str(entry.name), dir); |
455 } |
455 } |
456 |
456 |
457 UCX_TEST_ASSERT(files->size == 4, "wrong files count"); |
457 UCX_TEST_ASSERT(cxMapSize(files)== 4, "wrong files count"); |
458 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file1")), "file1 missing"); |
458 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file1")), "file1 missing"); |
459 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file2")), "file2 missing"); |
459 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file2")), "file2 missing"); |
460 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file3")), "file3 missing"); |
460 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file3")), "file3 missing"); |
461 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file4")), "file4 missing"); |
461 UCX_TEST_ASSERT(cxMapGet(files, cx_hash_key_str("file4")), "file4 missing"); |
462 |
462 |
463 cxMapDestroy(files); |
463 cxMapFree(files); |
464 |
464 |
465 UCX_TEST_END; |
465 UCX_TEST_END; |
466 |
466 |
467 testutil_destroy_session(sn); |
467 testutil_destroy_session(sn); |
468 } |
468 } |