MONC
test_monc_component.F90
Go to the documentation of this file.
1 ! Tests the component registry functionality
3  use fruit, only : assert_equals, add_fail, assert_true, &
4  assert_false, set_unit_name, assert_not_equals
6  use state_mod, only : model_state_type
9  use collections_mod, only : map_type, c_size, c_value_at, c_key_at
10  implicit none
11 
12 
13 
14 contains
15  ! Test
16  subroutine test_parameters
17  call assert_not_equals(2,init_priority_index,"Test INIT_PRIORITY_INDEX is not real")
18  call assert_equals(1,init_priority_index,"Test INIT_PRIORITY_INDEX is value expected")
19  call assert_equals(2,timestep_priority_index,"Test TIMESTEP_PRIORITY_INDEX is value expected")
20  call assert_equals(5,finalisation_priority_index,"Test FINALISATION_PRIORITY_INDEX is value expected")
21  end subroutine test_parameters
22 
23 end module test_monc_component_mod
24 
25 
26 ! The driver for testing the registry
28  use fruit, only : init_fruit, run_test_case, fruit_summary
30 
31  implicit none
32 
33  call init_fruit
34  call run_test_case(test_parameters, "Testing parameters")
35 
36  call fruit_summary
38 
Retrieves the key currently being held at a specific index in the map or "" if the index > map elemen...
Converts a data type into the generic (class *) form.
Definition: conversions.F90:23
The ModelState which represents the current state of a run.
Definition: state.F90:39
Conversion between common inbuilt FORTRAN data types.
Definition: conversions.F90:5
Converts data types to strings.
Definition: conversions.F90:36
program test_monc_component_driver
Map data structure that holds string (length 20 maximum) key value pairs.
Definition: collections.F90:86
Returns the number of elements in the collection.
Interfaces and types that MONC components must specify.
integer, parameter, public timestep_priority_index
Collection data structures.
Definition: collections.F90:7
integer, parameter, public finalisation_priority_index
integer, parameter, public init_priority_index
Index of each priority value in the descriptor.
Converts data types to integers.
Definition: conversions.F90:47
The model state which represents the current state of a run.
Definition: state.F90:2