diff --git a/test/caf_co_max_test.f90 b/test/caf_co_max_test.f90 index a41fd371..0d1a7c7f 100644 --- a/test/caf_co_max_test.f90 +++ b/test/caf_co_max_test.f90 @@ -104,21 +104,24 @@ function max_double_precision_2D_array() result(result_) function max_elements_in_2D_string_arrays() result(result_) type(result_t) result_ character(len=*), parameter :: script(*,*,*) = reshape( & - [ "To be ","or not " & - , "to ","be. " & - - , "that ","is " & - , "the ","question"], & + [ "To be ","or not " & ! images with odd image + , "to ","be. " & ! numbers get this slice + ! ---------------------- + , "that ","is " & ! images with even image + , "the ","question"], & ! numbers get this slice [2,2,2]) - character(len=len(script)), dimension(size(script,1),size(script,2)) :: scramlet, expected + character(len=len(script)), dimension(size(script,1),size(script,2)) :: slice integer me, ni call prif_this_image_no_coarray(this_image=me) call prif_num_images(ni) - scramlet = script(:,:,mod(me-1,size(script,3))+1) - call prif_co_max(scramlet) - expected = maxval(script(:,:,1:min(ni,size(script,3))), dim=3) - result_ = assert_that(all(expected == scramlet),"all(expected == scramlet)") + associate(slice_number => mod(me-1,size(script,3)) + 1) + slice = script(:,:,slice_number) + end associate + call prif_co_max(slice) + associate(expected => maxval(script(:,:,1:min(ni,size(script,3))), dim=3)) + result_ = assert_that(all(expected == slice),"all(expected == scramlet)") + end associate end function function reverse_alphabetize_default_character_scalars() result(result_) diff --git a/test/caf_co_min_test.f90 b/test/caf_co_min_test.f90 index e0763f1a..3e2fa87b 100644 --- a/test/caf_co_min_test.f90 +++ b/test/caf_co_min_test.f90 @@ -106,21 +106,24 @@ function min_double_precision_2D_array() result(result_) function min_elements_in_2D_string_arrays() result(result_) type(result_t) result_ character(len=*), parameter :: script(*,*,*) = reshape( & - [ "To be ","or not " & - , "to ","be. " & - - , "that ","is " & - , "the ","question"], & + [ "To be ","or not " & ! images with odd image + , "to ","be. " & ! numbers get this slice + ! ---------------------- + , "that ","is " & ! images with even image + , "the ","question"], & ! numbers get this slice [2,2,2]) - character(len=len(script)), dimension(size(script,1),size(script,2)) :: scramlet, expected + character(len=len(script)), dimension(size(script,1),size(script,2)) :: slice integer me, ni call prif_this_image_no_coarray(this_image=me) call prif_num_images(ni) - scramlet = script(:,:,mod(me-1,size(script,3))+1) - call prif_co_min(scramlet) - expected = minval(script(:,:,1:min(ni,size(script,3))), dim=3) - result_ = assert_that(all(expected == scramlet),"all(expected == scramlet)") + associate(slice_number => mod(me-1,size(script,3)) + 1) + slice = script(:,:,slice_number) + end associate + call prif_co_min(slice) + associate(expected => minval(script(:,:,1:min(ni,size(script,3))), dim=3)) + result_ = assert_that(all(expected == slice),"all(expected == scramlet)") + end associate end function function alphabetically_1st_scalar_string() result(result_)