Skip to content

Changed filenames #388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions src/tests/bitsets/test_stdlib_bitset_64.f90
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@ subroutine test_io()
'write_bitset'

call set2 % from_string( bitstring_33 )
open( newunit=unit, file='test64_1.txt', status='replace', &
form='formatted', action='write' )
open( newunit=unit, status='scratch', form='formatted', &
action='readwrite' )
call set2 % write_bitset(unit)
call set1 % write_bitset(unit)
call set0 % write_bitset(unit)
close( unit )
open( newunit=unit, file='test64_1.txt', status='old', &
form='formatted', action='read' )
rewind( unit )
call set3 % read_bitset(unit)
call set5 % read_bitset(unit)
call set4 % read_bitset(unit)
Expand All @@ -167,66 +165,59 @@ subroutine test_io()
'plain write_bitset_unit and read_bitset_unit succeeded.'
end if

close( unit )
rewind( unit )

open( newunit=unit, file='test64_2.txt', status='replace', &
form='formatted', action='write' )
call set2 % write_bitset(unit, advance='no')
call set1 % write_bitset(unit, advance='no')
call set0 % write_bitset(unit)
close( unit )
open( newunit=unit, file='test64_2.txt', status='old', &
form='formatted', action='read' )
rewind( unit )
call set3 % read_bitset(unit, advance='no')
call set4 % read_bitset(unit, advance='no')
call set5 % read_bitset(unit)

if ( set5 /= set0 .or. set4 /= set1 .or. set3 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' bitset literals with advance == "no" failed.'
'bitset literals with advance == "no" failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'write_bitset_unit and read_bitset_unit with ' // &
'advance=="no" succeeded.'
end if
close(unit)

open( newunit=unit, file='test.bin', status='replace', &
form='unformatted', action='write' )
open( newunit=unit, form='unformatted', status='scratch', &
action='readwrite' )
call set2 % output(unit)
call set1 % output(unit)
call set0 % output(unit)
close( unit )
open( newunit=unit, file='test.bin', status='old', &
form='unformatted', action='read' )
rewind( unit )
call set5 % input(unit)
call set4 % input(unit)
call set3 % input(unit)
close( unit )

if ( set3 /= set0 .or. set4 /= set1 .or. set5 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' output and input failed.'
'output and input failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'output and input succeeded.'
end if

open( newunit=unit, file='test.bin', status='replace', &
form='unformatted', access='stream', action='write' )
open( newunit=unit, form='unformatted', access='stream', &
status='scratch', action='readwrite' )
call set2 % output(unit)
call set1 % output(unit)
call set0 % output(unit)
close( unit )
open( newunit=unit, file='test.bin', status='old', &
form='unformatted', access='stream', action='read' )
rewind( unit )
call set5 % input(unit)
call set4 % input(unit)
call set3 % input(unit)
close( unit )

if ( set3 /= set0 .or. set4 /= set1 .or. set5 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' stream output and input failed.'
'stream output and input failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'stream output and input succeeded.'
Expand Down
80 changes: 30 additions & 50 deletions src/tests/bitsets/test_stdlib_bitset_large.f90
Original file line number Diff line number Diff line change
Expand Up @@ -254,79 +254,65 @@ subroutine test_io()
'write_bitset'

call set2 % from_string( bitstring_33 )
open( newunit=unit, file='test1.txt', status='replace', &
form='formatted', action='write' )
open( newunit=unit, status='scratch', form='formatted', &
action='readwrite' )
call set2 % write_bitset(unit)
call set1 % write_bitset(unit)
call set0 % write_bitset(unit)
close( unit )
open( newunit=unit, file='test1.txt', status='old', &
form='formatted', action='read' )
rewind( unit )
call set3 % read_bitset(unit)
call set5 % read_bitset(unit)
call set4 % read_bitset(unit)
if ( set4 /= set0 .or. set5 /= set1 .or. set3 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' bitset literals failed.'
'bitset literals failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'plain write_bitset_unit and read_bitset_unit succeeded.'
end if

close( unit )
rewind( unit )

call set12 % from_string( bitstring_33 // bitstring_33 )
open( newunit=unit, file='test2.txt', status='replace', &
form='formatted', action='write' )
call set12 % write_bitset(unit)
call set11 % write_bitset(unit)
call set10 % write_bitset(unit)
close( unit )
open( newunit=unit, file='test2.txt', status='old', &
form='formatted', action='read' )
rewind( unit )
call set13 % read_bitset(unit)
call set15 % read_bitset(unit)
call set14 % read_bitset(unit)
if ( set14 /= set10 .or. set15 /= set11 .or. set3 /= set12 ) then
error stop procedure // ' transfer to and from units using ' // &
' bitset literals for bits > 64 failed.'
'bitset literals for bits > 64 failed.'
else
write(*,*) 'Transfer bits > 64 to and from units using ' // &
'plain write_bitset_unit and read_bitset_unit succeeded.'
end if

close( unit )
rewind( unit )

open( newunit=unit, file='test3.txt', status='replace', &
form='formatted', action='write' )
call set2 % write_bitset(unit, advance='no')
call set1 % write_bitset(unit, advance='no')
call set0 % write_bitset(unit)
close( unit )
open( newunit=unit, file='test3.txt', status='old', &
form='formatted', action='read' )
rewind( unit )
call set3 % read_bitset(unit, advance='no')
call set4 % read_bitset(unit, advance='no')
call set5 % read_bitset(unit)
if ( set5 /= set0 .or. set4 /= set1 .or. set3 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' bitset literals with advance == "no" failed.'
'bitset literals with advance == "no" failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'write_bitset_unit and read_bitset_unit with ' // &
'advance=="no" succeeded.'
end if

close( unit )
rewind( unit )

open( newunit=unit, file='test4.txt', status='replace', &
form='formatted', action='write' )
call set12 % write_bitset(unit, advance='no')
call set11 % write_bitset(unit, advance='no')
call set10 % write_bitset(unit)
close( unit )
open( newunit=unit, file='test4.txt', status='old', &
form='formatted', action='read' )
rewind( unit )
call set13 % read_bitset(unit, advance='no')
call set14 % read_bitset(unit, advance='no')
call set15 % read_bitset(unit)
Expand All @@ -339,82 +325,76 @@ subroutine test_io()
'advance=="no" succeeded.'
end if

open( newunit=unit, file='test.bin', status='replace', &
form='unformatted', action='write' )
close(unit)

open( newunit=unit, form='unformatted', status='scratch', &
action='readwrite' )
call set2 % output(unit)
call set1 % output(unit)
call set0 % output(unit)
close( unit )
open( newunit=unit, file='test.bin', status='old', &
form='unformatted', action='read' )
rewind( unit )
call set5 % input(unit)
call set4 % input(unit)
call set3 % input(unit)
if ( set3 /= set0 .or. set4 /= set1 .or. set5 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' output and input failed.'
'output and input failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'output and input succeeded.'
end if

close( unit )

open( newunit=unit, file='test.bin', status='replace', &
form='unformatted', access='stream', action='write' )
open( newunit=unit, form='unformatted', access='stream', &
status='scratch', action='readwrite' )
call set2 % output(unit)
call set1 % output(unit)
call set0 % output(unit)
close( unit )
open( newunit=unit, file='test.bin', status='old', &
form='unformatted', access='stream', action='read' )
rewind( unit )
call set5 % input(unit)
call set4 % input(unit)
call set3 % input(unit)
if ( set3 /= set0 .or. set4 /= set1 .or. set5 /= set2 ) then
error stop procedure // ' transfer to and from units using ' // &
' stream output and input failed.'
'stream output and input failed.'
else
write(*,*) 'Transfer to and from units using ' // &
'stream output and input succeeded.'
end if

close( unit )

open( newunit=unit, file='test.bin', status='replace', &
form='unformatted', action='write' )
open( newunit=unit, form='unformatted', status='scratch', &
action='readwrite' )
call set12 % output(unit)
call set11 % output(unit)
call set10 % output(unit)
close( unit )
open( newunit=unit, file='test.bin', status='old', &
form='unformatted', action='read' )
rewind( unit )
call set15 % input(unit)
call set14 % input(unit)
call set13 % input(unit)
if ( set13 /= set10 .or. set14 /= set11 .or. set15 /= set12 ) then
error stop procedure // ' transfer to and from units using ' // &
' output and input failed for bits . 64.'
'output and input failed for bits . 64.'
else
write(*,*) 'Transfer to and from units using ' // &
'output and input succeeded for bits > 64.'
end if
close(unit)

open( newunit=unit, file='test.bin', status='replace', &
form='unformatted', access='stream', action='write' )
open( newunit=unit, form='unformatted', access='stream', &
status='scratch', action='readwrite' )
call set12 % output(unit)
call set11 % output(unit)
call set10 % output(unit)
close( unit )
open( newunit=unit, file='test.bin', status='old', &
form='unformatted', access='stream', action='read' )
rewind( unit )
call set15 % input(unit)
call set14 % input(unit)
call set13 % input(unit)
if ( set13 /= set10 .or. set14 /= set11 .or. set15 /= set12 ) then
error stop procedure // ' transfer to and from units using ' // &
' stream output and input failed for bits . 64.'
'stream output and input failed for bits . 64.'
else
write(*,*) 'Transfer to and from units using ' // &
'stream output and input succeeded for bits > 64.'
Expand Down