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~5 MeterNode%add_child proc~test_simple->none~add_child~5 none~get_child~21 MeterNode%get_child proc~test_simple->none~get_child~21 none~get_meter~4 MeterNode%get_meter proc~test_simple->none~get_meter~4 none~get_rows~6 SimpleColumn%get_rows proc~test_simple->none~get_rows~6 none~find_child MeterNode%find_child none~add_child~5->none~find_child none~get_depth~3 MeterNode%get_depth none~add_child~5->none~get_depth~3 none~push_back~62 MeterNodeVector%push_back none~add_child~5->none~push_back~62 none~at~304 MeterNodeVector%at none~get_child~21->none~at~304 none~get_child~21->none~find_child begin begin none~get_rows~6->begin get get none~get_rows~6->get get_row get_row none~get_rows~6->get_row next next none~get_rows~6->next push_back push_back none~get_rows~6->push_back none~at_32~56 MeterNodeVector%at_32 none~at~304->none~at_32~56 none~find_child->none~at~304 none~capacity~367 MeterNodeVector%capacity none~push_back~62->none~capacity~367 none~resize~124 MeterNodeVector%resize none~push_back~62->none~resize~124 none~at_size_kind~62 MeterNodeVector%at_size_kind none~at_32~56->none~at_size_kind~62 none~resize_32~56 MeterNodeVector%resize_32 none~resize~124->none~resize_32~56

Source Code

   subroutine test_simple()
      type(MeterNode), target :: node
      class(AbstractMeterNode), pointer :: subnode
      class(AbstractMeter), pointer :: t
      type(ExclusiveColumn) :: c
      type(UnlimitedVector), target :: v
      integer :: i
      integer :: expected(3)
      class(*), pointer :: 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