doing some internal checks
trivial, but better safe then sorry
This commit is contained in:
parent
830b05005f
commit
a4134b4552
21
src/IO.f90
21
src/IO.f90
|
@ -49,11 +49,11 @@ contains
|
|||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief does nothing.
|
||||
! ToDo: needed?
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine IO_init
|
||||
|
||||
write(6,'(/,a)') ' <<<+- IO init -+>>>'; flush(6)
|
||||
call unitTest
|
||||
|
||||
end subroutine IO_init
|
||||
|
||||
|
@ -914,4 +914,23 @@ real(pReal) function verifyFloatValue(string)
|
|||
|
||||
end function verifyFloatValue
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief check correctness of IO functions
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine unitTest
|
||||
|
||||
if(dNeq(1.0_pReal, verifyFloatValue('1.0'))) call IO_error(401,ext_msg='verifyFloatValue')
|
||||
if(dNeq(1.0_pReal, verifyFloatValue('1e0'))) call IO_error(401,ext_msg='verifyFloatValue')
|
||||
if(dNeq(0.1_pReal, verifyFloatValue('1e-1'))) call IO_error(401,ext_msg='verifyFloatValue')
|
||||
|
||||
if(3112019 /= verifyIntValue( '3112019')) call IO_error(401,ext_msg='verifyIntValue')
|
||||
if(3112019 /= verifyIntValue(' 3112019')) call IO_error(401,ext_msg='verifyIntValue')
|
||||
if(-3112019 /= verifyIntValue('-3112019')) call IO_error(401,ext_msg='verifyIntValue')
|
||||
if(3112019 /= verifyIntValue('+3112019 ')) call IO_error(401,ext_msg='verifyIntValue')
|
||||
|
||||
if(any([2,1,2,4,4] /= IO_stringPos('aa b'))) call IO_error(401,ext_msg='IO_stringPos')
|
||||
|
||||
end subroutine unitTest
|
||||
|
||||
end module IO
|
||||
|
|
Loading…
Reference in New Issue