From db87ca3df163f21d9ac983b2c641715fd937a82d Mon Sep 17 00:00:00 2001 From: William Clodius Date: Mon, 12 Apr 2021 11:43:04 -0600 Subject: [PATCH 1/2] Changed filenames Changed filenames in test_stdlib_bitsets_64.f90 and test_stdlib_bitsets_large.f90 so that they were no longer the same. Also removed spurious blanks in error stops. [ticket: X] --- src/tests/bitsets/test_stdlib_bitset_64.f90 | 14 +++--- .../bitsets/test_stdlib_bitset_large.f90 | 46 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/tests/bitsets/test_stdlib_bitset_64.f90 b/src/tests/bitsets/test_stdlib_bitset_64.f90 index 566db8ec1..ebde4aa1a 100644 --- a/src/tests/bitsets/test_stdlib_bitset_64.f90 +++ b/src/tests/bitsets/test_stdlib_bitset_64.f90 @@ -183,20 +183,20 @@ subroutine test_io() 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 - open( newunit=unit, file='test.bin', status='replace', & + open( newunit=unit, file='test64.bin', status='replace', & form='unformatted', action='write' ) call set2 % output(unit) call set1 % output(unit) call set0 % output(unit) close( unit ) - open( newunit=unit, file='test.bin', status='old', & + open( newunit=unit, file='test64.bin', status='old', & form='unformatted', action='read' ) call set5 % input(unit) call set4 % input(unit) @@ -205,19 +205,19 @@ subroutine test_io() 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', & + open( newunit=unit, file='test64.bin', status='replace', & form='unformatted', access='stream', action='write' ) call set2 % output(unit) call set1 % output(unit) call set0 % output(unit) close( unit ) - open( newunit=unit, file='test.bin', status='old', & + open( newunit=unit, file='test64.bin', status='old', & form='unformatted', access='stream', action='read' ) call set5 % input(unit) call set4 % input(unit) @@ -226,7 +226,7 @@ subroutine test_io() 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.' diff --git a/src/tests/bitsets/test_stdlib_bitset_large.f90 b/src/tests/bitsets/test_stdlib_bitset_large.f90 index f5d5631a0..56220a189 100644 --- a/src/tests/bitsets/test_stdlib_bitset_large.f90 +++ b/src/tests/bitsets/test_stdlib_bitset_large.f90 @@ -254,20 +254,20 @@ subroutine test_io() 'write_bitset' call set2 % from_string( bitstring_33 ) - open( newunit=unit, file='test1.txt', status='replace', & + open( newunit=unit, file='test_large_1.txt', status='replace', & form='formatted', action='write' ) 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', & + open( newunit=unit, file='test_large_1.txt', status='old', & form='formatted', action='read' ) 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.' @@ -276,20 +276,20 @@ subroutine test_io() close( unit ) call set12 % from_string( bitstring_33 // bitstring_33 ) - open( newunit=unit, file='test2.txt', status='replace', & + open( newunit=unit, file='test_large_2.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', & + open( newunit=unit, file='test_large_2.txt', status='old', & form='formatted', action='read' ) 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.' @@ -297,20 +297,20 @@ subroutine test_io() close( unit ) - open( newunit=unit, file='test3.txt', status='replace', & + open( newunit=unit, file='test_large_3.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', & + open( newunit=unit, file='test_large_3.txt', status='old', & form='formatted', action='read' ) 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 ' // & @@ -319,13 +319,13 @@ subroutine test_io() close( unit ) - open( newunit=unit, file='test4.txt', status='replace', & + open( newunit=unit, file='test_large_4.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', & + open( newunit=unit, file='test_large_4.txt', status='old', & form='formatted', action='read' ) call set13 % read_bitset(unit, advance='no') call set14 % read_bitset(unit, advance='no') @@ -339,20 +339,20 @@ subroutine test_io() 'advance=="no" succeeded.' end if - open( newunit=unit, file='test.bin', status='replace', & + open( newunit=unit, file='test_large.bin', status='replace', & form='unformatted', action='write' ) call set2 % output(unit) call set1 % output(unit) call set0 % output(unit) close( unit ) - open( newunit=unit, file='test.bin', status='old', & + open( newunit=unit, file='test_large.bin', status='old', & form='unformatted', action='read' ) 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.' @@ -360,20 +360,20 @@ subroutine test_io() close( unit ) - open( newunit=unit, file='test.bin', status='replace', & + open( newunit=unit, file='test_large.bin', status='replace', & form='unformatted', access='stream', action='write' ) call set2 % output(unit) call set1 % output(unit) call set0 % output(unit) close( unit ) - open( newunit=unit, file='test.bin', status='old', & + open( newunit=unit, file='test_large.bin', status='old', & form='unformatted', access='stream', action='read' ) 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.' @@ -381,40 +381,40 @@ subroutine test_io() close( unit ) - open( newunit=unit, file='test.bin', status='replace', & + open( newunit=unit, file='test_large.bin', status='replace', & form='unformatted', action='write' ) call set12 % output(unit) call set11 % output(unit) call set10 % output(unit) close( unit ) - open( newunit=unit, file='test.bin', status='old', & + open( newunit=unit, file='test_large.bin', status='old', & form='unformatted', action='read' ) 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', & + open( newunit=unit, file='test_large.bin', status='replace', & form='unformatted', access='stream', action='write' ) call set12 % output(unit) call set11 % output(unit) call set10 % output(unit) close( unit ) - open( newunit=unit, file='test.bin', status='old', & + open( newunit=unit, file='test_large.bin', status='old', & form='unformatted', access='stream', action='read' ) 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.' From 9f0db3991c1a9a374e0202fb4f091036276248bf Mon Sep 17 00:00:00 2001 From: William Clodius Date: Mon, 12 Apr 2021 22:05:16 -0600 Subject: [PATCH 2/2] Changed files to scratch Changed the input/output files to scratch files to eliminate I/O interactions between the two programs, and the generated file clutter. [ticket: X] --- src/tests/bitsets/test_stdlib_bitset_64.f90 | 33 ++++------ .../bitsets/test_stdlib_bitset_large.f90 | 66 +++++++------------ 2 files changed, 35 insertions(+), 64 deletions(-) diff --git a/src/tests/bitsets/test_stdlib_bitset_64.f90 b/src/tests/bitsets/test_stdlib_bitset_64.f90 index ebde4aa1a..2ca1d3af0 100644 --- a/src/tests/bitsets/test_stdlib_bitset_64.f90 +++ b/src/tests/bitsets/test_stdlib_bitset_64.f90 @@ -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) @@ -167,16 +165,12 @@ 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) @@ -189,15 +183,14 @@ subroutine test_io() 'write_bitset_unit and read_bitset_unit with ' // & 'advance=="no" succeeded.' end if + close(unit) - open( newunit=unit, file='test64.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='test64.bin', status='old', & - form='unformatted', action='read' ) + rewind( unit ) call set5 % input(unit) call set4 % input(unit) call set3 % input(unit) @@ -211,14 +204,12 @@ subroutine test_io() 'output and input succeeded.' end if - open( newunit=unit, file='test64.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='test64.bin', status='old', & - form='unformatted', access='stream', action='read' ) + rewind( unit ) call set5 % input(unit) call set4 % input(unit) call set3 % input(unit) diff --git a/src/tests/bitsets/test_stdlib_bitset_large.f90 b/src/tests/bitsets/test_stdlib_bitset_large.f90 index 56220a189..aac8389b1 100644 --- a/src/tests/bitsets/test_stdlib_bitset_large.f90 +++ b/src/tests/bitsets/test_stdlib_bitset_large.f90 @@ -254,14 +254,12 @@ subroutine test_io() 'write_bitset' call set2 % from_string( bitstring_33 ) - open( newunit=unit, file='test_large_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='test_large_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) @@ -273,17 +271,13 @@ subroutine test_io() '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='test_large_2.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='test_large_2.txt', status='old', & - form='formatted', action='read' ) + rewind( unit ) call set13 % read_bitset(unit) call set15 % read_bitset(unit) call set14 % read_bitset(unit) @@ -295,16 +289,12 @@ subroutine test_io() 'plain write_bitset_unit and read_bitset_unit succeeded.' end if - close( unit ) + rewind( unit ) - open( newunit=unit, file='test_large_3.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='test_large_3.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) @@ -317,16 +307,12 @@ subroutine test_io() 'advance=="no" succeeded.' end if - close( unit ) + rewind( unit ) - open( newunit=unit, file='test_large_4.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='test_large_4.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) @@ -339,14 +325,14 @@ subroutine test_io() 'advance=="no" succeeded.' end if - open( newunit=unit, file='test_large.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_large.bin', status='old', & - form='unformatted', action='read' ) + rewind( unit ) call set5 % input(unit) call set4 % input(unit) call set3 % input(unit) @@ -360,14 +346,12 @@ subroutine test_io() close( unit ) - open( newunit=unit, file='test_large.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_large.bin', status='old', & - form='unformatted', access='stream', action='read' ) + rewind( unit ) call set5 % input(unit) call set4 % input(unit) call set3 % input(unit) @@ -381,14 +365,12 @@ subroutine test_io() close( unit ) - open( newunit=unit, file='test_large.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_large.bin', status='old', & - form='unformatted', action='read' ) + rewind( unit ) call set15 % input(unit) call set14 % input(unit) call set13 % input(unit) @@ -401,14 +383,12 @@ subroutine test_io() end if close(unit) - open( newunit=unit, file='test_large.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_large.bin', status='old', & - form='unformatted', access='stream', action='read' ) + rewind( unit ) call set15 % input(unit) call set14 % input(unit) call set13 % input(unit)