test_count_nodes_depth_1 Subroutine

public subroutine test_count_nodes_depth_1()

Arguments

None

Calls

proc~~test_count_nodes_depth_1~~CallsGraph proc~test_count_nodes_depth_1 test_count_nodes_depth_1 assertequal assertequal proc~test_count_nodes_depth_1->assertequal next next proc~test_count_nodes_depth_1->next none~add_child~3 MeterNode%add_child proc~test_count_nodes_depth_1->none~add_child~3 none~begin~77 MeterNode%begin proc~test_count_nodes_depth_1->none~begin~77 none~get_num_nodes MeterNode%get_num_nodes proc~test_count_nodes_depth_1->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 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~317 MeterNodeVector%at 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_32~61 MeterNodeVector%at_32 none~at~317->none~at_32~61 none~resize_32~61 MeterNodeVector%resize_32 none~resize~132->none~resize_32~61

Source Code

   subroutine test_count_nodes_depth_1()
      type (MeterNode), target :: node

      class (AbstractMeterNodeIterator), allocatable :: iter
      integer :: count

      node = MeterNode('all', AdvancedMeter(MpiTimerGauge()))
      call node%add_child('a', AdvancedMeter(MpiTimerGauge()))
      call node%add_child('b', AdvancedMeter(MpiTimerGauge()))
      call node%add_child('c', AdvancedMeter(MpiTimerGauge()))

      count = 0
      allocate(iter, source=node%begin())
      do while (iter /= node%end())
         count = count + 1
         call iter%next()
      end do

      @assertEqual(node%get_num_nodes(), count)

      
   end subroutine test_count_nodes_depth_1