aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/setup_script.R14
-rw-r--r--tests/testthat/test_analytical.R7
-rw-r--r--tests/testthat/test_plot.R14
-rw-r--r--tests/testthat/test_saemix_parent.R1
4 files changed, 17 insertions, 19 deletions
diff --git a/tests/testthat/setup_script.R b/tests/testthat/setup_script.R
index 10696082..8ffe0b9d 100644
--- a/tests/testthat/setup_script.R
+++ b/tests/testthat/setup_script.R
@@ -202,17 +202,3 @@ dfop_saemix_2 <- saem(mmkin_dfop_1, quiet = TRUE, transformations = "saemix")
saem_biphasic_m <- saem(mmkin_biphasic, transformations = "mkin", quiet = TRUE)
saem_biphasic_s <- saem(mmkin_biphasic, transformations = "saemix", quiet = TRUE)
-# UBA datasets
-ds_uba <- lapply(experimental_data_for_UBA_2019[6:10],
- function(x) subset(x$data[c("name", "time", "value")]))
-names(ds_uba) <- paste("Dataset", 6:10)
-sfo_sfo_uba <- mkinmod(parent = mkinsub("SFO", "A1"),
- A1 = mkinsub("SFO"), quiet = TRUE)
-dfop_sfo_uba <- mkinmod(parent = mkinsub("DFOP", "A1"),
- A1 = mkinsub("SFO"), quiet = TRUE)
-f_uba_mmkin <- mmkin(list("SFO-SFO" = sfo_sfo_uba, "DFOP-SFO" = dfop_sfo_uba),
- ds_uba, quiet = TRUE, cores = n_cores)
-f_uba_dfop_sfo_mixed <- mixed(f_uba_mmkin[2, ])
-
-f_uba_sfo_sfo_saem <- saem(f_uba_mmkin["SFO-SFO", ], quiet = TRUE, transformations = "saemix")
-f_uba_dfop_sfo_saem <- saem(f_uba_mmkin["DFOP-SFO", ], quiet = TRUE, transformations = "saemix")
diff --git a/tests/testthat/test_analytical.R b/tests/testthat/test_analytical.R
index 66fb1ace..e6cb7ed3 100644
--- a/tests/testthat/test_analytical.R
+++ b/tests/testthat/test_analytical.R
@@ -1,9 +1,7 @@
context("Analytical solutions for coupled models")
-# We do not want the warnings due to non-normality of residuals here
-warn_option <- options(warn=-1)
-
test_that("The analytical solutions for SFO-SFO are correct", {
+ skip_on_cran()
# No sink, no formation fractions
SFO_SFO_nosink <- mkinmod(
parent = mkinsub("SFO", to = "m1", sink = FALSE),
@@ -50,6 +48,7 @@ test_that("The analytical solutions for SFO-SFO are correct", {
})
test_that("The analytical solution for DFOP-SFO are correct", {
+ skip_on_cran()
# With formation fraction
f_dfop_sfo_analytical <- mkinfit(DFOP_SFO, FOCUS_D,
solution_type = "analytical", quiet = TRUE)
@@ -61,5 +60,3 @@ test_that("The analytical solution for DFOP-SFO are correct", {
tolerance = 5e-6
)
})
-
-options(warn = warn_option$warn)
diff --git a/tests/testthat/test_plot.R b/tests/testthat/test_plot.R
index 4f484cf3..58a00662 100644
--- a/tests/testthat/test_plot.R
+++ b/tests/testthat/test_plot.R
@@ -30,6 +30,20 @@ test_that("Plotting mkinfit, mmkin and mixed model objects is reproducible", {
plot_err_sfo_sfo <- function() plot_err(f_sfo_sfo_desolve)
vdiffr::expect_doppelganger("plot_err for FOCUS D", plot_err_sfo_sfo)
+ # UBA datasets
+ ds_uba <- lapply(experimental_data_for_UBA_2019[6:10],
+ function(x) subset(x$data[c("name", "time", "value")]))
+ names(ds_uba) <- paste("Dataset", 6:10)
+ sfo_sfo_uba <- mkinmod(parent = mkinsub("SFO", "A1"),
+ A1 = mkinsub("SFO"), quiet = TRUE)
+ dfop_sfo_uba <- mkinmod(parent = mkinsub("DFOP", "A1"),
+ A1 = mkinsub("SFO"), quiet = TRUE)
+ f_uba_mmkin <- mmkin(list("DFOP-SFO" = dfop_sfo_uba),
+ ds_uba, quiet = TRUE, cores = n_cores)
+ f_uba_dfop_sfo_mixed <- mixed(f_uba_mmkin["DFOP-SFO", ])
+
+ f_uba_dfop_sfo_saem <- saem(f_uba_mmkin["DFOP-SFO", ], quiet = TRUE, transformations = "saemix")
+
plot_biphasic_mmkin <- function() plot(f_uba_dfop_sfo_mixed)
vdiffr::expect_doppelganger("mixed model fit for mmkin object", plot_biphasic_mmkin)
diff --git a/tests/testthat/test_saemix_parent.R b/tests/testthat/test_saemix_parent.R
index 8beceba9..340db6f1 100644
--- a/tests/testthat/test_saemix_parent.R
+++ b/tests/testthat/test_saemix_parent.R
@@ -2,6 +2,7 @@ context("saemix parent models")
test_that("Parent fits using saemix are correctly implemented", {
+ skip_on_cran()
expect_error(saem(fits), "Only row objects")
# Some fits were done in the setup script
mmkin_sfo_2 <- update(mmkin_sfo_1, fixed_initials = c(parent = 100))

Contact - Imprint