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 |
, |
|
|
validateTestDB |
|
|
) |
| |
Definition at line 38 of file GeochemicalDatabaseValidatorTest.C.
41 FileName filename =
"database/moose_testdb.json";
42 std::ifstream jsondata(filename);
void validate(const FileName filename, const nlohmann::json &db)
Validate the thermodynamic database.
const GeochemicalDatabaseReader database("database/moose_testdb.json", true, true, false)
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.
Class for validating MOOSE geochemical database.
◆ TEST() [2/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingHeader |
|
|
) |
| |
Definition at line 52 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [3/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingTemperature |
|
|
) |
| |
Definition at line 60 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [4/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingActivityModel |
|
|
) |
| |
Definition at line 68 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [5/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingLogKValue |
|
|
) |
| |
Definition at line 76 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [6/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonRealValue |
|
|
) |
| |
Definition at line 85 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [7/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonReaArraylValue |
|
|
) |
| |
Definition at line 93 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [8/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonReaWeight |
|
|
) |
| |
Definition at line 101 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [9/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
nonReaNeutralSpeciesArray |
|
|
) |
| |
Definition at line 110 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [10/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
missingNeutralValue |
|
|
) |
| |
Definition at line 118 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [11/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
noCharge |
|
|
) |
| |
Definition at line 126 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ TEST() [12/12]
TEST |
( |
GeochemicalDatabaseValidatorTest |
, |
|
|
noStoichiometry |
|
|
) |
| |
Definition at line 133 of file GeochemicalDatabaseValidatorTest.C.
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";
void testExceptionMessage(const FileName filename, const std::string msg)
◆ testExceptionMessage()
void testExceptionMessage |
( |
const FileName |
filename, |
|
|
const std::string |
msg |
|
) |
| |
Definition at line 16 of file GeochemicalDatabaseValidatorTest.C.
Referenced by TEST().
19 std::ifstream jsondata(filename);
29 FAIL() <<
"Missing expected exception.";
31 catch (
const std::exception & err)
33 std::size_t pos = std::string(
err.what()).find(msg);
34 ASSERT_TRUE(pos != std::string::npos);
void validate(const FileName filename, const nlohmann::json &db)
Validate the thermodynamic database.
const GeochemicalDatabaseReader database("database/moose_testdb.json", true, true, false)
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.
Class for validating MOOSE geochemical database.