seahag/test/create_dir_node.c

23 lines
547 B
C
Raw Normal View History

2023-09-13 16:41:59 -04:00
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "haggis.h"
#include "mq.h"
2023-09-13 16:41:59 -04:00
int main() {
haggis_linkmap *map;
haggis_node *node;
haggis_mq mq;
2023-09-13 16:41:59 -04:00
char *path = "output";
map = haggis_linkmap_init();
assert(map != NULL);
assert(haggis_mq_init(&mq) == 0);
node = haggis_create_node(path, sha256, map, &mq);
2023-09-13 16:41:59 -04:00
assert(node->filetype.tag == directory);
assert(memcmp(path, node->name.name, 6) == 0);
2023-09-13 16:48:56 -04:00
haggis_node_deinit(node);
haggis_linkmap_deinit(map);
return 0;
2023-09-13 16:41:59 -04:00
}