Adding test for EN_getnodevalue
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user