fixed control flow in int_cmd + committed testcase (enable with #define DO_THE_TEST)

Sat, 02 May 2015 18:52:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 02 May 2015 18:52:04 +0200
changeset 105
ee0de2b1872e
parent 104
6fb4d24d9df9
child 106
9cec78f23cbf

fixed control flow in int_cmd + committed testcase (enable with #define DO_THE_TEST)

dav/main.c file | annotate | diff | comparison | revisions
--- a/dav/main.c	Sat May 02 18:45:13 2015 +0200
+++ b/dav/main.c	Sat May 02 18:52:04 2015 +0200
@@ -32,7 +32,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
-#include <libxml/xmlerror.h>
 #include <sys/types.h>
 #include <ucx/string.h>
 #include <ucx/utils.h>
@@ -51,8 +50,13 @@
     // nothing
 }
 
+//#define DO_THE_TEST
+#include <libidav/davqlparser.h>
 void test() {
-    
+    DavQLStatement *stmt = dav_parse_statement(S(
+        "get *,count(*) as count from /uap/House of Cards with depth = infinity"));
+    dav_debug_statement(stmt);
+    dav_free_statement(stmt);
 }
 
 int main(int argc, char **argv) {
@@ -60,8 +64,9 @@
     initGenericErrorDefaultFunc(&fnc);
     ctx = dav_context_new();
     load_config(ctx);
-    //dav_add_namespace(ctx, "U", "http://www.uap-core.de/");
-    //test();
+#ifdef DO_THE_TEST
+    test();
+#endif
     
     memcpy(ctx->http_proxy, get_http_proxy(), sizeof(Proxy));
     memcpy(ctx->https_proxy, get_https_proxy(), sizeof(Proxy));
@@ -1090,6 +1095,7 @@
         }
         
         dav_session_free(sn, properties);
+        return 0;
     } else {
         print_resource_error(sn, res->path);
         return -1;

mercurial