create_lagrange(levels<=0) should trigger validation and fall back to a safe default (256).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_081(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "create_lagrange(levels=0) -> levels fixed to 256 (check case 4)" logical :: ok type(Colormap) :: cm integer :: colors(2,3) colors(1,:) = [ 0, 0, 0 ] colors(2,:) = [ 255, 255, 255 ] call cm%create_lagrange("bad_levels", 0.0_wp, 1.0_wp, colors, 0) call cm%print_status() ok = (cm%get_levels() == 256) call report_test(name, ok, id, nfail) end subroutine test_081