reverse() should flip the map and annotate the name with the "_reverse" suffix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_043(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "Colormap%reverse: endpoints swapped and name suffixed" logical :: ok type(Colormap) :: cm integer :: map(3,3) integer :: r, g, b map(1,:) = [ 10, 20, 30 ] map(2,:) = [ 40, 50, 60 ] map(3,:) = [ 70, 80, 90 ] call cm%create("custom", 0.0_wp, 2.0_wp, map) call cm%reverse() call cm%get_RGB(0, r, g, b) ok = (r == 70) .and. (g == 80) .and. (b == 90) ok = ok .and. (index(trim(cm%get_name()), "_reverse") > 0) call report_test(name, ok, id, nfail) end subroutine test_043