Skip to content
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

Adding tests for getdim() #711

Merged
merged 7 commits into from
Jun 19, 2024
Merged
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
52 changes: 24 additions & 28 deletions tests/test_getdim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
program test_getdim
implicit none

integer, parameter :: lcsec3 = 72
integer, parameter :: lcsec3 = 120
character(len=1) :: csec3(lcsec3)
integer :: width, height, iscan

Expand All @@ -29,7 +29,11 @@ end subroutine gf_unpack3
achar(8), achar(0), achar(0), achar(0), achar(9), achar(0), achar(0), achar(0), achar(10), achar(0), achar(0), &
achar(0), achar(11), achar(0), achar(0), achar(0), achar(12), achar(13), achar(0), achar(0), achar(0), achar(14), &
achar(0), achar(0), achar(0), achar(15), achar(0), achar(0), achar(0), achar(16), achar(0), achar(0), achar(0), &
achar(17), achar(18) /)
achar(17), achar(18), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), achar(0), &
achar(0), achar(0), achar(0), achar(0), achar(0), achar(0) /)

! Template num at pos 14 of section 3 = igds(5)

Expand All @@ -55,15 +59,12 @@ end subroutine gf_unpack3
if (height .ne. 8) stop 22
if (iscan .ne. 0) stop 32

! Uninitialized value memory error
if (.false.) then
print *, 'Template num 30 (Lambert Conformal)'
csec3(14) = achar(30)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 13
if (height .ne. 8) stop 23
if (iscan .ne. 0) stop 33
end if
print *, 'Template num 30 (Lambert Conformal)'
csec3(14) = achar(30)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 13
if (height .ne. 8) stop 23
if (iscan .ne. 0) stop 33

print *, 'Template num 40 (Gaussian)'
csec3(14) = achar(40)
Expand All @@ -72,14 +73,12 @@ end subroutine gf_unpack3
if (height .ne. 8) stop 24
if (iscan .ne. 18) stop 34

if (.false.) then
print *, 'Template num 90 (Space View/Orthographic)'
csec3(14) = achar(90)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 15
if (height .ne. 8) stop 25
if (iscan .ne. 0) stop 35
end if
print *, 'Template num 90 (Space View/Orthographic)'
csec3(14) = achar(90)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 7) stop 15
if (height .ne. 8) stop 25
if (iscan .ne. 0) stop 35

print *, 'Template num 110 (Equatorial Azimuthal)'
csec3(14) = achar(110)
Expand All @@ -88,15 +87,12 @@ end subroutine gf_unpack3
if (height .ne. 8) stop 26
if (iscan .ne. 0) stop 36

! Uninitialized value memory error
if (.false.) then
print *, 'Template num 5 (Default case)'
csec3(14) = achar(5)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 0) stop 17
if (height .ne. 0) stop 27
if (iscan .ne. 0) stop 37
end if
print *, 'Template num 5 (Default case)'
csec3(14) = achar(5)
call getdim(csec3, lcsec3, width, height, iscan)
if (width .ne. 0) stop 17
if (height .ne. 0) stop 27
if (iscan .ne. 0) stop 37

print *, 'Error in gf_unpack3 call'
csec3(14) = achar(99)
Expand Down
Loading