You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present, test-drive can check scalars of Fortran built-in types, such as logical scalars, integer scalars, and real scalars; however, it does not support arrays, so users need to write loops to check the contents of arrays:
do i =1, size(array)
call check(error, array(i), expected(i), ...)
if (allocated(error)) returnend do
It would be a good feature to support array checking. Since the check subroutine usually only needs to read the array without changing the contents of the array, I think using reshape to convert it into a rank-1 array for checking would be an acceptable solution.
subroutinecheck_array(error, actual, expected, ...)
type(error_type), allocatable, intent(out) :: error
class(*), intent(in) :: actual(:)
class(*), intent(in) :: expected(:)
...
endsubroutine
! The `array` can be of any shape, and is finally determined to be a rank-1 array by `reshape`
call check(error, reshape(array, shape=[size(array)], expected, ...)
if (allocated(error)) return
The text was updated successfully, but these errors were encountered:
At present,
test-drive
can check scalars of Fortran built-in types, such aslogical
scalars,integer
scalars, andreal
scalars; however, it does not support arrays, so users need to write loops to check the contents of arrays:It would be a good feature to support array checking. Since the
check
subroutine usually only needs to read the array without changing the contents of the array, I think usingreshape
to convert it into a rank-1 array for checking would be an acceptable solution.The text was updated successfully, but these errors were encountered: