Go to the source code of this file.
|
| void | testExceptionMessage (const FileName filename, const std::string msg) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, validateTestDB) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, missingHeader) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, missingTemperature) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, missingActivityModel) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, missingLogKValue) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, nonRealValue) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, nonReaArraylValue) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, nonReaWeight) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, nonReaNeutralSpeciesArray) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, missingNeutralValue) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, noCharge) |
| |
| | TEST (GeochemicalDatabaseValidatorTest, noStoichiometry) |
| |
◆ TEST() [1/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingActivityModel |
|
|
) |
| |
Definition at line 68 of file GeochemicalDatabaseValidatorTest.C.
69{
70 const FileName filename = "database/faultydbs/missing_activity.json";
71 const std::string msg = "The MOOSE database " + filename +
72 " does not have a required \"Header:activity model\" field";
74}
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [2/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingHeader |
|
|
) |
| |
Definition at line 52 of file GeochemicalDatabaseValidatorTest.C.
53{
54 const FileName filename = "database/faultydbs/missing_header.json";
55 const std::string msg =
56 "The MOOSE database " + filename + " does not have a required \"Header\" field";
58}
◆ TEST() [3/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingLogKValue |
|
|
) |
| |
Definition at line 76 of file GeochemicalDatabaseValidatorTest.C.
77{
78 const FileName filename = "database/faultydbs/missing_value.json";
79 const std::string msg =
80 "The number of values in the logk field of secondary species CO2(aq) in " + filename +
81 " is not equal to the number of temperature values";
83}
◆ TEST() [4/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingNeutralValue |
|
|
) |
| |
Definition at line 118 of file GeochemicalDatabaseValidatorTest.C.
119{
120 const FileName filename = "database/faultydbs/missing_neutral_value.json";
121 const std::string msg = "The number of values in the Header:neutral species:h2o:a field of " +
122 filename + " is not equal to the number of temperature values";
124}
◆ TEST() [5/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingTemperature |
|
|
) |
| |
Definition at line 60 of file GeochemicalDatabaseValidatorTest.C.
61{
62 const FileName filename = "database/faultydbs/missing_temperature.json";
63 const std::string msg =
64 "The MOOSE database " + filename + " does not have a required \"Header:temperatures\" field";
66}
◆ TEST() [6/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
noCharge |
|
|
) |
| |
Definition at line 126 of file GeochemicalDatabaseValidatorTest.C.
127{
128 const FileName filename = "database/faultydbs/no_charge.json";
129 const std::string msg = "The secondary species CO3-- in " + filename + " does not have a charge";
131}
◆ TEST() [7/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonReaArraylValue |
|
|
) |
| |
Definition at line 93 of file GeochemicalDatabaseValidatorTest.C.
94{
95 const FileName filename = "database/faultydbs/nonreal_arrayvalue.json";
96 const std::string msg = "Array value \"abcd\" in the logk field of mineral species Calcite in "
97 "database/faultydbs/nonreal_arrayvalue.json cannot be converted to Real";
99}
◆ TEST() [8/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonRealValue |
|
|
) |
| |
Definition at line 85 of file GeochemicalDatabaseValidatorTest.C.
86{
87 const FileName filename = "database/faultydbs/nonreal_value.json";
88 const std::string msg = "radius value \"4.5x\" of the secondary species CO3-- in "
89 "database/faultydbs/nonreal_value.json cannot be converted to Real";
91}
◆ TEST() [9/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonReaNeutralSpeciesArray |
|
|
) |
| |
Definition at line 110 of file GeochemicalDatabaseValidatorTest.C.
111{
112 const FileName filename = "database/faultydbs/nonreal_neutralspecies.json";
113 const std::string msg = "Array value \".1967cg\" in the Header:neutral species:co2:a field of " +
114 filename + " cannot be converted to Real";
116}
◆ TEST() [10/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonReaWeight |
|
|
) |
| |
Definition at line 101 of file GeochemicalDatabaseValidatorTest.C.
102{
103 const FileName filename = "database/faultydbs/nonreal_weight.json";
104 const std::string msg =
105 "Weight value \"1.xyz\" of constituent HCO3- of the secondary species CO3-- in "
106 "database/faultydbs/nonreal_weight.json cannot be converted to Real";
108}
◆ TEST() [11/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
noStoichiometry |
|
|
) |
| |
Definition at line 133 of file GeochemicalDatabaseValidatorTest.C.
134{
135 const FileName filename = "database/faultydbs/no_stoi.json";
136 const std::string msg = "The secondary species CO3-- in " + filename + " does not have a species";
138}
◆ TEST() [12/12]
| TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
validateTestDB |
|
|
) |
| |
Definition at line 38 of file GeochemicalDatabaseValidatorTest.C.
39{
40
41 FileName filename = "database/moose_testdb.json";
42 std::ifstream jsondata(filename);
45
46
47
50}
const GeochemicalDatabaseReader database("database/moose_testdb.json", true, true, false)
void validate(const FileName filename, const nlohmann::json &db)
Validate the thermodynamic database.
Class for validating MOOSE geochemical database.
Real root(std::function< Real(Real)> const &f, Real x1, Real x2, Real tol=1.0e-12)
Finds the root of a function using Brent's method.
◆ testExceptionMessage()
| void testExceptionMessage |
( |
const FileName |
filename, |
|
|
const std::string |
msg |
|
) |
| |
Definition at line 16 of file GeochemicalDatabaseValidatorTest.C.
17{
18
19 std::ifstream jsondata(filename);
22
24
25
26 try
27 {
29 FAIL() << "Missing expected exception.";
30 }
31 catch (const std::exception & err)
32 {
33 std::size_t pos = std::string(
err.what()).find(msg);
34 ASSERT_TRUE(pos != std::string::npos);
35 }
36}
OStreamProxy err(std::cerr)
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().