test_simple Subroutine

public subroutine test_simple()

Arguments

None

Calls

proc~~test_simple~~CallsGraph proc~test_simple test_simple add_cycle add_cycle proc~test_simple->add_cycle assertequal assertequal proc~test_simple->assertequal at at proc~test_simple->at none~add_child~3 MeterNode%add_child proc~test_simple->none~add_child~3 none~get_child~16 MeterNode%get_child proc~test_simple->none~get_child~16 none~get_meter MeterNode%get_meter proc~test_simple->none~get_meter none~get_rows~2 SimpleColumn%get_rows proc~test_simple->none~get_rows~2 none~find_child MeterNode%find_child none~add_child~3->none~find_child none~get_depth MeterNode%get_depth none~add_child~3->none~get_depth none~push_back~66 MeterNodeVector%push_back none~add_child~3->none~push_back~66 none~at~317 MeterNodeVector%at none~get_child~16->none~at~317 none~get_child~16->none~find_child begin begin none~get_rows~2->begin get get none~get_rows~2->get get_row get_row none~get_rows~2->get_row next next none~get_rows~2->next push_back push_back none~get_rows~2->push_back none~at_32~61 MeterNodeVector%at_32 none~at~317->none~at_32~61 none~find_child->none~at~317 none~capacity~391 MeterNodeVector%capacity none~push_back~66->none~capacity~391 none~resize~132 MeterNodeVector%resize none~push_back~66->none~resize~132 none~at_size_kind~66 MeterNodeVector%at_size_kind none~at_32~61->none~at_size_kind~66 none~resize_32~61 MeterNodeVector%resize_32 none~resize~132->none~resize_32~61

Source Code

   subroutine test_simple()
      type(MeterNode), target :: node
      class(AbstractMeterNode), pointer :: subnode
      class(AbstractMeter), pointer :: t
      type(ExclusiveColumn) :: c
      type(UnlimitedVector) :: v
      integer :: i
      integer :: expected(3)
      class(*), allocatable :: q
      
      node = MeterNode('top', AdvancedMeter(MpiTimerGauge()))
      t => node%get_meter()
      call t%add_cycle(10.0d0)
      
      call node%add_child('a', AdvancedMeter(MpiTimerGauge()))
      subnode => node%get_child('a')
      t => subnode%get_meter()
      call t%add_cycle(1.0d0)

      call node%add_child('b', AdvancedMeter(MpiTimerGauge()))
      subnode => node%get_child('b')
      t => subnode%get_meter()
      call t%add_cycle(2.0d0)

      v = c%get_rows(node)
      expected = [7,1,2]
      do i = 1, 3
         q = v%at(i)
         select type (q)
         type is (integer)
            @assertEqual(expected(i), q)
         end select
      end do

   end subroutine test_simple