finalize() should be safe and leave the object reusable.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_048(id, nfail) use forcolormap, only: Colormap, wp integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "Colormap%finalize: safe to call, object reusable" logical :: ok type(Colormap) :: cm call cm%set("viridis", 0.0_wp, 1.0_wp) call cm%finalize() call cm%set("magma", -1.0_wp, 2.0_wp) ok = (trim(cm%get_name()) == "magma") .and. (cm%get_levels() == 256) call report_test(name, ok, id, nfail) end subroutine test_048