From d65a3ae8790ae28a90f0ebcf0bc4dc078c67dc35 Mon Sep 17 00:00:00 2001 From: jakob Date: Sun, 19 Feb 2017 20:49:43 -0500 Subject: Implemented eliF parsing. --- test/test_table.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'test/test_table.c') diff --git a/test/test_table.c b/test/test_table.c index efdac3d..e6c18b0 100644 --- a/test/test_table.c +++ b/test/test_table.c @@ -18,15 +18,16 @@ along with Nekopack. If not, see . */ #include +#include #include "minunit.h" +#include "io.h" #include "table.h" char *test_table_list(void) { struct table_entry *root = calloc(sizeof(struct table_entry), 1); - mu_assert("Structure not zeroed", root->next == NULL); struct table_entry *next = calloc(sizeof(struct table_entry), 1); next->key = 0xffffffff; entry_append(root, next); @@ -34,3 +35,17 @@ char *test_table_list(void) { entry_free(root); return NULL; } + + +char *test_table_elif(void) { + struct stream *s = stream_new(10); + struct table_entry *root = calloc(sizeof(struct table_entry), 1); + stream_write(s, "\xff\xff\xff\xff\x01\x00\x41\x00\x00\x00", 10); + stream_rewind(s); + read_elif(s, root); + mu_assert("Entry not inserted", root->next != NULL); + mu_assert("Filename handling failed", !strcmp(root->next->filename, "A")); + entry_free(root); + stream_free(s); + return NULL; +} -- cgit v1.3