| 310 CX_TEST_ASSERT(res2->contentlength >= content.length); |
310 CX_TEST_ASSERT(res2->contentlength >= content.length); |
| 311 |
311 |
| 312 dav_session_destroy(sn); |
312 dav_session_destroy(sn); |
| 313 } |
313 } |
| 314 } |
314 } |
| |
315 |
| |
316 CX_TEST(test_dav_move_webdav) { |
| |
317 CX_TEST_DO { |
| |
318 DavSession *sn = get_test_webdav_session(); |
| |
319 |
| |
320 DavResource *res1 = dav_resource_new(sn, "/test_dav_move_webdav.txt"); |
| |
321 CX_TEST_ASSERT(!dav_create(res1)); |
| |
322 |
| |
323 cxstring content = cx_str("Move Test Data"); |
| |
324 dav_set_content_data(res1, content.ptr, content.length); |
| |
325 CX_TEST_ASSERT(!dav_store(res1)); |
| |
326 |
| |
327 DavResource *res2 = dav_resource_new(sn, "/test_dav_move_webdav_dest.txt"); |
| |
328 CX_TEST_ASSERT(!dav_exists(res2)); |
| |
329 |
| |
330 CX_TEST_ASSERT(!dav_move(res1, res2->path)); |
| |
331 CX_TEST_ASSERT(!dav_exists(res1)); |
| |
332 CX_TEST_ASSERT(dav_exists(res2)); |
| |
333 CX_TEST_ASSERT(!dav_load(res2)); |
| |
334 // contentlength could be greater if encryption is enabled |
| |
335 CX_TEST_ASSERT(res2->contentlength >= content.length); |
| |
336 |
| |
337 dav_session_destroy(sn); |
| |
338 } |
| |
339 } |