@@ -974,7 +974,7 @@ subroutine npz_add_two_arrays(error)
974
974
allocate (array_1(10 , 4 ))
975
975
call random_number (array_1)
976
976
call add_array(arrays, array_1, stat)
977
- call check(error, stat, " Error adding an array to the list of arrays." )
977
+ call check(error, stat, " Error adding the first array to the list of arrays." )
978
978
if (allocated (error)) return
979
979
call check(error, size (arrays) == 1 , " Array was not added to the list of arrays." )
980
980
if (allocated (error)) return
@@ -994,7 +994,22 @@ subroutine npz_add_two_arrays(error)
994
994
allocate (array_2(10 ))
995
995
call random_number (array_2)
996
996
call add_array(arrays, array_2, stat)
997
- call check(error, stat, " Error adding an array to the list of arrays." )
997
+ call check(error, stat, " Error adding the second array to the list of arrays." )
998
+ if (allocated (error)) return
999
+ call check(error, size (arrays) == 2 , " Array was not added to the list of arrays." )
1000
+ if (allocated (error)) return
1001
+ call check(error, arrays(2 )% array% name == " arr_1.npy" , " Wrong array name." )
1002
+ if (allocated (error)) return
1003
+ select type (typed_array = > arrays(2 )% array)
1004
+ class is (t_array_rsp_1)
1005
+ call check(error, size (typed_array% values), size (array_2), " Array sizes to not match." )
1006
+ if (allocated (error)) return
1007
+ call check(error, any (abs (typed_array% values - array_2) <= epsilon (1.0_sp )), &
1008
+ " Precision loss when adding array." )
1009
+ if (allocated (error)) return
1010
+ class default
1011
+ call test_failed(error, " Array 2 is of wrong type." )
1012
+ end select
998
1013
end
999
1014
1000
1015
! subroutine npz_add_arr(error)
0 commit comments