diff options
Diffstat (limited to 'src/02/04/hash_test.c')
| -rw-r--r-- | src/02/04/hash_test.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/02/04/hash_test.c b/src/02/04/hash_test.c new file mode 100644 index 0000000..6eeaebd --- /dev/null +++ b/src/02/04/hash_test.c @@ -0,0 +1,26 @@ +#include "hash.h" +#include <cgreen/cgreen.h> +#include <string.h> + +Describe(HashTable); +BeforeEach(HashTable) {} +AfterEach(HashTable) {} + +Ensure(HashTable, when_initializing_a_hash) { + Hash *hash = hash_init(13); + + assert_that(hash, is_not_equal_to(NULL)); +} + +TestSuite *hash_table_tests() { + TestSuite *suite = create_test_suite(); + + add_test_with_context(suite, HashTable, when_initializing_a_hash); + return suite; +} + +int main(int argc, char **argv) { + TestSuite *suite = create_test_suite(); + add_suite(suite, hash_table_tests()); + return run_test_suite(suite, create_text_reporter()); +} |
