23 lines
598 B
C
23 lines
598 B
C
![]() |
#include <assert.h>
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <unistd.h>
|
||
|
|
||
|
#include "haggis.h"
|
||
|
|
||
|
int main() {
|
||
|
haggis_linkmap *map;
|
||
|
haggis_node *node;
|
||
|
char *path = "output/dev";
|
||
|
|
||
|
map = haggis_linkmap_init();
|
||
|
assert(map != NULL);
|
||
|
symlink("device", "output/dev");
|
||
|
node = haggis_create_node(path, sha256, map);
|
||
|
assert(node->filetype.tag == softlink);
|
||
|
assert(memcmp(path, node->name.name, 10) == 0);
|
||
|
assert(memcmp(node->filetype.f_type.target.name, "device", 6) == 0);
|
||
|
haggis_node_deinit(node);
|
||
|
haggis_linkmap_deinit(map);
|
||
|
return 0;
|
||
|
}
|