Skip to content

Commit

Permalink
Adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
logie17 committed Jul 18, 2016
1 parent f3f9d46 commit ff6dd89
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Expand Up @@ -5,3 +5,8 @@ list_test: list_test.c
clang `pkg-config --cflags glib-2.0` `pkg-config --libs glib-2.0` -g -Wall -std=gnu99 -o list_test list_test.c list.c
./list_test
rm list_test

hash_test: hash_test.c
clang `pkg-config --cflags glib-2.0` `pkg-config --libs glib-2.0` -g -Wall -std=gnu99 -o hash_test hash_test.c hash.c
./hash_test
rm hash_test
18 changes: 18 additions & 0 deletions hash_test.c
@@ -0,0 +1,18 @@
#include <glib.h>
#include "hash.h"

HashTable * test_hash = NULL;

// Create Hash Tests
static void create_hash (void) {
g_assert (test_hash == NULL);
test_hash = hash_table_new();
g_assert (test_hash != NULL);
}

int main(int argc, char ** argv) {
g_test_init(&argc, &argv, NULL);
g_test_add_func ("/Create hash", create_hash);
return g_test_run();
}

0 comments on commit ff6dd89

Please sign in to comment.