Smoke test: set() should succeed for every name reported by cmap_info.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_085(id, nfail) use forcolormap, only: Colormap, wp use forcolormap_info, only: cmap_info integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "set() covers all cmap_info names (smoke test)" logical :: ok type(Colormap) :: cm integer :: i, n, lev_expected, lev_got character(len=:), allocatable :: nm integer :: r, g, b n = cmap_info%get_ncolormaps() ok = .true. do i = 1, n nm = trim(cmap_info%get_name(i)) lev_expected = cmap_info%get_levels(i) call cm%set(nm, 0.0_wp, 1.0_wp) ! Minimal correctness: known names should not fall back to the default. ok = ok .and. (trim(cm%get_name()) == nm) ! Enforce levels when cmap_info provides a concrete value; otherwise just require positivity. lev_got = cm%get_levels() if (lev_expected > 0) then ok = ok .and. (lev_got == lev_expected) else ok = ok .and. (lev_got > 0) end if ! Touch the RGB table path at both ends. call cm%compute_RGB(0.0_wp, r, g, b) call cm%compute_RGB(1.0_wp, r, g, b) end do call report_test(name, ok, id, nfail) end subroutine test_085