Skip to content

Commit 57faccd

Browse files
committed
Replaced go tos
At the suggestion of Jeremie I replaced a number of go tos. [ticket: X]
1 parent 20a15e5 commit 57faccd

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

src/tests/bitsets/test_stdlib_bitset_large.f90

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -766,57 +766,41 @@ subroutine test_bitset_inquiry()
766766

767767
call set0 % not()
768768
do i=0, set0 % bits() - 1
769-
if ( set0 % test(i) ) go to 100
769+
if ( set0 % test(i) ) then
770+
error stop procedure // ' against expectations set0 has ' // &
771+
'at least 1 bit set.'
772+
end if
770773
end do
771774

772775
write(*,*) 'As expected set0 had no bits set.'
773776

774-
go to 110
775-
776-
100 error stop procedure // ' against expectations set0 has ' // &
777-
'at least 1 bit set.'
778-
779-
110 continue
780-
781777
do i=0, set1 % bits() - 1
782-
if ( .not. set1 % test(i) ) go to 200
778+
if ( .not. set1 % test(i) ) then
779+
error stop procedure // ' against expectations set0 has ' // &
780+
'at least 1 bit unset.'
781+
end if
783782
end do
784783

785784
write(*,*) 'As expected set1 had all bits set.'
786785

787-
go to 210
788-
789-
200 error stop procedure // ' against expectations set0 has ' // &
790-
'at least 1 bit unset.'
791-
792-
210 continue
793-
794786
do i=0, set0 % bits() - 1
795-
if ( set0 % value(i) /= 0 ) go to 300
787+
if ( set0 % value(i) /= 0 ) then
788+
error stop procedure // ' against expectations set0 has ' // &
789+
'at least 1 bit set.'
790+
end if
796791
end do
797792

798793
write(*,*) 'As expected set0 had no bits set.'
799794

800-
go to 310
801-
802-
300 error stop procedure // ' against expectations set0 has ' // &
803-
'at least 1 bit set.'
804-
805-
310 continue
806-
807795
do i=0, set1 % bits() - 1
808-
if ( set1 % value(i) /= 1 ) go to 400
796+
if ( set1 % value(i) /= 1 ) then
797+
error stop procedure // ' against expectations set0 has ' // &
798+
'at least 1 bit unset.'
799+
end if
809800
end do
810801

811802
write(*,*) 'As expected set1 had all bits set.'
812803

813-
go to 410
814-
815-
400 error stop procedure // ' against expectations set0 has ' // &
816-
'at least 1 bit unset.'
817-
818-
410 continue
819-
820804
if ( set0 % bits() == 33 ) then
821805
write(*,*) 'set0 has 33 bits as expected.'
822806
else

0 commit comments

Comments
 (0)