Improved testing of amap
This commit is contained in:
parent
e4eb7e97fe
commit
7534cedb89
1 changed files with 22 additions and 4 deletions
|
@ -1,18 +1,36 @@
|
||||||
program test_amap
|
program test_amap
|
||||||
use amap
|
use amap
|
||||||
|
use iso_fortran_env, only: output_unit
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
type(amap_t) :: my_amap
|
type(amap_t) :: my_amap
|
||||||
type(value_t) :: x
|
type(value_t) :: x
|
||||||
|
|
||||||
|
write(output_unit,fmt='(a)',advance='no') 'checking set ... '
|
||||||
call my_amap%set('one',1.0d0)
|
call my_amap%set('one',1.0d0)
|
||||||
call my_amap%set('two',2.d0)
|
call my_amap%set('two',2.d0)
|
||||||
call my_amap%set('three',3.0d0)
|
call my_amap%set('three',3.0d0)
|
||||||
|
call my_amap%set('four',7.0d0)
|
||||||
call my_amap%set('four',4.0d0)
|
call my_amap%set('four',4.0d0)
|
||||||
call my_amap%set('five',5.0d0)
|
call my_amap%set('five',5.0d0)
|
||||||
call my_amap%print
|
if (my_amap%size() == 5) then
|
||||||
|
write(output_unit,'(a)') 'passed'
|
||||||
|
else
|
||||||
|
write(output_unit,'(a)') 'FAILED'
|
||||||
|
end if
|
||||||
|
|
||||||
|
write(output_unit,fmt='(a)',advance='no') 'checking existence ... '
|
||||||
|
if (my_amap%contains('one') .and. .not. my_amap%contains('ten')) then
|
||||||
|
write(output_unit,'(a)') 'passed'
|
||||||
|
else
|
||||||
|
write(output_unit,'(a)') 'FAILED'
|
||||||
|
end if
|
||||||
|
|
||||||
|
write(output_unit,fmt='(a)',advance='no') 'checking data ... '
|
||||||
|
if (my_amap%get('four') == 4.0d0) then
|
||||||
|
write(output_unit,'(a)') 'passed'
|
||||||
|
else
|
||||||
|
write(output_unit,'(a)') 'FAILED'
|
||||||
|
end if
|
||||||
|
|
||||||
x = my_amap%get('four')
|
|
||||||
write(6,'(f0.6)') my_amap%get_value('four')
|
|
||||||
print *,my_amap%contains('one'),my_amap%contains('ten')
|
|
||||||
end program test_amap
|
end program test_amap
|
||||||
|
|
Loading…
Reference in a new issue