inst/tinytest/test-check_omp.R

# test_that("check_omp works", {
check_omp <- hutilscpp:::check_omp
expect_error(check_omp(NA), "logical")
expect_error(check_omp(NA_integer_), "nThread")
expect_error(check_omp(5.5), "whole number")
expect_equal(check_omp(1), 1)

if (hutilscpp:::has_openmp() && requireNamespace("parallel", quietly = TRUE)) {
  expect_error(check_omp(parallel::detectCores() + 1L), "nThread")
}

Try the hutilscpp package in your browser

Any scripts or data that you put into this service are public.

hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.