Skip to content

Commit 9f0e4a9

Browse files
committed
Fixed up constants
Made many constants of kind bits_kind so the pertinent procedures would be recognized. [ticket: X]
1 parent 0deab15 commit 9f0e4a9

File tree

2 files changed

+69
-69
lines changed

2 files changed

+69
-69
lines changed

src/tests/bitsets/test_stdlib_bitset_64.f90

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ subroutine test_initialization()
277277
end if
278278

279279
set5 = log1
280-
call extract( set4, set5, 1, 33 )
280+
call extract( set4, set5, 1_bits_kind, 33_bits_kind )
281281
if ( set4 % bits() /= 33 ) then
282282
error stop procedure // &
283283
' initialization with extract failed to set' // &
@@ -360,7 +360,7 @@ end subroutine test_initialization
360360

361361
subroutine test_bitset_inquiry()
362362
character(*), parameter:: procedure = 'TEST_BITSET_INQUIRY'
363-
integer :: i
363+
integer(bits_kind) :: i
364364

365365
write(*,*)
366366
write(*,*) 'Test bitset inquiry: all, any, bits, none, test, and value'
@@ -472,9 +472,9 @@ subroutine test_bit_operations()
472472
error stop procedure // ' set1 is not all set.'
473473
end if
474474

475-
call set1 % clear(0)
476-
if ( .not. set1 % test(0) ) then
477-
if ( set1 % test(1) ) then
475+
call set1 % clear(0_bits_kind)
476+
if ( .not. set1 % test(0_bits_kind) ) then
477+
if ( set1 % test(1_bits_kind) ) then
478478
write(*,*) 'Cleared one bit in set1 as expected.'
479479
else
480480
error stop procedure // ' cleared more than one bit in set1.'
@@ -483,17 +483,17 @@ subroutine test_bit_operations()
483483
error stop procedure // ' did not clear the first bit in set1.'
484484
end if
485485

486-
call set1 % clear(1, 32)
486+
call set1 % clear(1_bits_kind, 32_bits_kind)
487487
if ( set1 % none() ) then
488488
write(*,*) 'Cleared remaining bits in set1 as expected.'
489489
else
490490
error stop procedure // ' did not clear remaining bits ' // &
491491
'in set1.'
492492
end if
493493

494-
call set1 % flip(0)
495-
if ( set1 % test(0) ) then
496-
if ( .not. set1 % test(1) ) then
494+
call set1 % flip(0_bits_kind)
495+
if ( set1 % test(0_bits_kind) ) then
496+
if ( .not. set1 % test(1_bits_kind) ) then
497497
write(*,*) 'Flipped one bit in set1 as expected.'
498498
else
499499
error stop procedure // ' flipped more than one bit in set1.'
@@ -502,7 +502,7 @@ subroutine test_bit_operations()
502502
error stop procedure // ' did not flip the first bit in set1.'
503503
end if
504504

505-
call set1 % flip(1, 32)
505+
call set1 % flip(1_bits_kind, 32_bits_kind)
506506
if ( set1 % all() ) then
507507
write(*,*) 'Flipped remaining bits in set1 as expected.'
508508
else
@@ -517,9 +517,9 @@ subroutine test_bit_operations()
517517
error stop procedure // ' did not unset bits in set1.'
518518
end if
519519

520-
call set1 % set(0)
521-
if ( set1 % test(0) ) then
522-
if ( .not. set1 % test(1) ) then
520+
call set1 % set(0_bits_kind)
521+
if ( set1 % test(0_bits_kind) ) then
522+
if ( .not. set1 % test(1_bits_kind) ) then
523523
write(*,*) 'Set first bit in set1 as expected.'
524524
else
525525
error stop procedure // ' set more than one bit in set1.'
@@ -528,7 +528,7 @@ subroutine test_bit_operations()
528528
error stop procedure // ' did not set the first bit in set1.'
529529
end if
530530

531-
call set1 % set(1, 32)
531+
call set1 % set(1_bits_kind, 32_bits_kind)
532532
if ( set1 % all() ) then
533533
write(*,*) 'Set the remaining bits in set1 as expected.'
534534
else

src/tests/bitsets/test_stdlib_bitset_large.f90

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ subroutine test_initialization()
503503
end if
504504

505505
set5 = log1
506-
call extract( set4, set5, 1, 33 )
506+
call extract( set4, set5, 1_bits_kind, 33_bits_kind )
507507
if ( set4 % bits() /= 33 ) then
508508
error stop procedure // &
509509
' initialization with extract failed to set' // &
@@ -517,7 +517,7 @@ subroutine test_initialization()
517517
end if
518518

519519
set5 = log11
520-
call extract( set4, set5, 1, 65 )
520+
call extract( set4, set5, 1_bits_kind, 65_bits_kind )
521521
if ( set4 % bits() /= 65 ) then
522522
error stop procedure // &
523523
' initialization with extract failed to set' // &
@@ -677,7 +677,7 @@ end subroutine test_initialization
677677

678678
subroutine test_bitset_inquiry()
679679
character(*), parameter:: procedure = 'TEST_BITSET_INQUIRY'
680-
integer :: i
680+
integer(bits_kind) :: i
681681

682682
write(*,*)
683683
write(*,*) 'Test bitset inquiry: all, any, bits, none, test, and value'
@@ -898,9 +898,9 @@ subroutine test_bit_operations()
898898
error stop procedure // ' set1 is not all set.'
899899
end if
900900

901-
call set1 % clear(0)
902-
if ( .not. set1 % test(0) ) then
903-
if ( set1 % test(1) ) then
901+
call set1 % clear(0_bits_kind)
902+
if ( .not. set1 % test(0_bits_kind) ) then
903+
if ( set1 % test(1_bits_kind) ) then
904904
write(*,*) 'Cleared one bit in set1 as expected.'
905905
else
906906
error stop procedure // ' cleared more than one bit in set1.'
@@ -909,17 +909,17 @@ subroutine test_bit_operations()
909909
error stop procedure // ' did not clear the first bit in set1.'
910910
end if
911911

912-
call set1 % clear(1, 32)
912+
call set1 % clear(1_bits_kind, 32_bits_kind)
913913
if ( set1 % none() ) then
914914
write(*,*) 'Cleared remaining bits in set1 as expected.'
915915
else
916916
error stop procedure // ' did not clear remaining bits ' // &
917917
'in set1.'
918918
end if
919919

920-
call set1 % flip(0)
921-
if ( set1 % test(0) ) then
922-
if ( .not. set1 % test(1) ) then
920+
call set1 % flip(0_bits_kind)
921+
if ( set1 % test(0_bits_kind) ) then
922+
if ( .not. set1 % test(1_bits_kind) ) then
923923
write(*,*) 'Flipped one bit in set1 as expected.'
924924
else
925925
error stop procedure // ' flipped more than one bit in set1.'
@@ -928,7 +928,7 @@ subroutine test_bit_operations()
928928
error stop procedure // ' did not flip the first bit in set1.'
929929
end if
930930

931-
call set1 % flip(1, 32)
931+
call set1 % flip(1_bits_kind, 32_bits_kind)
932932
if ( set1 % all() ) then
933933
write(*,*) 'Flipped remaining bits in set1 as expected.'
934934
else
@@ -943,9 +943,9 @@ subroutine test_bit_operations()
943943
error stop procedure // ' did not unset bits in set1.'
944944
end if
945945

946-
call set1 % set(0)
947-
if ( set1 % test(0) ) then
948-
if ( .not. set1 % test(1) ) then
946+
call set1 % set(0_bits_kind)
947+
if ( set1 % test(0_bits_kind) ) then
948+
if ( .not. set1 % test(1_bits_kind) ) then
949949
write(*,*) 'Set first bit in set1 as expected.'
950950
else
951951
error stop procedure // ' set more than one bit in set1.'
@@ -954,23 +954,23 @@ subroutine test_bit_operations()
954954
error stop procedure // ' did not set the first bit in set1.'
955955
end if
956956

957-
call set1 % set(1, 32)
957+
call set1 % set(1_bits_kind, 32_bits_kind)
958958
if ( set1 % all() ) then
959959
write(*,*) 'Set the remaining bits in set1 as expected.'
960960
else
961961
error stop procedure // ' did not set the remaining bits ' // &
962962
'in set1.'
963963
end if
964964

965-
call set11 % init( 166 )
965+
call set11 % init( 166_bits_kind )
966966
call set11 % not()
967967
if ( .not. set11 % all() ) then
968968
error stop procedure // ' set11 is not all set.'
969969
end if
970970

971-
call set11 % clear(0)
972-
if ( .not. set11 % test(0) ) then
973-
if ( set11 % test(1) ) then
971+
call set11 % clear(0_bits_kind)
972+
if ( .not. set11 % test(0_bits_kind) ) then
973+
if ( set11 % test(1_bits_kind) ) then
974974
write(*,*) 'Cleared one bit in set11 as expected.'
975975
else
976976
error stop procedure // ' cleared more than one bit in set11.'
@@ -979,9 +979,9 @@ subroutine test_bit_operations()
979979
error stop procedure // ' did not clear the first bit in set11.'
980980
end if
981981

982-
call set11 % clear(165)
983-
if ( .not. set11 % test(165) ) then
984-
if ( set11 % test(164) ) then
982+
call set11 % clear(165_bits_kind)
983+
if ( .not. set11 % test(165_bits_kind) ) then
984+
if ( set11 % test(164_bits_kind) ) then
985985
write(*,*) 'Cleared the last bit in set11 as expected.'
986986
else
987987
error stop procedure // ' cleared more than one bit in set11.'
@@ -990,17 +990,17 @@ subroutine test_bit_operations()
990990
error stop procedure // ' did not clear the last bit in set11.'
991991
end if
992992

993-
call set11 % clear(1, 164)
993+
call set11 % clear(1_bits_kind, 164_bits_kind)
994994
if ( set11 % none() ) then
995995
write(*,*) 'Cleared remaining bits in set11 as expected.'
996996
else
997997
error stop procedure // ' did not clear remaining bits ' // &
998998
'in set11.'
999999
end if
10001000

1001-
call set11 % flip(0)
1002-
if ( set11 % test(0) ) then
1003-
if ( .not. set11 % test(1) ) then
1001+
call set11 % flip(0_bits_kind)
1002+
if ( set11 % test(0_bits_kind) ) then
1003+
if ( .not. set11 % test(1_bits_kind) ) then
10041004
write(*,*) 'Flipped one bit in set11 as expected.'
10051005
else
10061006
error stop procedure // ' flipped more than one bit in set11.'
@@ -1009,9 +1009,9 @@ subroutine test_bit_operations()
10091009
error stop procedure // ' did not flip the first bit in set11.'
10101010
end if
10111011

1012-
call set11 % flip(165)
1013-
if ( set11 % test(165) ) then
1014-
if ( .not. set11 % test(164) ) then
1012+
call set11 % flip(165_bits_kind)
1013+
if ( set11 % test(165_bits_kind) ) then
1014+
if ( .not. set11 % test(164_bits_kind) ) then
10151015
write(*,*) 'Flipped last bit in set11 as expected.'
10161016
else
10171017
error stop procedure // ' flipped more than one bit in set11.'
@@ -1020,7 +1020,7 @@ subroutine test_bit_operations()
10201020
error stop procedure // ' did not flip the last bit in set11.'
10211021
end if
10221022

1023-
call set11 % flip(1, 164)
1023+
call set11 % flip(1_bits_kind, 164_bits_kind)
10241024
if ( set11 % all() ) then
10251025
write(*,*) 'Flipped remaining bits in set11 as expected.'
10261026
else
@@ -1035,9 +1035,9 @@ subroutine test_bit_operations()
10351035
error stop procedure // ' did not unset bits in set11.'
10361036
end if
10371037

1038-
call set11 % set(0)
1039-
if ( set11 % test(0) ) then
1040-
if ( .not. set11 % test(1) ) then
1038+
call set11 % set(0_bits_kind)
1039+
if ( set11 % test(0_bits_kind) ) then
1040+
if ( .not. set11 % test(1_bits_kind) ) then
10411041
write(*,*) 'Set first bit in set11 as expected.'
10421042
else
10431043
error stop procedure // ' set more than one bit in set11.'
@@ -1046,9 +1046,9 @@ subroutine test_bit_operations()
10461046
error stop procedure // ' did not set the first bit in set11.'
10471047
end if
10481048

1049-
call set11 % set(165)
1050-
if ( set11 % test(165) ) then
1051-
if ( .not. set11 % test(164) ) then
1049+
call set11 % set(165_bits_kind)
1050+
if ( set11 % test(165_bits_kind) ) then
1051+
if ( .not. set11 % test(164_bits_kind) ) then
10521052
write(*,*) 'Set last bit in set11 as expected.'
10531053
else
10541054
error stop procedure // ' set more than one bit in set11.'
@@ -1057,7 +1057,7 @@ subroutine test_bit_operations()
10571057
error stop procedure // ' did not set the last bit in set11.'
10581058
end if
10591059

1060-
call set11 % set(1, 164)
1060+
call set11 % set(1_bits_kind, 164_bits_kind)
10611061
if ( set11 % all() ) then
10621062
write(*,*) 'Set the remaining bits in set11 as expected.'
10631063
else
@@ -1123,15 +1123,15 @@ subroutine test_bitset_comparisons()
11231123
'equal tests.'
11241124
end if
11251125

1126-
call set10 % init(166)
1127-
call set11 % init(166)
1126+
call set10 % init(166_bits_kind)
1127+
call set11 % init(166_bits_kind)
11281128
call set11 % not()
1129-
call set12 % init(166)
1130-
call set12 % set(165)
1131-
call set13 % init(166)
1132-
call set13 % set(65)
1133-
call set14 % init(166)
1134-
call set14 % set(0)
1129+
call set12 % init(166_bits_kind)
1130+
call set12 % set(165_bits_kind)
1131+
call set13 % init(166_bits_kind)
1132+
call set13 % set(65_bits_kind)
1133+
call set14 % init(166_bits_kind)
1134+
call set14 % set(0_bits_kind)
11351135
if ( set10 == set10 .and. set11 == set11 .and. set12 == set12 .and. &
11361136
set13 == set13 .and. set14 == set14 .and. &
11371137
.not. set13 == set14 .and. .not. set12 == set13 .and. &
@@ -1337,9 +1337,9 @@ subroutine test_bitset_operations()
13371337
error stop procedure // ' fourth test of < 64 bit XOR failed.'
13381338
end if
13391339

1340-
call set0 % init(166)
1340+
call set0 % init(166_bits_kind)
13411341
call set0 % not()
1342-
call set4 % init(166)
1342+
call set4 % init(166_bits_kind)
13431343
call set4 % not()
13441344
call and( set0, set4 ) ! all all
13451345
if ( set0 % all() ) then
@@ -1348,15 +1348,15 @@ subroutine test_bitset_operations()
13481348
error stop procedure // ' first test of > 64 bit AND failed.'
13491349
end if
13501350

1351-
call set4 % init(166)
1351+
call set4 % init(166_bits_kind)
13521352
call and( set0, set4 ) ! all none
13531353
if ( set0 % none() ) then
13541354
write(*,*) 'Second test of > 64 bit AND worked.'
13551355
else
13561356
error stop procedure // ' second test of > 64 bit AND failed.'
13571357
end if
13581358

1359-
call set3 % init(166)
1359+
call set3 % init(166_bits_kind)
13601360
call set3 % not()
13611361
call and( set4, set3 ) ! none all
13621362
if ( set4 % none() ) then
@@ -1365,7 +1365,7 @@ subroutine test_bitset_operations()
13651365
error stop procedure // ' third test of > 64 bit AND failed.'
13661366
end if
13671367

1368-
call set3 % init(166)
1368+
call set3 % init(166_bits_kind)
13691369
call and( set4, set3 ) ! none none
13701370
if ( set4 % none() ) then
13711371
write(*,*) 'Fourth test of > 64 bit AND worked.'
@@ -1404,9 +1404,9 @@ subroutine test_bitset_operations()
14041404
error stop procedure // ' fourth test of > 64 bit AND_NOT failed.'
14051405
end if
14061406

1407-
call set3 % init(166)
1407+
call set3 % init(166_bits_kind)
14081408
call set3 % not()
1409-
call set4 % init(166)
1409+
call set4 % init(166_bits_kind)
14101410
call set4 % not()
14111411
call or( set3, set4 ) ! all all
14121412
if ( set3 % all() ) then
@@ -1415,7 +1415,7 @@ subroutine test_bitset_operations()
14151415
error stop procedure // ' first test of > 64 bit OR failed.'
14161416
end if
14171417

1418-
call set3 % init(166)
1418+
call set3 % init(166_bits_kind)
14191419
call or( set4, set3 ) ! all none
14201420
if ( set4 % all() ) then
14211421
write(*,*) 'Second test of > 64 bit OR worked.'
@@ -1430,8 +1430,8 @@ subroutine test_bitset_operations()
14301430
error stop procedure // ' third test of > 64 bit OR failed.'
14311431
end if
14321432

1433-
call set3 % init(166)
1434-
call set4 % init(166)
1433+
call set3 % init(166_bits_kind)
1434+
call set4 % init(166_bits_kind)
14351435
call or( set4, set3 ) !none none
14361436
if ( set4 % none() ) then
14371437
write(*,*) 'Fourth test of > 64 bit OR worked.'

0 commit comments

Comments
 (0)