src/server/plugins/postgresql/pgtest.c

branch
webdav
changeset 295
73a1243fce15
parent 294
277a5896a2ec
child 296
78e92337fa4e
equal deleted inserted replaced
294:277a5896a2ec 295:73a1243fce15
209 209
210 testutil_destroy_session(sn); 210 testutil_destroy_session(sn);
211 } 211 }
212 212
213 UCX_TEST(test_pg_vfs_mkdir) { 213 UCX_TEST(test_pg_vfs_mkdir) {
214 214 Session *sn = testutil_session();
215 Request *rq = testutil_request(sn->pool, "PUT", "/");
216 rq->vfs = create_test_pgvfs(sn, rq);
217 VFSContext *vfs = vfs_request_context(sn, rq);
218
219 UCX_TEST_BEGIN;
220
221 SYS_FILE f1 = vfs_open(vfs, "/test_mkdir/file", O_WRONLY|O_CREAT);
222 UCX_TEST_ASSERT(f1 == NULL, "open should fail");
223
224 int r = vfs_mkdir(vfs, "/test_mkdir");
225 UCX_TEST_ASSERT(r == 0, "mkdir failed");
226
227 f1 = vfs_open(vfs, "/test_mkdir/file", O_WRONLY|O_CREAT);
228 UCX_TEST_ASSERT(f1, "open failed");
229
230 r = vfs_mkdir(vfs, "/test_mkdir/test_sub");
231 UCX_TEST_ASSERT(r == 0, "mkdir failed (2)");
232
233 UCX_TEST_END;
234
235 testutil_destroy_session(sn);
215 } 236 }
216 237
217 UCX_TEST(test_pg_vfs_unlink) { 238 UCX_TEST(test_pg_vfs_unlink) {
218 Session *sn = testutil_session(); 239 Session *sn = testutil_session();
219 Request *rq = testutil_request(sn->pool, "PUT", "/"); 240 Request *rq = testutil_request(sn->pool, "PUT", "/");

mercurial