[CHNOSZ-commits] r685 - in pkg/CHNOSZ: . inst/tinytest
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Feb 1 10:40:35 CET 2022
Author: jedick
Date: 2022-02-01 10:40:34 +0100 (Tue, 01 Feb 2022)
New Revision: 685
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/inst/tinytest/test-affinity.R
pkg/CHNOSZ/inst/tinytest/test-berman.R
pkg/CHNOSZ/inst/tinytest/test-findit.R
pkg/CHNOSZ/inst/tinytest/test-mosaic.R
pkg/CHNOSZ/inst/tinytest/test-revisit.R
pkg/CHNOSZ/inst/tinytest/test-util.program.R
pkg/CHNOSZ/inst/tinytest/test-water.lines.R
Log:
Use exit_file() in tests
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/DESCRIPTION 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,6 +1,6 @@
-Date: 2022-01-29
+Date: 2022-02-01
Package: CHNOSZ
-Version: 1.4.1-11
+Version: 1.4.1-12
Title: Thermodynamic Calculations and Diagrams for Geochemistry
Authors at R: c(
person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),
Modified: pkg/CHNOSZ/inst/tinytest/test-affinity.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-affinity.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-affinity.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,5 +1,5 @@
# This is a long test ... only run it "at home" 20220129
-if(at_home()) {
+if(!at_home()) exit_file("Skipping long test")
# Load default settings for CHNOSZ
reset()
@@ -191,5 +191,3 @@
a1 <- affinity(T = c(0, 100))
a2 <- affinity(T = c(0, 100), sout = a0$sout)
expect_equal(a1$values, a2$values, info = info)
-
-}
Modified: pkg/CHNOSZ/inst/tinytest/test-berman.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-berman.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-berman.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,7 +1,7 @@
# test-berman.R 20171001
# This is a long test ... only run it "at home" 20220129
-if(at_home()) {
+if(!at_home()) exit_file("Skipping long test")
# Load default settings for CHNOSZ
reset()
@@ -109,5 +109,3 @@
"NAs don't creep into calculations below 298.15 K for minerals with disorder parameters"
# 20191116
expect_false(any(is.na(subcrt("K-feldspar", P = 1, T = seq(273.15, 303.15, 5), convert = FALSE)$out[[1]]$G)), info = info)
-
-}
Modified: pkg/CHNOSZ/inst/tinytest/test-findit.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-findit.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-findit.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,5 +1,5 @@
# This is a long test ... only run it "at home" 20220130
-if(at_home()) {
+if(!at_home()) exit_file("Skipping long test")
# Load default settings for CHNOSZ
reset()
@@ -38,5 +38,3 @@
expect_equal(tail(f$value[[2]],1), -exp(1), tolerance = 1e-2, info = info)
expect_equal(tail(f$value[[3]],1), -sqrt(2), tolerance = 1e-1, info = info)
# we could decrease the tolerance by increasing the resolution and/or iterations in findit()
-
-}
Modified: pkg/CHNOSZ/inst/tinytest/test-mosaic.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-mosaic.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-mosaic.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,5 +1,5 @@
# This is a long test ... only run it "at home" 20220129
-if(at_home()) {
+if(!at_home()) exit_file("Skipping long test")
# Load default settings for CHNOSZ
reset()
@@ -152,5 +152,3 @@
#title(main = "A(single basis species) - A(all basis species)")
#legend("topleft", legend = describe.reaction(s1$reaction))
expect_equivalent(as.numeric(Adiff), rep(0, length(Adiff)), info = info)
-
-}
Modified: pkg/CHNOSZ/inst/tinytest/test-revisit.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-revisit.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-revisit.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -83,11 +83,10 @@
# we can even go into 2 dimensions
# (it's a slightly longer test, so don't run it on CRAN)
-if(at_home()) {
- a2 <- affinity(H2 = c(-10, -5, 101), T = c(0, 100, 101), exceed.Ttr = TRUE)
- e2 <- equilibrate(a2)
- r2 <- revisit(e2, "DGtr", loga2 = loga2, plot.it = FALSE)
- # we should DGtr = 0 at the temperature of the reference distribution (25 degC)
- expect_equal(min(r2$H), 0, info = info)
- expect_equal(r2$yopt, 25, info = info)
-}
+if(!at_home()) exit_file("Skipping long test")
+a2 <- affinity(H2 = c(-10, -5, 101), T = c(0, 100, 101), exceed.Ttr = TRUE)
+e2 <- equilibrate(a2)
+r2 <- revisit(e2, "DGtr", loga2 = loga2, plot.it = FALSE)
+# we should DGtr = 0 at the temperature of the reference distribution (25 degC)
+expect_equal(min(r2$H), 0, info = info)
+expect_equal(r2$yopt, 25, info = info)
Modified: pkg/CHNOSZ/inst/tinytest/test-util.program.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-util.program.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-util.program.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,5 +1,5 @@
# This is a long test ... only run it "at home" 20220131
-if(at_home()) {
+if(!at_home()) exit_file("Skipping long test")
# Load default settings for CHNOSZ
reset()
@@ -29,5 +29,3 @@
a <- affinity(O2 = c(-90, -60, 1000))
expect_message(e <- equilibrate(a), "equil.reaction running 1000 calculations", info = info)
}
-
-}
Modified: pkg/CHNOSZ/inst/tinytest/test-water.lines.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-water.lines.R 2022-01-31 13:27:27 UTC (rev 684)
+++ pkg/CHNOSZ/inst/tinytest/test-water.lines.R 2022-02-01 09:40:34 UTC (rev 685)
@@ -1,5 +1,5 @@
# This is a long test ... only run it "at home" 20220131
-if(at_home()) {
+if(!at_home()) exit_file("Skipping long test")
# Load default settings for CHNOSZ
reset()
@@ -75,5 +75,3 @@
swap.basis("O2", "hydrogen"); n5 <- nspecies(affinity(H2 = c(-50, 10, res), T = c(0, 200, res))) # T-logfH2
swap.basis("hydrogen", "H2"); n6 <- nspecies(affinity(H2 = c(-50, 10, res), T = c(0, 200, res))) # T-logaH2
expect_equal(c(n1, n2, n3, n4, n5, n6), c(1, 1, 1, 1, 1, 1), info = info)
-
-}
More information about the CHNOSZ-commits
mailing list