summaryrefslogtreecommitdiff
path: root/src/test.c
diff options
context:
space:
mode:
authorbpc2003 <wpesfriendnva@gmail.com>2025-05-12 13:25:29 -0400
committerbpc2003 <wpesfriendnva@gmail.com>2025-05-12 13:25:29 -0400
commite99a79f1499b6cfb60007587ebeda645c32d38dc (patch)
treed30220cda791f8ea0adecb8f8e4262be4335f150 /src/test.c
parent5bb744d350a68ff75e5af32b9070983b7e0aa716 (diff)
Have decoder working properly
Diffstat (limited to 'src/test.c')
-rw-r--r--src/test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test.c b/src/test.c
index 57ef27a..9c9492c 100644
--- a/src/test.c
+++ b/src/test.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "include/engine/engine.h"
#include "include/xml/xml.h"
@@ -265,6 +266,16 @@ void test_decode(void)
"<set><key1>value1</key1><key2>value2</key2></set>";
int len = 0, start = 0;
map_t *map = decode(xml, &start, &len);
+ printf("%s\n", (xml = encode(map, 1)));
+ free(xml);
+ // TODO: create a freemap function
+ free(map->tag);
+ map_t *pl = (map_t *) map->payload;
+ free(pl[0].tag);
+ free(pl[1].tag);
+ free(pl[0].payload);
+ free(pl[1].payload);
+ free(map->payload);
free(map);
}