shift(0) should leave the map unchanged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_066(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "shift(0) leaves map unchanged" logical :: ok type(Colormap) :: cm integer :: map(4,3) integer :: ref(0:3,3) integer :: i, r, g, b map(1,:) = [ 10, 0, 0 ] map(2,:) = [ 0, 10, 0 ] map(3,:) = [ 0, 0, 10 ] map(4,:) = [ 10, 10, 10 ] call cm%create("custom", 0.0_wp, 1.0_wp, map) do i = 0, cm%get_levels()-1 call cm%get_RGB(i, r, g, b) ref(i,1) = r; ref(i,2) = g; ref(i,3) = b end do call cm%shift(0) ok = .true. do i = 0, cm%get_levels()-1 call cm%get_RGB(i, r, g, b) ok = ok .and. (r == ref(i,1)) .and. (g == ref(i,2)) .and. (b == ref(i,3)) end do call report_test(name, ok, id, nfail) end subroutine test_066