diff options
| author | jakob <jakob@memeware.net> | 2017-02-19 20:49:43 -0500 |
|---|---|---|
| committer | jakob <jakob@memeware.net> | 2017-02-19 20:49:43 -0500 |
| commit | d65a3ae8790ae28a90f0ebcf0bc4dc078c67dc35 (patch) | |
| tree | 3eb2ad7f78f55cde5b809bc75904b36c5a747502 /test/test_table.c | |
| parent | 32fb7b11d83138cc288d62c1f1674d95cc94e8de (diff) | |
Implemented eliF parsing.
Diffstat (limited to 'test/test_table.c')
| -rw-r--r-- | test/test_table.c | 17 |
1 files changed, 16 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>. */ #include <stdlib.h> +#include <string.h> #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; +} |