89 |
89 |
90 if(file) { |
90 if(file) { |
91 vfsdir->name = sstrdup_a( |
91 vfsdir->name = sstrdup_a( |
92 session_get_allocator(dir->ctx->sn), |
92 session_get_allocator(dir->ctx->sn), |
93 sstr(test_resource_name(file->path.ptr))); |
93 sstr(test_resource_name(file->path.ptr))); |
|
94 ZERO(entry, sizeof(VFS_ENTRY)); |
94 entry->name = vfsdir->name.ptr; |
95 entry->name = vfsdir->name.ptr; |
95 return 1; |
96 return 1; |
96 } else { |
97 } else { |
97 return 0; |
98 return 0; |
98 } |
99 } |
306 UCX_TEST_END; |
307 UCX_TEST_END; |
307 |
308 |
308 testutil_destroy_session(sn); |
309 testutil_destroy_session(sn); |
309 } |
310 } |
310 |
311 |
311 UCX_TEST(test_readdir) { |
312 UCX_TEST(test_vfs_readdir) { |
312 Session *sn = testutil_session(); |
313 Session *sn = testutil_session(); |
313 Request *rq = testutil_request(sn->pool, "PUT", "/"); |
314 Request *rq = testutil_request(sn->pool, "PUT", "/"); |
314 rq->vfs = testvfs_create(sn); |
315 rq->vfs = testvfs_create(sn); |
315 |
316 |
316 VFSContext *vfs = vfs_request_context(sn, rq); |
317 VFSContext *vfs = vfs_request_context(sn, rq); |