summaryrefslogtreecommitdiffstats
path: root/tests/tests2.c
blob: 808af6a98c6b48645ee399466aecd4b3c822344d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "../lasso/lasso.h"
#include "../lasso/xml/xml.h"
#include <glib.h>
#include <libxml/tree.h>

void load(char *file) {
	LassoNode *node = NULL;
	char *content;
	size_t len;
	xmlNode *xmlnode;

	g_file_get_contents(file, &content, &len, NULL);
	node = lasso_node_new_from_dump(content);
	g_free(content);
	xmlnode = lasso_node_get_xmlNode(node, TRUE);
	content = lasso_node_dump(node);
	g_free(content);
	content = lasso_node_export_to_soap(node);
	g_free(content);

	g_object_unref(node);
	xmlFreeNode(xmlnode);
}

int main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv) {
	lasso_init();
	load(SRCDIR "/data/response-1");
	load(SRCDIR "/data/response-2");
	load(SRCDIR "/data/response-3");
	load(SRCDIR "/data/response-4");
	lasso_shutdown();

	return 0;
}