create*/(reverse=.false.) must preserve endpoints and must not add the "_reverse" suffix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_084(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "create*/(reverse=.false.) preserves endpoints (no suffix)" logical :: ok type(Colormap) :: c1, c2, c3 integer :: map(3,3) integer :: colors(2,3) integer :: r, g, b map(1,:) = [ 10, 20, 30 ] map(2,:) = [ 40, 50, 60 ] map(3,:) = [ 70, 80, 90 ] colors(1,:) = [ 1, 2, 3 ] colors(2,:) = [ 11, 12, 13 ] ! create(reverse=.false.) call c1%create("custom", 0.0_wp, 1.0_wp, map, reverse=.false.) call c1%get_RGB(0, r, g, b) ok = (r == 10) .and. (g == 20) .and. (b == 30) .and. (index(trim(c1%get_name()), "_reverse") == 0) call c1%get_RGB(c1%get_levels()-1, r, g, b) ok = ok .and. (r == 70) .and. (g == 80) .and. (b == 90) ! create_lagrange(reverse=.false.) call c2%create_lagrange("lag", 0.0_wp, 1.0_wp, colors, 16, reverse=.false.) call c2%get_RGB(0, r, g, b) ok = ok .and. (r == colors(1,1)) .and. (g == colors(1,2)) .and. (b == colors(1,3)) .and. & (index(trim(c2%get_name()), "_reverse") == 0) call c2%get_RGB(c2%get_levels()-1, r, g, b) ok = ok .and. (r == colors(2,1)) .and. (g == colors(2,2)) .and. (b == colors(2,3)) ! create_bezier(reverse=.false.) call c3%create_bezier("bez", 0.0_wp, 1.0_wp, colors, 16, reverse=.false.) call c3%get_RGB(0, r, g, b) ok = ok .and. (r == colors(1,1)) .and. (g == colors(1,2)) .and. (b == colors(1,3)) .and. & (index(trim(c3%get_name()), "_reverse") == 0) call c3%get_RGB(c3%get_levels()-1, r, g, b) ok = ok .and. (r == colors(2,1)) .and. (g == colors(2,2)) .and. (b == colors(2,3)) call report_test(name, ok, id, nfail) end subroutine test_084