Adding test for EN_getnodevalue

This commit is contained in:
Michael Tryby
2019-03-12 13:35:24 -04:00
parent b86b1508cf
commit 32091830c6
3 changed files with 152 additions and 37 deletions

View File

@@ -55,13 +55,13 @@ boost::test_tools::predicate_result check_string(std::string test, std::string r
}
#define DATA_PATH_INP "./net1.inp"
#define DATA_PATH_NET1 "./net1.inp"
#define DATA_PATH_RPT "./test.rpt"
#define DATA_PATH_OUT "./test.out"
struct FixtureOpenClose{
FixtureOpenClose() {
path_inp = std::string(DATA_PATH_INP);
path_inp = std::string(DATA_PATH_NET1);
path_rpt = std::string(DATA_PATH_RPT);
path_out = std::string(DATA_PATH_OUT);
@@ -81,3 +81,53 @@ struct FixtureOpenClose{
int error;
EN_Project ph;
};
struct FixtureAfterStep{
FixtureAfterStep() {
flag = 0;
tstop = 10800;
path_inp = std::string(DATA_PATH_NET1);
path_rpt = std::string(DATA_PATH_RPT);
path_out = std::string(DATA_PATH_OUT);
EN_createproject(&ph);
error = EN_open(ph, path_inp.c_str(), path_rpt.c_str(), path_out.c_str());
error = EN_solveH(ph);
BOOST_REQUIRE(error == 0);
error = EN_openQ(ph);
BOOST_REQUIRE(error == 0);
error = EN_initQ(ph, flag);
BOOST_REQUIRE(error == 0);
do {
error = EN_runQ(ph, &t);
BOOST_REQUIRE(error == 0);
error = EN_stepQ(ph, &tstep);
BOOST_REQUIRE(error == 0);
} while (tstep > 0 && t < tstop);
}
~FixtureAfterStep() {
error = EN_closeQ(ph);
BOOST_REQUIRE(error == 0);
error = EN_close(ph);
EN_deleteproject(&ph);
}
std::string path_inp;
std::string path_rpt;
std::string path_out;
int error, flag;
long t, tstep, tstop;
EN_Project ph;
};