1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* Copyright (C) 2003-2004 Novell, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 /* Server-side rule test program */
29 #include "e2k-context.h"
30 #include "e2k-propnames.h"
32 #include "e2k-rule-xml.h"
33 #include "test-utils.h"
35 const char *test_program_name = "ruletest";
37 static const char *rules_props[] = {
40 static const int n_rules_props = sizeof (rules_props) / sizeof (rules_props[0]);
43 test_main (int argc, char **argv)
55 fprintf (stderr, "Usage: %s URL\n", argv[0]);
60 ctx = test_get_context (url);
61 status = e2k_context_propfind (ctx, NULL, url,
62 rules_props, n_rules_props,
64 test_abort_if_http_error (status);
66 ba = e2k_properties_get_prop (results[0].props, PR_RULES_DATA);
68 printf ("No rules\n");
72 rules = e2k_rules_from_binary (ba);
74 printf ("Could not parse rules\n");
78 doc = e2k_rules_to_xml (rules);
80 xmlDocFormatDump (stdout, doc, TRUE);
83 printf ("Could not convert normal rules to XML\n");
85 e2k_rules_free (rules);
86 e2k_results_free (results, nresults);