Skip to content
Snippets Groups Projects
Commit 15c3cd53 authored by Jonas Jucker's avatar Jonas Jucker Committed by Yen-Chen Chen
Browse files

more tests for hashmap

parent e6d146d6
No related branches found
No related tags found
1 merge request!64Draft: add test for util_stride
Pipeline #100950 passed
......@@ -30,7 +30,7 @@ CONTAINS
TYPE(t_HashTable), POINTER :: hashTable
TYPE(t_HashIterator) :: iterator
CLASS(*), POINTER :: key, val
CLASS(*), POINTER :: key, val, retrieved_val
CHARACTER(8), TARGET, ALLOCATABLE :: keyword(:)
INTEGER, TARGET, ALLOCATABLE :: int_value(:)
LOGICAL :: success
......@@ -51,9 +51,19 @@ CONTAINS
CALL hashTable%setEntry(key, val)
END DO
CALL TAG_TEST("TEST_hash_table_int")
CALL TAG_TEST("TEST_hash_table_entry_count")
CALL ASSERT_EQUAL(hashTable%getEntryCount(), table_size)
CALL TAG_TEST("TEST_hash_table_getEntry_3")
key => keyword(3)
retrieved_val => hashTable%getEntry(key)
CALL ASSERT_EQUAL(TRANSFER(retrieved_val, 0), int_value(3))
CALL TAG_TEST("TEST_hash_table_getEntry_10")
key => keyword(10)
retrieved_val => hashTable%getEntry(key)
CALL ASSERT_EQUAL(TRANSFER(retrieved_val, 0), int_value(10))
END SUBROUTINE TEST_hash_table_int
END MODULE TEST_mo_hash_table
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment