test_get_num_nodes Subroutine

public subroutine test_get_num_nodes()

Arguments

None

Calls

proc~~test_get_num_nodes~~CallsGraph proc~test_get_num_nodes test_get_num_nodes assertequal assertequal proc~test_get_num_nodes->assertequal none~add_child~3 MeterNode%add_child proc~test_get_num_nodes->none~add_child~3 none~get_child~16 MeterNode%get_child proc~test_get_num_nodes->none~get_child~16 none~get_num_nodes MeterNode%get_num_nodes proc~test_get_num_nodes->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()
      type (MeterNode) :: node
      class (AbstractMeterNode), pointer :: child

      @assertEqual(1, node%get_num_nodes())

      call node%add_child('a', AdvancedMeter(MpiTimerGauge()))
      @assertEqual(2, node%get_num_nodes())

      call node%add_child('b', AdvancedMeter(MpiTimerGauge()))
      @assertEqual(3, node%get_num_nodes())

      child => node%get_child('a')
      call child%add_child('cat', AdvancedMeter(MpiTimerGauge()))
      call child%add_child('dog', AdvancedMeter(MpiTimerGauge()))
      call child%add_child('fish', AdvancedMeter(MpiTimerGauge()))

      @assertEqual(6, node%get_num_nodes())
      
      
   end subroutine test_get_num_nodes