test_get_inclusive Subroutine

public subroutine test_get_inclusive()

Arguments

None

Calls

proc~~test_get_inclusive~~CallsGraph proc~test_get_inclusive test_get_inclusive add_cycle add_cycle proc~test_get_inclusive->add_cycle assertequal assertequal proc~test_get_inclusive->assertequal none~add_child~3 MeterNode%add_child proc~test_get_inclusive->none~add_child~3 none~get_child~16 MeterNode%get_child proc~test_get_inclusive->none~get_child~16 none~get_inclusive MeterNode%get_inclusive proc~test_get_inclusive->none~get_inclusive none~get_meter MeterNode%get_meter proc~test_get_inclusive->none~get_meter 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 get_total get_total none~get_inclusive->get_total 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_get_inclusive()
      type (MeterNode), target:: node
      class (AbstractMeter), pointer :: root_meter
      class (AbstractMeter), pointer :: submeter
      class (AbstractMeterNode), pointer :: child

      node = MeterNode('all', AdvancedMeter(MpiTimerGauge()))

      call node%add_child('sub1', AdvancedMeter(MpiTimerGauge()))

      root_meter => node%get_meter()
      child => node%get_child('sub1')
      submeter => child%get_meter()

      call submeter%add_cycle(1.0_REAL64)
      call root_meter%add_cycle(3.0_REAL64)
      @assertEqual(3.0, node%get_inclusive())

   end subroutine test_get_inclusive