src/server/test/webdav.c

branch
webdav
changeset 219
dd6c155c082a
parent 218
2ba512b284b9
child 220
2915b6c11aec
--- a/src/server/test/webdav.c	Tue Dec 31 11:57:02 2019 +0100
+++ b/src/server/test/webdav.c	Tue Dec 31 14:07:42 2019 +0100
@@ -42,7 +42,7 @@
 /* ----------------------------- Test Backends --------------------------*/
 
 static int backend2_init_called = 0;
-static int backend2_propfind_do_called = 0;
+static int backend2_propfind_do_count = 0;
 static int backend2_propfind_finish_called = 0;
 
 // backend2
@@ -62,7 +62,7 @@
             WebdavResource *resource,
             struct stat *s)
 {
-    backend2_propfind_do_called = 1;
+    backend2_propfind_do_count++;
     return 0;
 }
 
@@ -82,7 +82,7 @@
 // backend1
 
 static int backend1_init_called = 0;
-static int backend1_propfind_do_called = 0;
+static int backend1_propfind_do_count = 0;
 static int backend1_propfind_finish_called = 0;
 
 
@@ -112,7 +112,7 @@
             WebdavResource *resource,
             struct stat *s)
 {
-    backend1_propfind_do_called = 1;
+    backend1_propfind_do_count++;
     return 0;
 }
 
@@ -131,10 +131,10 @@
 
 static void reset_backends(void) {
     backend1_init_called = 0;
-    backend1_propfind_do_called = 0;
+    backend1_propfind_do_count = 0;
     backend1_propfind_finish_called = 0;
     backend2_init_called = 0;
-    backend2_propfind_do_called = 0;
+    backend2_propfind_do_count = 0;
     backend2_propfind_finish_called = 0;
 }
 
@@ -785,9 +785,28 @@
     
     int err = webdav_op_propfind_begin(op, "/", NULL, NULL);
     UCX_TEST_ASSERT(err == 0, "err not 0");
-    UCX_TEST_ASSERT(backend1_propfind_do_called == 1, "backend1 propfind_do not called");
-    UCX_TEST_ASSERT(backend2_propfind_do_called == 1, "backend2 propfind_do not called");
+    UCX_TEST_ASSERT(backend1_propfind_do_count == 1, "backend1 propfind_do not called");
+    UCX_TEST_ASSERT(backend2_propfind_do_count == 1, "backend2 propfind_do not called");
     
     
     UCX_TEST_END;
 }
+
+UCX_TEST(test_webdav_op_propfind_children) {
+    reset_backends();
+    
+    Session *sn;
+    Request *rq;
+    
+    UCX_TEST_BEGIN;
+    WebdavOperation *op = test_propfind_op(&sn, &rq, TEST_PROPFIND1);
+    UCX_TEST_ASSERT(op, "WebdavOperation not created");
+    
+    int err = webdav_op_propfind_begin(op, "/", NULL, NULL);
+    UCX_TEST_ASSERT(err == 0, "propfind_begin error");
+    
+    
+    
+    
+    UCX_TEST_END;
+}

mercurial