UNIXworkcode

1 /* 2 * To change this license header, choose License Headers in Project Properties. 3 * To change this template file, choose Tools | Templates 4 * and open the template in the editor. 5 */ 6 7 /* 8 * File: pgtest.h 9 * Author: olaf 10 * 11 * Created on 16. April 2022, 14:37 12 */ 13 14 #ifndef PGTEST_H 15 #define PGTEST_H 16 17 #include "../../test/test.h" 18 #include <cx/map.h> 19 #include <cx/mempool.h> 20 #include <libxml/tree.h> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 typedef struct TestMultistatus { 27 CxMempool *mp; 28 xmlDoc *doc; 29 CxMap *responses; 30 } TestMultistatus; 31 32 typedef struct TestResponse { 33 char *href; 34 CxMap *properties; 35 } TestResponse; 36 37 typedef struct TestProperty { 38 char *prefix; 39 char *namespace; 40 char *name; 41 char *lang; 42 char *value; 43 xmlNode *node; 44 int status; 45 } TestProperty; 46 47 TestMultistatus* test_parse_multistatus(const char *space, size_t size); 48 void test_multistatus_destroy(TestMultistatus *ms); 49 50 UCX_TEST(test_pg_conn); 51 52 UCX_TEST(test_pg_lookup_root); 53 54 UCX_TEST(test_pg_vfs_open); 55 UCX_TEST(test_pg_vfs_io); 56 UCX_TEST(test_pg_vfs_stat); 57 UCX_TEST(test_pg_vfs_mkdir); 58 UCX_TEST(test_pg_vfs_unlink); 59 UCX_TEST(test_pg_vfs_rmdir); 60 61 UCX_TEST(test_pg_webdav_create_from_resdata); 62 UCX_TEST(test_pg_prepare_tests); 63 UCX_TEST(test_pg_webdav_propfind); 64 UCX_TEST(test_pg_webdav_propfind_allprop); 65 UCX_TEST(test_pg_webdav_proppatch_set); 66 67 68 /* --------------------------- PROPFIND --------------------------- */ 69 70 #define PG_TEST_PROPFIND1 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ 71 <D:propfind xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" > \ 72 <D:prop> \ 73 <D:displayname/> \ 74 <D:getcontentlength/> \ 75 <D:getcontenttype/> \ 76 <D:getlastmodified/> \ 77 <D:creationdate/> \ 78 <D:resourcetype/> \ 79 <D:getetag/> \ 80 </D:prop> \ 81 </D:propfind>" 82 83 #define PG_TEST_PROPFIND2 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ 84 <D:propfind xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" > \ 85 <D:prop> \ 86 <D:displayname/> \ 87 <D:getcontentlength/> \ 88 <D:getcontenttype/> \ 89 <D:getlastmodified/> \ 90 <D:creationdate/> \ 91 <D:resourcetype/> \ 92 <D:getetag/> \ 93 <X:test /> \ 94 <X:prop2 /> \ 95 </D:prop> \ 96 </D:propfind>" 97 98 #define PG_TEST_ALLPROP "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ 99 <D:propfind xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" > \ 100 <D:allprop/> \ 101 </D:propfind>" 102 103 #define PG_TEST_PROPPATCH1 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ 104 <D:propertyupdate xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\"> \ 105 <D:set> \ 106 <D:prop><X:test>test</X:test><X:author>name</X:author></D:prop> \ 107 </D:set> \ 108 </D:propertyupdate>" 109 110 #define PG_TEST_PROPPATCH2 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ 111 <D:propertyupdate xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" xmlns:XA=\"http://example.com/a/\"> \ 112 <D:set> \ 113 <D:prop>\ 114 <XA:xtest>\ 115 <XA:elm>value</XA:elm>\ 116 <X:ex>example</X:ex>\ 117 <Z:nstest xmlns:Z=\"http://example.com/z\">\ 118 <Y:nstest2 xmlns:Y=\"http://example.com/y\"></Y:nstest2>\ 119 </Z:nstest>\ 120 </XA:xtest>\ 121 </D:prop> \ 122 </D:set> \ 123 </D:propertyupdate>" 124 125 #ifdef __cplusplus 126 } 127 #endif 128 129 #endif /* PGTEST_H */ 130 131