seahag/test/create_fifo_node.c

22 lines
512 B
C
Raw Normal View History

#include <assert.h>
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include "haggis.h"
int main() {
haggis_linkmap *map;
haggis_node *node;
char *path = "output/fifo";
map = haggis_linkmap_init();
assert(map != NULL);
assert(mkfifo(path, 0644) == 0);
node = haggis_create_node(path, sha256, map);
assert(node->filetype.tag == fifo);
assert(memcmp(path, node->name.name, 11) == 0);
haggis_node_deinit(node);
haggis_linkmap_deinit(map);
return 0;
}