test_next_one_child Subroutine

public subroutine test_next_one_child()

Arguments

None

Calls

proc~~test_next_one_child~~CallsGraph proc~test_next_one_child test_next_one_child assertfalse assertfalse proc~test_next_one_child->assertfalse asserttrue asserttrue proc~test_next_one_child->asserttrue next next proc~test_next_one_child->next none~add_child~3 MeterNode%add_child proc~test_next_one_child->none~add_child~3 none~begin~77 MeterNode%begin proc~test_next_one_child->none~begin~77 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~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_next_one_child()
      type (MeterNode) :: node

      class (AbstractMeterNodeIterator), allocatable :: iter_1
      class (AbstractMeterNodeIterator), allocatable :: iter_2

      node = MeterNode('all', AdvancedMeter(MpiTimerGauge()))
      allocate(iter_1, source=node%begin())
      allocate(iter_2, source=node%begin())

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

      call iter_1%next()
      call iter_2%next()
      @assertTrue(iter_1 == iter_2)
      @assertFalse(iter_1 /= iter_2)

      call iter_1%next()
      call iter_2%next()
      @assertTrue(iter_1 == iter_2)
      @assertFalse(iter_1 /= iter_2)

   end subroutine test_next_one_child