File: test_BiocParallelParam.R

package info (click to toggle)
r-bioc-biocparallel 1.40.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,768 kB
  • sloc: cpp: 139; sh: 14; makefile: 8
file content (27 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
message("Testing BiocParallelParam")

test_BiocParallelParam <-
    function()
{
    ## BiocParallelParam is a virtual class
    checkException(BiocParallel:::.BiocParallelParam(), silent=TRUE)

    ## minimal non-virtual class & constructor
    .A <- setRefClass("A", contains = "BiocParallelParam")
    A <- function(...) {
        prototype <- .prototype_update(.BiocParallelParam_prototype, ...)
        do.call(.A, prototype)
    }

    ## no arg constructor
    checkTrue(validObject(A()))

    ## non-default inherited slot
    checkIdentical("WARN", bpthreshold(A(threshold = "WARN")))

    ## workers (specified as character()) more than tasks
    checkException(
        validObject(A(workers = rep("a", 3L), tasks = 2L)),
        silent = TRUE
    )
}