Running ‘test-all.R’ [5s/19s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("divest")
  Loading required package: divest
  ── 1. Failure: DICOM-reading code works (@test-05-read.R#21)  ──────────────────
  `attrNames`[4] absent from `storedAttrNames`
  
  
   *** caught segfault ***
  address 160, cause 'memory not mapped'
  
  Traceback:
   1: asNifti.default(image, internal = TRUE)
   2: asNifti(image, internal = TRUE)
   3: xform(image, ...)
   4: solve(xform(image, ...))
   5: RNifti::worldToVoxel(c(0, 0, 0), d[[i]])
   6: eval(code, test_env)
   7: eval(code, test_env)
   8: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
   9: doTryCatch(return(expr), name, parentenv, handler)
  10: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  11: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  12: doTryCatch(return(expr), name, parentenv, handler)
  13: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  16: test_code(desc, code, env = parent.frame())
  17: test_that("DICOM-reading code works", {    path <- system.file("extdata", "raw", package = "divest")    expect_output(d <- readDicom(path, interactive = FALSE),         "Found 4 DICOM")    expect_output(readDicom(path, interactive = FALSE, verbosity = -1),         "Warning")    expect_identical(length(d), 2L)    i <- which(sapply(d, RNifti::ndim) == 3L)    expect_equal(dim(d[[i]]), c(2, 224, 256))    expect_equal(attr(d[[i]], "flipAngle"), 15)    attributes <- attributes(d[[i]])    attrNames <- setdiff(names(attributes), ".nifti_image_ptr")    storedAttrNames <- readRDS("attrib_names.rds")    expect_setequal(attrNames, storedAttrNames)    expect_known_value(attributes[storedAttrNames], "attributes.rds",         update = FALSE)    origin <- RNifti::worldToVoxel(c(0, 0, 0), d[[i]])    expect_equal(round(origin), c(-16, 95, 135))    expect_output(d <- readDicom(path, interactive = FALSE, crop = TRUE),         "Cropping")    i <- which(sapply(d, RNifti::ndim) == 3L)    expect_equal(dim(d[[i]]), c(2, 224, 170))    expect_output(d <- scanDicom(path), "Found 4 DICOM")    expect_equal(d$repetitionTime, c(4100, 11))    expect_output(readDicom(d, repetitionTime == 4100), "Found 2 DICOM")    expect_output(readDicom(path, repetitionTime == 4100, interactive = FALSE),         "Found 2 DICOM")    expect_output(d <- readDicom(file.path(path, "01.dcm"), interactive = FALSE),         "Convert 1 DICOM")    expect_equal(dim(d[[1]]), c(224, 256, 1))    expect_warning(readDicom(file.path(path, "nonsense"), interactive = FALSE),         "does not exist")    expect_output(d <- readDicom(file.path(path, ".."), depth = 0L,         interactive = FALSE), "No valid DICOM files")    expect_length(d, 0L)    skip_on_cran()    with_mock(`divest:::.readline` = function(...) "1", expect_output(d <- readDicom(path,         interactive = TRUE), "Found 2 DICOM"), expect_equal(unlist(d),         "T0_N_S8"))})
  18: eval(code, test_env)
  19: eval(code, test_env)
  20: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  21: doTryCatch(return(expr), name, parentenv, handler)
  22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  24: doTryCatch(return(expr), name, parentenv, handler)
  25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  26: tryCatchList(expr, classes, parentenv, handlers)
  27: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  28: test_code(NULL, exprs, env)
  29: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  30: force(code)
  31: doWithOneRestart(return(expr), restart)
  32: withOneRestart(expr, restarts[[1L]])
  33: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  34: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        reporter$start_file(basename(path))        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        reporter$.end_context()        reporter$end_file()    })
  35: FUN(X[[i]], ...)
  36: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  37: force(code)
  38: doWithOneRestart(return(expr), restart)
  39: withOneRestart(expr, restarts[[1L]])
  40: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  41: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  42: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  43: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  44: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  45: test_check("divest")
  An irrecoverable exception occurred. R is aborting now ...