Running ‘testthat.R’ [16s/36s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > library(testthat)
  > library(RxODE)
  > test_check("RxODE")
  
   *** caught segfault ***
  address 0x2, cause 'memory not mapped'
  
  Traceback:
   1: rxSolve_(object, .ctl, .nms, .xtra, params, events, inits, setupOnly = .setupOnly)
   2: rxSolve.default(mod.rate, et, c(ri = 0, f = 1, li = 0.3), method = m)
   3: rxSolve(mod.rate, et, c(ri = 0, f = 1, li = 0.3), method = m)
   4: eval_bare(get_expr(.quo), get_env(.quo))
   5: doTryCatch(return(expr), name, parentenv, handler)
   6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   7: tryCatchList(expr, classes, parentenv, handlers)
   8: tryCatch({    code    NULL}, error = function(e) e)
   9: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)),     ...)
  10: quasi_capture(enquo(object), label, capture_error)
  11: expect_error(rxSolve(mod.rate, et, c(ri = 0, f = 1, li = 0.3),     method = m))
  12: eval(code, test_env)
  13: eval(code, test_env)
  14: 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)
  15: doTryCatch(return(expr), name, parentenv, handler)
  16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  17: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  18: doTryCatch(return(expr), name, parentenv, handler)
  19: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  20: tryCatchList(expr, classes, parentenv, handlers)
  21: 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) {    })
  22: test_code(desc, code, env = parent.frame())
  23: test_that("bad rates (zero/negative) throw errors", {    expect_error(rxSolve(mod.rate, et, c(ri = -1, f = 1, li = 0.3),         method = m))    expect_error(rxSolve(mod.rate, et, c(ri = 0, f = 1, li = 0.3),         method = m))})
  24: eval(substitute(expr), envir = parent.frame(1))
  25: eval(substitute(expr), envir = parent.frame(1))
  26: (function (expr, op.rx = NULL, silent = .isTestthat(), respect = FALSE,     rxclean = .isTestthat(), cran = FALSE, on.validate = FALSE) {    do.it <- TRUE    if (!identical(Sys.getenv("NOT_CRAN"), "true") && !cran) {        do.it <- FALSE    }    if (is(on.validate, "character")) {        val.txt <- on.validate        on.validate <- TRUE    }    else {        val.txt <- "RxODE_VALIDATION_FULL"    }    if (on.validate && !identical(Sys.getenv(val.txt), "true")) {        do.it <- FALSE    }    if (!on.validate && identical(Sys.getenv(val.txt), "true")) {        do.it <- FALSE    }    if (do.it) {        if (missing(expr) && is.null(op.rx)) {            op <- options()            op <- op[regexpr(rex::rex("RxODE."), names(op)) !=                 -1]            op <- op[order(names(op))]            sapply(names(op), function(n) {                rxCat(sprintf("%s: %s\n", n, op[[n]]))            })            return(invisible(op))        }        else {            if (is(op.rx, "character")) {                if (op.rx == "strict") {                  op.rx <- 1                }                else {                  op.rx <- 2                }            }            if (is(op.rx, "numeric")) {                if (op.rx <= 2) {                  x <- op.rx                  op.rx <- list()                  for (v in names(rxOpt)) {                    op.rx[[v]] <- rxOpt[[v]][x]                  }                }            }            if (!missing(silent)) {                op.rx$RxODE.verbose = !silent                op.rx$RxODE.suppress.syntax.info = silent            }            if (!missing(expr)) {                if (rxclean) {                  rxClean()                }                opOld <- options()                .oldProg <- getProgSupported()                if (silent) {                  setProgSupported(-1)                }                on.exit({                  options(opOld)                  setProgSupported(.oldProg)                  rxSyncOptions()                  if (rxclean) {                    rxClean()                  }                })            }            if (respect) {                op <- options()                w <- !(names(op.rx) %in% names(op))                if (any(w))                   options(op.rx[w])                rxSyncOptions()            }            else if (length(op.rx) > 0) {                options(op.rx)                rxSyncOptions()            }            if (is(substitute(expr), "{")) {                if (silent) {                  return(suppressMessages(eval(substitute(expr),                     envir = parent.frame(1))))                }                else {                  return(eval(substitute(expr), envir = parent.frame(1)))                }            }        }    }})(expr = {    library(dplyr)    library(testthat)    ms <- c("liblsoda", "lsoda", "dop853")    if (grepl("SunOS", Sys.info()["sysname"]))         ms <- "lsoda"    for (m in ms) {        context(sprintf("Modeled rate (%s)", m))        mod.rate <- RxODE({            a = 6            b = 0.6            f = 1            ri = 10            li = 0            d/dt(intestine) = -a * intestine            f(intestine) = f            rate(intestine) = ri            lag(intestine) = li            d/dt(blood) = a * intestine - b * blood        })        library(ggplot2)        et <- et() %>% et(amt = 2/24, rate = -1, 0, addl = 9,             ii = 1) %>% et(seq(0, 10, by = 1/24))        et2 <- et() %>% et(amt = 2/24, rate = 2, 0, addl = 9,             ii = 1) %>% et(seq(0, 10, by = 1/24))        f1.a <- rxSolve(mod.rate, et, c(ri = 2, f = 1, li = 0),             method = m)        f1.b <- rxSolve(mod.rate, et2, c(ri = 0.1, f = 1, li = 0),             method = m)        test_that("rate=2, f=1, lag=0 makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f1.a$time)                expect_equal(seq(0, 10, by = 1/24), f1.b$time)                expect_equal(as.data.frame(f1.a), as.data.frame(f1.b))            })        f1.a <- rxSolve(mod.rate, et, c(ri = 2, f = 1, li = 0.5),             method = m)        f1.b <- rxSolve(mod.rate, et2, c(ri = 0.1, f = 1, li = 0.5),             method = m)        test_that("rate=2, f=1, lag=0.5 makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f1.a$time)                expect_equal(seq(0, 10, by = 1/24), f1.b$time)                expect_equal(as.data.frame(f1.a), as.data.frame(f1.b))            })        f1.a <- rxSolve(mod.rate, et, c(ri = 2, f = 2, li = 0.5),             method = m)        f1.b <- rxSolve(mod.rate, et2, c(ri = 0.1, f = 2, li = 0.5),             method = m)        test_that("rate=2, f=2, lag=0.5 makes sense for modeled rate & fixed rate",             {                expect_equal(seq(0, 10, by = 1/24), f1.a$time)                expect_equal(seq(0, 10, by = 1/24), f1.b$time)                expect_equal(as.data.frame(f1.a), as.data.frame(f1.b))            })        et <- et() %>% et(amt = 2/24, rate = -1) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        et2 <- et() %>% et(amt = 2/24, rate = 2) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        f.a <- rxSolve(mod.rate, et, c(ri = 2, f = 2, li = 0.3),             method = m)        f.b <- rxSolve(mod.rate, et2, c(ri = 1e-06, f = 2, li = 0.3),             method = m)        test_that("rate=2 makes sense for modeled rate", {            expect_equal(seq(0, 10, by = 1/24), f.a$time)            expect_equal(seq(0, 10, by = 1/24), f.b$time)            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })        f.a <- rxSolve(mod.rate, et, c(ri = 0.125, f = 2, li = 0.3),             method = m)        et2 <- et() %>% et(amt = 2/24, rate = 0.125) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        f.b <- rxSolve(mod.rate, et2, c(ri = 1e-06, f = 2, li = 0.3),             method = m)        test_that("rate=0.125, f=2, lag=0.3 with 2 doses makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f.a$time)                expect_equal(seq(0, 10, by = 1/24), f.b$time)                expect_equal(round(as.data.frame(f.a), 4), round(as.data.frame(f.b),                   4))            })        f.a <- rxSolve(mod.rate, et, c(ri = 0.05, f = 2, li = 0.3),             method = m)        et2 <- et() %>% et(amt = 2/24, rate = 0.05) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        f.b <- rxSolve(mod.rate, et2, c(ri = 1, f = 2, li = 0.3),             method = m)        et3 <- et() %>% et(amt = 2/24 * 2, rate = 0.05) %>% et(amt = 0.2 *             2, time = 1) %>% et(seq(0, 10, by = 1/24))        f.c <- rxSolve(mod.rate, et3, c(ri = 1, f = 1, li = 0.3),             method = m)        test_that("rate=0.05, f=2, lag=0.3 makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f.a$time)                expect_equal(seq(0, 10, by = 1/24), f.b$time)                expect_equal(as.data.frame(f.a), as.data.frame(f.b))            })        test_that("bad rates (zero/negative) throw errors", {            expect_error(rxSolve(mod.rate, et, c(ri = -1, f = 1,                 li = 0.3), method = m))            expect_error(rxSolve(mod.rate, et, c(ri = 0, f = 1,                 li = 0.3), method = m))        })        mod.dur <- RxODE({            a = 6            b = 0.6            f = 1            di = 3            li = 0            d/dt(intestine) = -a * intestine            f(intestine) = f            dur(intestine) = di            lag(intestine) = li            d/dt(blood) = a * intestine - b * blood        })        test_that("Error when rate is requested but not in table",             {                expect_error(rxSolve(mod.dur, et, c(ri = 1, f = 1,                   li = 0.3), method = m))            })        context(sprintf("Modeled duration (%s)", m))        et <- et(amt = 2/24 * 2, rate = -2) %>% et(amt = 0.2 *             2, time = 2) %>% et(seq(0, 10, by = 1/24))        test_that("Error is thrown without modeled duration",             {                expect_error({                  rxSolve(mod.rate, et, c(ri = 1, f = 1, li = 0.3),                     method = m)                })            })        f.a <- rxSolve(mod.dur, et, c(di = 0.5, f = 1, li = 0.3),             method = m)        et2 <- et() %>% et(amt = 2/24 * 2, dur = 0.5) %>% et(amt = 0.2 *             2, time = 2) %>% et(seq(0, 10, by = 1/24))        f.b <- rxSolve(mod.dur, et2, c(di = 10, f = 1, li = 0.3),             method = m)        test_that("Duration 0.5, F=1, li=0.3", {            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })        et2 <- et() %>% et(amt = 2/24 * 2, dur = 0.5) %>% et(amt = 0.2 *             2, time = 2) %>% et(seq(0, 10, by = 1/24))        f.a <- rxSolve(mod.dur, et, c(di = 0.5, f = 1, li = 0.3),             method = m)        f.b <- rxSolve(mod.dur, et2, c(di = 10, f = 1, li = 0.3),             method = m)        test_that("Duration 0.5, F=1, li=0.3", {            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })        f.a <- rxSolve(mod.dur, et, c(di = 0.5, f = 2, li = 0.3),             method = m)        f.b <- rxSolve(mod.dur, et2, c(di = 10, f = 2, li = 0.3),             method = m)        test_that("Duration 0.5, F=1, li=0.3", {            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })    }}, cran = TRUE, op.rx = 2)
  27: do.call(getFromNamespace("rxOptions", "RxODE"), args, envir = parent.frame(1))
  28: rxPermissive({    library(dplyr)    library(testthat)    ms <- c("liblsoda", "lsoda", "dop853")    if (grepl("SunOS", Sys.info()["sysname"]))         ms <- "lsoda"    for (m in ms) {        context(sprintf("Modeled rate (%s)", m))        mod.rate <- RxODE({            a = 6            b = 0.6            f = 1            ri = 10            li = 0            d/dt(intestine) = -a * intestine            f(intestine) = f            rate(intestine) = ri            lag(intestine) = li            d/dt(blood) = a * intestine - b * blood        })        library(ggplot2)        et <- et() %>% et(amt = 2/24, rate = -1, 0, addl = 9,             ii = 1) %>% et(seq(0, 10, by = 1/24))        et2 <- et() %>% et(amt = 2/24, rate = 2, 0, addl = 9,             ii = 1) %>% et(seq(0, 10, by = 1/24))        f1.a <- rxSolve(mod.rate, et, c(ri = 2, f = 1, li = 0),             method = m)        f1.b <- rxSolve(mod.rate, et2, c(ri = 0.1, f = 1, li = 0),             method = m)        test_that("rate=2, f=1, lag=0 makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f1.a$time)                expect_equal(seq(0, 10, by = 1/24), f1.b$time)                expect_equal(as.data.frame(f1.a), as.data.frame(f1.b))            })        f1.a <- rxSolve(mod.rate, et, c(ri = 2, f = 1, li = 0.5),             method = m)        f1.b <- rxSolve(mod.rate, et2, c(ri = 0.1, f = 1, li = 0.5),             method = m)        test_that("rate=2, f=1, lag=0.5 makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f1.a$time)                expect_equal(seq(0, 10, by = 1/24), f1.b$time)                expect_equal(as.data.frame(f1.a), as.data.frame(f1.b))            })        f1.a <- rxSolve(mod.rate, et, c(ri = 2, f = 2, li = 0.5),             method = m)        f1.b <- rxSolve(mod.rate, et2, c(ri = 0.1, f = 2, li = 0.5),             method = m)        test_that("rate=2, f=2, lag=0.5 makes sense for modeled rate & fixed rate",             {                expect_equal(seq(0, 10, by = 1/24), f1.a$time)                expect_equal(seq(0, 10, by = 1/24), f1.b$time)                expect_equal(as.data.frame(f1.a), as.data.frame(f1.b))            })        et <- et() %>% et(amt = 2/24, rate = -1) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        et2 <- et() %>% et(amt = 2/24, rate = 2) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        f.a <- rxSolve(mod.rate, et, c(ri = 2, f = 2, li = 0.3),             method = m)        f.b <- rxSolve(mod.rate, et2, c(ri = 1e-06, f = 2, li = 0.3),             method = m)        test_that("rate=2 makes sense for modeled rate", {            expect_equal(seq(0, 10, by = 1/24), f.a$time)            expect_equal(seq(0, 10, by = 1/24), f.b$time)            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })        f.a <- rxSolve(mod.rate, et, c(ri = 0.125, f = 2, li = 0.3),             method = m)        et2 <- et() %>% et(amt = 2/24, rate = 0.125) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        f.b <- rxSolve(mod.rate, et2, c(ri = 1e-06, f = 2, li = 0.3),             method = m)        test_that("rate=0.125, f=2, lag=0.3 with 2 doses makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f.a$time)                expect_equal(seq(0, 10, by = 1/24), f.b$time)                expect_equal(round(as.data.frame(f.a), 4), round(as.data.frame(f.b),                   4))            })        f.a <- rxSolve(mod.rate, et, c(ri = 0.05, f = 2, li = 0.3),             method = m)        et2 <- et() %>% et(amt = 2/24, rate = 0.05) %>% et(amt = 0.2,             time = 1) %>% et(seq(0, 10, by = 1/24))        f.b <- rxSolve(mod.rate, et2, c(ri = 1, f = 2, li = 0.3),             method = m)        et3 <- et() %>% et(amt = 2/24 * 2, rate = 0.05) %>% et(amt = 0.2 *             2, time = 1) %>% et(seq(0, 10, by = 1/24))        f.c <- rxSolve(mod.rate, et3, c(ri = 1, f = 1, li = 0.3),             method = m)        test_that("rate=0.05, f=2, lag=0.3 makes sense for modeled rate",             {                expect_equal(seq(0, 10, by = 1/24), f.a$time)                expect_equal(seq(0, 10, by = 1/24), f.b$time)                expect_equal(as.data.frame(f.a), as.data.frame(f.b))            })        test_that("bad rates (zero/negative) throw errors", {            expect_error(rxSolve(mod.rate, et, c(ri = -1, f = 1,                 li = 0.3), method = m))            expect_error(rxSolve(mod.rate, et, c(ri = 0, f = 1,                 li = 0.3), method = m))        })        mod.dur <- RxODE({            a = 6            b = 0.6            f = 1            di = 3            li = 0            d/dt(intestine) = -a * intestine            f(intestine) = f            dur(intestine) = di            lag(intestine) = li            d/dt(blood) = a * intestine - b * blood        })        test_that("Error when rate is requested but not in table",             {                expect_error(rxSolve(mod.dur, et, c(ri = 1, f = 1,                   li = 0.3), method = m))            })        context(sprintf("Modeled duration (%s)", m))        et <- et(amt = 2/24 * 2, rate = -2) %>% et(amt = 0.2 *             2, time = 2) %>% et(seq(0, 10, by = 1/24))        test_that("Error is thrown without modeled duration",             {                expect_error({                  rxSolve(mod.rate, et, c(ri = 1, f = 1, li = 0.3),                     method = m)                })            })        f.a <- rxSolve(mod.dur, et, c(di = 0.5, f = 1, li = 0.3),             method = m)        et2 <- et() %>% et(amt = 2/24 * 2, dur = 0.5) %>% et(amt = 0.2 *             2, time = 2) %>% et(seq(0, 10, by = 1/24))        f.b <- rxSolve(mod.dur, et2, c(di = 10, f = 1, li = 0.3),             method = m)        test_that("Duration 0.5, F=1, li=0.3", {            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })        et2 <- et() %>% et(amt = 2/24 * 2, dur = 0.5) %>% et(amt = 0.2 *             2, time = 2) %>% et(seq(0, 10, by = 1/24))        f.a <- rxSolve(mod.dur, et, c(di = 0.5, f = 1, li = 0.3),             method = m)        f.b <- rxSolve(mod.dur, et2, c(di = 10, f = 1, li = 0.3),             method = m)        test_that("Duration 0.5, F=1, li=0.3", {            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })        f.a <- rxSolve(mod.dur, et, c(di = 0.5, f = 2, li = 0.3),             method = m)        f.b <- rxSolve(mod.dur, et2, c(di = 10, f = 2, li = 0.3),             method = m)        test_that("Duration 0.5, F=1, li=0.3", {            expect_equal(as.data.frame(f.a), as.data.frame(f.b))        })    }}, cran = TRUE)
  29: eval(code, test_env)
  30: eval(code, test_env)
  31: 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)
  32: doTryCatch(return(expr), name, parentenv, handler)
  33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  34: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  35: doTryCatch(return(expr), name, parentenv, handler)
  36: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  37: tryCatchList(expr, classes, parentenv, handlers)
  38: 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) {    })
  39: test_code(NULL, exprs, env)
  40: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  41: force(code)
  42: 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()    })
  43: FUN(X[[i]], ...)
  44: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  45: force(code)
  46: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  47: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  48: 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)
  49: 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)
  50: test_check("RxODE")
  An irrecoverable exception occurred. R is aborting now ...
  Segmentation fault