test_get_num_nodes_2 Subroutine

public subroutine test_get_num_nodes_2()

Arguments

None

Calls

proc~~test_get_num_nodes_2~~CallsGraph proc~test_get_num_nodes_2 test_get_num_nodes_2 assertequal assertequal proc~test_get_num_nodes_2->assertequal none~add_child~3 MeterNode%add_child proc~test_get_num_nodes_2->none~add_child~3 none~get_child~16 MeterNode%get_child proc~test_get_num_nodes_2->none~get_child~16 none~get_num_nodes MeterNode%get_num_nodes proc~test_get_num_nodes_2->none~get_num_nodes 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_num_nodes get_num_nodes none~get_num_nodes->get_num_nodes none~begin~103 MeterNodeVector%begin none~get_num_nodes->none~begin~103 none~get~202 MeterNodeVectorIterator%get none~get_num_nodes->none~get~202 none~next~108 MeterNodeVectorIterator%next none~get_num_nodes->none~next~108 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_num_nodes_2()
      type (MeterNode) :: node
      class (AbstractMeterNode), pointer :: child

      @assertEqual(1, node%get_num_nodes())

      call node%add_child('a', AdvancedMeter(MpiTimerGauge()))
      child => node%get_child('a')
      call child%add_child('1', AdvancedMeter(MpiTimerGauge()))
      call child%add_child('2', AdvancedMeter(MpiTimerGauge()))

      call node%add_child('b', AdvancedMeter(MpiTimerGauge()))
      child => node%get_child('b')
      call child%add_child('1', AdvancedMeter(MpiTimerGauge()))
      call child%add_child('2', AdvancedMeter(MpiTimerGauge()))

      @assertEqual(7, node%get_num_nodes())
      call node%add_child('a', AdvancedMeter(MpiTimerGauge())) ! should already exist
      
      @assertEqual(7, node%get_num_nodes())
      
      
   end subroutine test_get_num_nodes_2