Skip to content

Commit dec1f12

Browse files
committed
Fix test conditions for stdlib_bitset_large tests
1 parent 0185e3a commit dec1f12

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/tests/bitsets/test_stdlib_bitset_large.f90

+9-17
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ subroutine test_io(error)
206206
call set3 % read_bitset(unit)
207207
call set5 % read_bitset(unit)
208208
call set4 % read_bitset(unit)
209-
call check(error, set4 /= set0 .or. set5 /= set1 .or. set3 /= set2, &
209+
call check(error, set4 == set0 .and. set5 == set1 .and. set3 == set2, &
210210
'transfer to and from units using bitset literals failed.')
211211

212212
if (.not.allocated(error)) then
@@ -223,7 +223,7 @@ subroutine test_io(error)
223223
call set13 % read_bitset(unit)
224224
call set15 % read_bitset(unit)
225225
call set14 % read_bitset(unit)
226-
call check(error, set14 /= set10 .or. set15 /= set11 .or. set3 /= set12, &
226+
call check(error, set14 == set10 .and. set15 == set11 .and. set3 == set12, &
227227
'transfer to and from units using bitset literals for bits > 64 failed.')
228228
end if
229229
if (.not.allocated(error)) then
@@ -237,7 +237,7 @@ subroutine test_io(error)
237237
call set3 % read_bitset(unit, advance='no')
238238
call set4 % read_bitset(unit, advance='no')
239239
call set5 % read_bitset(unit)
240-
call check(error, set5 /= set0 .or. set4 /= set1 .or. set3 /= set2, &
240+
call check(error, set5 == set0 .and. set4 == set1 .and. set3 == set2, &
241241
'transfer to and from units using bitset literals with advance == "no" failed.')
242242
end if
243243
if (.not.allocated(error)) then
@@ -251,7 +251,7 @@ subroutine test_io(error)
251251
call set13 % read_bitset(unit, advance='no')
252252
call set14 % read_bitset(unit, advance='no')
253253
call set15 % read_bitset(unit)
254-
call check(error, set15 /= set10 .or. set14 /= set11 .or. set13 /= set12, &
254+
call check(error, set15 == set10 .and. set14 == set11 .and. set13 == set12, &
255255
'transfer to and from units using bitset literals for bitss > 64 with advance == "no" failed.')
256256
end if
257257

@@ -267,7 +267,7 @@ subroutine test_io(error)
267267
call set5 % input(unit)
268268
call set4 % input(unit)
269269
call set3 % input(unit)
270-
call check(error, set3 /= set0 .or. set4 /= set1 .or. set5 /= set2, &
270+
call check(error, set3 == set0 .and. set4 == set1 .and. set5 == set2, &
271271
'transfer to and from units using output and input failed.')
272272

273273
close( unit )
@@ -282,7 +282,7 @@ subroutine test_io(error)
282282
call set5 % input(unit)
283283
call set4 % input(unit)
284284
call set3 % input(unit)
285-
call check(error, set3 /= set0 .or. set4 /= set1 .or. set5 /= set2, &
285+
call check(error, set3 == set0 .and. set4 == set1 .and. set5 == set2, &
286286
'transfer to and from units using stream output and input failed.')
287287

288288
close( unit )
@@ -297,7 +297,7 @@ subroutine test_io(error)
297297
call set15 % input(unit)
298298
call set14 % input(unit)
299299
call set13 % input(unit)
300-
call check(error, set13 /= set10 .or. set14 /= set11 .or. set15 /= set12, &
300+
call check(error, set13 == set10 .and. set14 == set11 .and. set15 == set12, &
301301
'transfer to and from units using output and input failed for bits . 64.')
302302
close(unit)
303303
if (allocated(error)) return
@@ -311,7 +311,7 @@ subroutine test_io(error)
311311
call set15 % input(unit)
312312
call set14 % input(unit)
313313
call set13 % input(unit)
314-
call check(error, set13 /= set10 .or. set14 /= set11 .or. set15 /= set12, &
314+
call check(error, set13 == set10 .and. set14 == set11 .and. set15 == set12, &
315315
'transfer to and from units using stream output and input failed for bits . 64.')
316316
close(unit)
317317
if (allocated(error)) return
@@ -594,32 +594,24 @@ subroutine test_bitset_inquiry(error)
594594
if (allocated(error)) return
595595
end do
596596

597-
write(*,*) 'As expected set0 had no bits set.'
598-
599597
do i=0, set1 % bits() - 1
600598
call check(error, set1 % test(i), &
601599
'against expectations set0 has at least 1 bit unset.')
602600
if (allocated(error)) return
603601
end do
604602

605-
write(*,*) 'As expected set1 had all bits set.'
606-
607603
do i=0, set0 % bits() - 1
608604
call check(error, set0 % value(i), 0, &
609605
'against expectations set0 has at least 1 bit set.')
610606
if (allocated(error)) return
611607
end do
612608

613-
write(*,*) 'As expected set0 had no bits set.'
614-
615609
do i=0, set1 % bits() - 1
616610
call check(error, set1 % value(i), 1, &
617611
'against expectations set0 has at least 1 bit unset.')
618612
if (allocated(error)) return
619613
end do
620614

621-
write(*,*) 'As expected set1 had all bits set.'
622-
623615
call check(error, set0 % bits() == 33, &
624616
'set0 unexpectedly does not have 33 bits.')
625617
if (allocated(error)) return
@@ -750,7 +742,7 @@ subroutine test_bit_operations(error)
750742

751743
call set11 % init( 166_bits_kind )
752744
call set11 % not()
753-
call check(error, .not. set11 % all(), &
745+
call check(error, set11 % all(), &
754746
'set11 is not all set.')
755747
if (allocated(error)) return
756748

0 commit comments

Comments
 (0)