summaryrefslogtreecommitdiff
path: root/src/test.c
diff options
context:
space:
mode:
authorbpc2003 <wpesfriendnva@gmail.com>2025-05-09 16:19:14 -0400
committerbpc2003 <wpesfriendnva@gmail.com>2025-05-09 16:19:14 -0400
commit960985a8e4896156bdb9714ab8b0b2a41be5ac1a (patch)
tree869e8cdff2ef387ee474cb0421bb44e606faa2dd /src/test.c
parentb6858640ec6ca17dc746863d1e92cb2452253d7d (diff)
Continue trying to figure out decoder
Diffstat (limited to 'src/test.c')
-rw-r--r--src/test.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/test.c b/src/test.c
index 56b0933..35e6adf 100644
--- a/src/test.c
+++ b/src/test.c
@@ -234,9 +234,18 @@ void test_encode(void)
},
.n_attrs = 1,
.tag = "document",
- .payload = "test",
- .size = sizeof(char),
- .n = 4
+ .payload = (map_t []) {
+ {
+ .attrs = NULL,
+ .n_attrs = 0,
+ .tag = "test",
+ .payload = "test",
+ .size = sizeof(char),
+ .n = 4
+ }
+ },
+ .size = sizeof(map_t),
+ .n = 1
}
};
@@ -252,9 +261,10 @@ void test_encode(void)
void test_decode(void)
{
- char *xml_string="<documents><document><key>value</key></document><document><key>value</key></document></documents>";
- int len;
- map_t *map = decode(xml_string, &len);
+ char *xml =
+ "<documents><document><key>value1</key></document><document><key>value2</key></document></documents>";
+ int len = 0;
+ map_t *map = decode(xml, &len);
free(map);
}