hasty_test_hash_table_homo Program

program~~hasty_test_hash_table_homo~~UsesGraph program~hasty_test_hash_table_homo hasty_test_hash_table_homo module~hasty hasty module~hasty->program~hasty_test_hash_table_homo iso_fortran_env iso_fortran_env iso_fortran_env->program~hasty_test_hash_table_homo module~tester tester iso_fortran_env->module~tester module~penf_stringify penf_stringify iso_fortran_env->module~penf_stringify module~tester->program~hasty_test_hash_table_homo module~hasty_dictionary_node hasty_dictionary_node module~hasty_dictionary_node->module~hasty module~hasty_dictionary hasty_dictionary module~hasty_dictionary_node->module~hasty_dictionary module~hasty_hash_table hasty_hash_table module~hasty_hash_table->module~hasty module~hasty_content_adt hasty_content_adt module~hasty_content_adt->module~hasty module~hasty_content_adt->module~hasty_dictionary_node module~hasty_content_adt->module~hasty_hash_table module~hasty_dictionary->module~hasty module~hasty_dictionary->module~hasty_hash_table module~hasty_key_base hasty_key_base module~hasty_key_base->module~hasty module~hasty_key_base->module~hasty_dictionary_node module~hasty_key_base->module~hasty_hash_table module~hasty_key_base->module~hasty_dictionary module~hasty_key_morton hasty_key_morton module~hasty_key_base->module~hasty_key_morton module~hasty_key_morton->module~hasty module~penf penf module~penf->module~hasty_dictionary_node module~penf->module~hasty_hash_table module~penf->module~hasty_dictionary module~penf->module~hasty_key_base module~penf->module~hasty_key_morton module~penf_global_parameters_variables penf_global_parameters_variables module~penf_global_parameters_variables->module~penf module~penf_b_size penf_b_size module~penf_global_parameters_variables->module~penf_b_size module~penf_global_parameters_variables->module~penf_stringify module~penf_b_size->module~penf module~penf_b_size->module~penf_stringify module~penf_stringify->module~penf
Help


HASTY test hash table homogeneous.



Variables

Type AttributesNameInitial
type(tester_t) :: hasty_tester

Tests handler.

class(*), pointer:: a_content

A content.

type(hash_table) :: a_table

A table.


Source Code

program hasty_test_hash_table_homo
!-----------------------------------------------------------------------------------------------------------------------------------
!< HASTY test hash table homogeneous.
!-----------------------------------------------------------------------------------------------------------------------------------
use, intrinsic :: iso_fortran_env, only : int32
use hasty
use tester
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
type(tester_t)    :: hasty_tester !< Tests handler.
class(*), pointer :: a_content    !< A content.
type(hash_table)  :: a_table      !< A table.
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
call hasty_tester%init

call a_table%initialize(homogeneous=.true.)

call hasty_tester%assert_equal(a_table%is_homogeneous(), .true.)

call a_table%add_clone(key=5_int32, content=13_int32)
a_content => a_table%get_pointer(key=5_int32)
if (associated(a_content)) then
  select type(a_content)
  type is(integer(int32))
    call hasty_tester%assert_equal(a_content, 13_int32)
  endselect
endif

call a_table%destroy
call a_table%initialize(homogeneous=.true.)

a_content => null()
allocate(a_content, source=16_int32)
call a_table%add_pointer(key=3_int32, content=a_content)
a_content => a_table%get_pointer(key=3_int32)
if (associated(a_content)) then
  select type(a_content)
  type is(integer(int32))
    call hasty_tester%assert_equal(a_content, 16_int32)
  endselect
endif

call hasty_tester%print
!-----------------------------------------------------------------------------------------------------------------------------------
endprogram hasty_test_hash_table_homo