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~5 MeterNode%add_child proc~test_get_num_nodes->none~add_child~5 none~get_child~21 MeterNode%get_child proc~test_get_num_nodes->none~get_child~21 none~get_num_nodes~2 MeterNode%get_num_nodes proc~test_get_num_nodes->none~get_num_nodes~2 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 get_num_nodes get_num_nodes none~get_num_nodes~2->get_num_nodes none~begin~107 MeterNodeVector%begin none~get_num_nodes~2->none~begin~107 none~get~187 MeterNodeVectorIterator%get none~get_num_nodes~2->none~get~187 none~next~106 MeterNodeVectorIterator%next none~get_num_nodes~2->none~next~106 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_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