Running ‘testthat.R’ [4s/12s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(DtD)
  > 
  > test_check("DtD")
  ── 1. Error: iterative method gives previous output without supplying a starting
  LOGICAL() can only be applied to a 'logical', not a 'raw'
  1: with(sims, expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time), structure(list(ests = structure(c(0.128950682053545, 
         0.206531228321864), .Names = c("mu", "vol")), n_iter = 12L, success = TRUE), 
         .Names = c("ests", "n_iter", "success")))) at testthat/test_est_iterative.R:9
  2: with.default(sims, expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time), 
         structure(list(ests = structure(c(0.128950682053545, 0.206531228321864), .Names = c("mu", 
             "vol")), n_iter = 12L, success = TRUE), .Names = c("ests", "n_iter", "success"))))
  3: eval(substitute(expr), data, enclos = parent.frame())
  4: eval(substitute(expr), data, enclos = parent.frame())
  5: expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time), structure(list(ests = structure(c(0.128950682053545, 
         0.206531228321864), .Names = c("mu", "vol")), n_iter = 12L, success = TRUE), 
         .Names = c("ests", "n_iter", "success")))
  6: quasi_label(enquo(object), label)
  7: eval_bare(get_expr(quo), get_env(quo))
  8: BS_fit(S = S, D = D, T. = T, r = r, time = time)
  9: eval(cl, tmp)
  10: eval(cl, tmp)
  11: .BS_fit_check_n_setup(S = S, D = D, T. = T, r = r, time = time, method = "iterative", 
         tol = 1e-12, eps = 1e-08)
  12: assert_choice(method, c("iterative", "mle"))
  13: checkChoice(x, choices, null.ok, fmatch)
  14: qassert(null.ok, "B1")
  
  ── 2. Error: iterative method gives previous output when supplying a starting va
  LOGICAL() can only be applied to a 'logical', not a 'raw'
  1: with(sims, expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time, vol_start = 1), 
         structure(list(ests = structure(c(0.128950682053545, 0.206531228321864), .Names = c("mu", 
             "vol")), n_iter = 15L, success = TRUE), .Names = c("ests", "n_iter", "success")))) at testthat/test_est_iterative.R:25
  2: with.default(sims, expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time, 
         vol_start = 1), structure(list(ests = structure(c(0.128950682053545, 0.206531228321864), 
         .Names = c("mu", "vol")), n_iter = 15L, success = TRUE), .Names = c("ests", "n_iter", 
         "success"))))
  3: eval(substitute(expr), data, enclos = parent.frame())
  4: eval(substitute(expr), data, enclos = parent.frame())
  5: expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time, vol_start = 1), structure(list(ests = structure(c(0.128950682053545, 
         0.206531228321864), .Names = c("mu", "vol")), n_iter = 15L, success = TRUE), 
         .Names = c("ests", "n_iter", "success")))
  6: quasi_label(enquo(object), label)
  7: eval_bare(get_expr(quo), get_env(quo))
  8: BS_fit(S = S, D = D, T. = T, r = r, time = time, vol_start = 1)
  9: eval(cl, tmp)
  10: eval(cl, tmp)
  11: .BS_fit_check_n_setup(S = S, D = D, T. = T, r = r, time = time, method = "iterative", 
         tol = 1e-12, eps = 1e-08)
  12: assert_choice(method, c("iterative", "mle"))
  13: checkChoice(x, choices, null.ok, fmatch)
  14: qassert(null.ok, "B1")
  
  ── 3. Error: supplying dt or time gives the same when it should (@test_est_itera
  LOGICAL() can only be applied to a 'logical', not a 'raw'
  1: with(sims, expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time, vol_start = 1), 
         BS_fit(S = S, D = D, T. = T, r = r, dt = 0.1, vol_start = 1))) at testthat/test_est_iterative.R:41
  2: with.default(sims, expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time, 
         vol_start = 1), BS_fit(S = S, D = D, T. = T, r = r, dt = 0.1, vol_start = 1)))
  3: eval(substitute(expr), data, enclos = parent.frame())
  4: eval(substitute(expr), data, enclos = parent.frame())
  5: expect_equal(BS_fit(S = S, D = D, T. = T, r = r, time = time, vol_start = 1), BS_fit(S = S, 
         D = D, T. = T, r = r, dt = 0.1, vol_start = 1))
  6: quasi_label(enquo(object), label)
  7: eval_bare(get_expr(quo), get_env(quo))
  8: BS_fit(S = S, D = D, T. = T, r = r, time = time, vol_start = 1)
  9: eval(cl, tmp)
  10: eval(cl, tmp)
  11: .BS_fit_check_n_setup(S = S, D = D, T. = T, r = r, time = time, method = "iterative", 
         tol = 1e-12, eps = 1e-08)
  12: assert_choice(method, c("iterative", "mle"))
  13: checkChoice(x, choices, null.ok, fmatch)
  14: qassert(null.ok, "B1")
  
  
   *** caught segfault ***
  address 197a3408, cause 'memory not mapped'
  
  Traceback:
   1: qassert(null.ok, "B1")
   2: checkChoice(x, choices, null.ok, fmatch)
   3: assert_choice(method, c("iterative", "mle"))
   4: .BS_fit_check_n_setup(S = S, D = D, T. = T, r = r, time = time,     method = "mle", eps = 1e-08, tol = 1e-12)
   5: eval(cl, tmp)
   6: eval(cl, tmp)
   7: BS_fit(S = S, D = D, T. = T, r = r, time = time, method = "mle",     eps = 1e-08, vol_start = 0.2)
   8: eval(substitute(expr), data, enclos = parent.frame())
   9: eval(substitute(expr), data, enclos = parent.frame())
  10: with.default(sims, BS_fit(S = S, D = D, T. = T, r = r, time = time,     method = "mle", eps = 1e-08, vol_start = 0.2))
  11: with(sims, BS_fit(S = S, D = D, T. = T, r = r, time = time, method = "mle",     eps = 1e-08, vol_start = 0.2))
  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("We get the same with optim whether we use build in function or optim with 'merton_ll'",     {        set.seed(4648394)        sims <- BS_sim(vol = 0.1, mu = 0.05, dt = 0.1, V_0 = 100,             T. = 1, D = rep(80, 20), r = 0.01)        r1 <- with(sims, BS_fit(S = S, D = D, T. = T, r = r,             time = time, method = "mle", eps = 1e-08, vol_start = 0.2))        r2 <- optim(c(mu = 0, log_vol = log(0.2)), function(par) -with(sims,             merton_ll(S = S, D = D, T. = T, r = r, time = time,                 mu = par["mu"], vol = exp(par["log_vol"]))))        expect_equal(r1$n_iter, unname(r2$counts[1]))        expect_equal(r1$ests[1], r2$par[1])        expect_equal(r1$ests[2], exp(r2$par[2]), check.attributes = FALSE)    })
  24: eval(code, test_env)
  25: eval(code, test_env)
  26: 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)
  27: doTryCatch(return(expr), name, parentenv, handler)
  28: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  29: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  30: doTryCatch(return(expr), name, parentenv, handler)
  31: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  32: tryCatchList(expr, classes, parentenv, handlers)
  33: 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) {    })
  34: test_code(NULL, exprs, env)
  35: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  36: force(code)
  37: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        end_context()    })
  38: FUN(X[[i]], ...)
  39: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  40: 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("DtD")
  An irrecoverable exception occurred. R is aborting now ...