aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testthat')
-rw-r--r--tests/testthat/FOCUS_2006_D.csf2
-rw-r--r--tests/testthat/NAFTA_SOP_Appendix_B.txt26
-rw-r--r--tests/testthat/NAFTA_SOP_Appendix_D.txt30
-rw-r--r--tests/testthat/SFO_SFO_printed.txt1
-rw-r--r--tests/testthat/test_mkinfit_errors.R1
-rw-r--r--tests/testthat/test_mkinmod.R8
-rw-r--r--tests/testthat/test_nafta.R7
7 files changed, 39 insertions, 36 deletions
diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf
index ae524e01..c14aab4d 100644
--- a/tests/testthat/FOCUS_2006_D.csf
+++ b/tests/testthat/FOCUS_2006_D.csf
@@ -5,7 +5,7 @@ Description:
MeasurementUnits: % AR
TimeUnits: days
Comments: Created using mkin::CAKE_export
-Date: 2019-02-27
+Date: 2019-03-04
Optimiser: IRLS
[Data]
diff --git a/tests/testthat/NAFTA_SOP_Appendix_B.txt b/tests/testthat/NAFTA_SOP_Appendix_B.txt
index 3842db91..e5479b88 100644
--- a/tests/testthat/NAFTA_SOP_Appendix_B.txt
+++ b/tests/testthat/NAFTA_SOP_Appendix_B.txt
@@ -7,29 +7,29 @@ Critical sum of squares for checking the SFO model:
Parameters:
$SFO
- Estimate Pr(>t) Lower Upper
-parent_0 51.2430312 1.178492e-10 45.4036817 57.0823806
-k_parent_sink 0.2531291 1.608492e-06 0.1935733 0.3310082
+ Estimate Pr(>t) Lower Upper
+parent_0 51.243 1.18e-10 45.404 57.082
+k_parent_sink 0.253 1.61e-06 0.194 0.331
$IORE
- Estimate Pr(>t) Lower Upper
-parent_0 51.710529483 8.522723e-15 4.951371e+01 53.907348241
-k__iore_parent_sink 0.001348359 6.841094e-02 3.421379e-04 0.005313859
-N_parent 2.661469429 3.975823e-08 2.191012e+00 3.131927092
+ Estimate Pr(>t) Lower Upper
+parent_0 51.71053 8.52e-15 4.95e+01 53.90735
+k__iore_parent_sink 0.00135 6.84e-02 3.42e-04 0.00531
+N_parent 2.66147 3.98e-08 2.19e+00 3.13193
$DFOP
- Estimate Pr(>t) Lower Upper
-parent_0 51.70546719 3.457982e-14 49.677926850 53.73300753
-k1 0.41569648 1.002119e-06 0.330769606 0.52242879
-k2 0.01273299 1.393989e-03 0.007230162 0.02242399
-g 0.83380396 5.718367e-12 0.771816175 0.88153694
+ Estimate Pr(>t) Lower Upper
+parent_0 51.7055 3.46e-14 49.67793 53.7330
+k1 0.4157 1.00e-06 0.33077 0.5224
+k2 0.0127 1.39e-03 0.00723 0.0224
+g 0.8338 5.72e-12 0.77182 0.8815
DTx values:
DT50 DT90 DT50_rep
SFO 2.74 9.1 2.74
IORE 1.37 28.5 8.57
-DFOP 2.17 39.9 54.40
+DFOP 2.17 39.9 54.44
Representative half-life:
[1] 8.573302
diff --git a/tests/testthat/NAFTA_SOP_Appendix_D.txt b/tests/testthat/NAFTA_SOP_Appendix_D.txt
index 8720a3b6..7ff2817c 100644
--- a/tests/testthat/NAFTA_SOP_Appendix_D.txt
+++ b/tests/testthat/NAFTA_SOP_Appendix_D.txt
@@ -7,29 +7,29 @@ Critical sum of squares for checking the SFO model:
Parameters:
$SFO
- Estimate Pr(>t) Lower Upper
-parent_0 83.755751519 8.076390e-15 76.928220975 90.583282063
-k_parent_sink 0.001703321 7.452357e-05 0.001108568 0.002617164
+ Estimate Pr(>t) Lower Upper
+parent_0 83.7558 8.08e-15 76.92822 90.58328
+k_parent_sink 0.0017 7.45e-05 0.00111 0.00262
$IORE
- Estimate Pr(>t) Lower Upper
-parent_0 9.685291e+01 NA 8.752855e+01 1.061773e+02
-k__iore_parent_sink 8.403401e-14 NA 1.092058e-19 6.466429e-08
-N_parent 6.684457e+00 NA 3.538510e+00 9.830404e+00
+ Estimate Pr(>t) Lower Upper
+parent_0 9.69e+01 NA 8.75e+01 1.06e+02
+k__iore_parent_sink 8.40e-14 NA 1.09e-19 6.47e-08
+N_parent 6.68e+00 NA 3.54e+00 9.83e+00
$DFOP
- Estimate Pr(>t) Lower Upper
-parent_0 9.755655e+01 4.439930e-13 8.884447e+01 1.062686e+02
-k1 4.240633e-02 3.554769e-02 1.414189e-02 1.271610e-01
-k2 8.237928e-04 2.060933e-02 3.172784e-04 2.138925e-03
-g 2.881037e-01 1.313715e-04 1.783967e-01 4.299694e-01
+ Estimate Pr(>t) Lower Upper
+parent_0 9.76e+01 4.44e-13 8.88e+01 1.06e+02
+k1 4.24e-02 3.55e-02 1.41e-02 1.27e-01
+k2 8.24e-04 2.06e-02 3.17e-04 2.14e-03
+g 2.88e-01 1.31e-04 1.78e-01 4.30e-01
DTx values:
DT50 DT90 DT50_rep
-SFO 407 1350 407
-IORE 541 5190000 1560000
-DFOP 429 2380 841
+SFO 407 1352 407
+IORE 541 5192060 1562966
+DFOP 429 2383 841
Representative half-life:
[1] 841.4096
diff --git a/tests/testthat/SFO_SFO_printed.txt b/tests/testthat/SFO_SFO_printed.txt
index 8a188152..d0402fc0 100644
--- a/tests/testthat/SFO_SFO_printed.txt
+++ b/tests/testthat/SFO_SFO_printed.txt
@@ -6,7 +6,6 @@ $type: SFO; $to: m1; $sink: TRUE
$m1
$type: SFO; $sink: TRUE
Coefficient matrix $coefmat available
-Compiled model $cf available
Differential equations:
d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
d_m1/dt = + k_parent_m1 * parent - k_m1_sink * m1
diff --git a/tests/testthat/test_mkinfit_errors.R b/tests/testthat/test_mkinfit_errors.R
index 50d528e0..f1b4618c 100644
--- a/tests/testthat/test_mkinfit_errors.R
+++ b/tests/testthat/test_mkinfit_errors.R
@@ -81,6 +81,7 @@ test_that("We get reproducible output if quiet = FALSE", {
})
test_that("We get warnings in case of overparameterisation", {
+ skip_on_cran() # On winbuilder the following fit does not give a warning
expect_warning(f <- mkinfit("FOMC", FOCUS_2006_A, quiet = TRUE), "not converge")
s2 <- expect_warning(summary(mkinfit("DFOP", FOCUS_2006_A, quiet = TRUE)), "singular system")
})
diff --git a/tests/testthat/test_mkinmod.R b/tests/testthat/test_mkinmod.R
index 430fad61..1f8ec166 100644
--- a/tests/testthat/test_mkinmod.R
+++ b/tests/testthat/test_mkinmod.R
@@ -45,8 +45,10 @@ test_that("mkinmod stops to prevent and/or explain user errors", {
})
test_that("Printing mkinmod models is reproducible", {
- expect_known_output(print(mkinmod(parent = mkinsub("SFO", "m1"),
- m1 = mkinsub("SFO"),
- quiet = TRUE)),
+ m_test <- mkinmod(parent = mkinsub("SFO", "m1"),
+ m1 = mkinsub("SFO"),
+ quiet = TRUE)
+ m_test$cf <- NULL # Remove to make test robust against missing gcc
+ expect_known_output(print(m_test),
file = "SFO_SFO_printed.txt")
})
diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R
index ad0f1d63..9528200d 100644
--- a/tests/testthat/test_nafta.R
+++ b/tests/testthat/test_nafta.R
@@ -19,10 +19,10 @@
context("Evaluations according to 2015 NAFTA guidance")
test_that("Data for more than one compound are rejected",
- expect_error(nafta(FOCUS_2006_D)))
+ expect_error(nafta(FOCUS_2006_D, cores = 1)))
test_that("Test data from Appendix B are correctly evaluated", {
- expect_message(res <- nafta(NAFTA_SOP_Appendix_B, "aerobic aquatic"))
+ expect_message(res <- nafta(NAFTA_SOP_Appendix_B, "aerobic aquatic", cores = 1))
# From Figure D.1
dtx_sop <- matrix(c(2.74, 1.37, 2.17, 9.1, 28.5, 39.9), nrow = 3, ncol = 2)
@@ -43,7 +43,8 @@ test_that("Test data from Appendix B are correctly evaluated", {
})
test_that("Test data from Appendix D are correctly evaluated", {
- expect_message(res <- nafta(NAFTA_SOP_Appendix_D, "MRID 555555"))
+ expect_warning(res <- nafta(NAFTA_SOP_Appendix_D, "MRID 555555",
+ cores = 1, quiet = TRUE))
# From Figure D.1
dtx_sop <- matrix(c(407, 541, 429, 1352, 5192066, 2383), nrow = 3, ncol = 2)

Contact - Imprint