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~5 MeterNode%add_child proc~test_next_one_child->none~add_child~5 none~begin~106 MeterNode%begin proc~test_next_one_child->none~begin~106 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~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_32~56 MeterNodeVector%at_32 none~at~304->none~at_32~56 none~resize_32~56 MeterNodeVector%resize_32 none~resize~124->none~resize_32~56

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