diff options
| author | mo khan <mo.khan@gmail.com> | 2020-08-03 14:27:51 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-08-03 14:27:51 -0600 |
| commit | ff6613d40afa4eecf8c1ec49ae75ee38daf44e03 (patch) | |
| tree | 25b4c715b71e67964d62efbb4ae7e1cc899f7745 /src/02/04/hash_test.c | |
| parent | e291a2c6b57af1889010529031e07d5236fc1570 (diff) | |
Store Tuples in the hash
Diffstat (limited to 'src/02/04/hash_test.c')
| -rw-r--r-- | src/02/04/hash_test.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/02/04/hash_test.c b/src/02/04/hash_test.c index 01c4211..3d940f5 100644 --- a/src/02/04/hash_test.c +++ b/src/02/04/hash_test.c @@ -21,10 +21,10 @@ Ensure(HashTable, when_getting_a_value_for_a_key_that_has_not_been_inserted) { Ensure(HashTable, when_getting_a_values_for_a_key_that_has_been_inserted) { int key = 7; int value = 100; - /*Hash *hash = hash_init(13);*/ + Hash *hash = hash_init(13); - /*hash_set(hash, key, value);*/ - /*assert_that(hash_get(hash, key), is_equal_to(value));*/ + hash_set(hash, key, value); + assert_that(hash_get(hash, key), is_equal_to(value)); } Ensure(HashTable, when_a_hash_collision_occurs) { @@ -40,14 +40,15 @@ Ensure(HashTable, when_a_hash_collision_occurs) { TestSuite *hash_table_tests() { TestSuite *suite = create_test_suite(); - /*add_test_with_context(suite, HashTable, when_initializing_a_hash);*/ - /*add_test_with_context(suite, HashTable, when_getting_a_value_for_a_key_that_has_not_been_inserted);*/ - /*add_test_with_context(suite, HashTable, when_getting_a_values_for_a_key_that_has_been_inserted);*/ + add_test_with_context(suite, HashTable, when_initializing_a_hash); + add_test_with_context(suite, HashTable, when_getting_a_value_for_a_key_that_has_not_been_inserted); + add_test_with_context(suite, HashTable, when_getting_a_values_for_a_key_that_has_been_inserted); /*add_test_with_context(suite, HashTable, when_a_hash_collision_occurs);*/ return suite; } extern TestSuite *list_tests(); +extern TestSuite *tuple_tests(); int main(int argc, char **argv) { TestSuite *suite = create_test_suite(); |
