Merge branch 'odin' of git.hitchhiker-linux.org:jeang3nie/seahag into odin

This commit is contained in:
Nathan Fisher 2023-08-22 03:28:04 -04:00
commit a8fcdbd140
4 changed files with 19 additions and 2 deletions

4
.gitignore vendored
View file

@ -1,7 +1,9 @@
haggis haggis
config.mk config.mk
test/output/ test/output/
test/ test/*
!test/*.c
!test/Makefile
*.o *.o
*.a *.a
*.so *.so

View file

@ -33,6 +33,7 @@
#include "haggis_private.h" #include "haggis_private.h"
#include <limits.h> // PATH_MAX #include <limits.h> // PATH_MAX
#include <stdio.h>
#include <stdlib.h> // calloc, free #include <stdlib.h> // calloc, free
#include <string.h> // strndup #include <string.h> // strndup
@ -113,7 +114,7 @@ void haggis_linkmap_deinit(haggis_linkmap *map) {
int i; int i;
for (i = 0; i < map->capacity; i++) { for (i = 0; i < map->capacity; i++) {
if (map->buckets[i].next == NULL) { if (map->buckets[i].next != NULL) {
haggis_bucket_deinit(map->buckets[i].next); haggis_bucket_deinit(map->buckets[i].next);
} }
} }

View file

@ -61,6 +61,7 @@ tests += store_file_sha256
tests += load_file_sha256 tests += load_file_sha256
tests += fnv1a_hash_inode tests += fnv1a_hash_inode
tests += fnv1a_hash_str tests += fnv1a_hash_str
tests += linkmap_init
total != echo $(tests) | wc -w | awk '{ print $$1 }' total != echo $(tests) | wc -w | awk '{ print $$1 }'

13
test/linkmap_init.c Normal file
View file

@ -0,0 +1,13 @@
#include <assert.h>
#include <stdio.h>
#include "haggis.h"
#include "haggis_private.h"
int main() {
haggis_linkmap *map;
map = haggis_linkmap_init();
assert(map != NULL);
haggis_linkmap_deinit(map);
}