diff --git a/tests/test_demand_categories.cpp b/tests/test_demand_categories.cpp index a1eddfc..f4ee864 100644 --- a/tests/test_demand_categories.cpp +++ b/tests/test_demand_categories.cpp @@ -16,12 +16,6 @@ BOOST_AUTO_TEST_SUITE (test_demands) BOOST_AUTO_TEST_CASE(test_categories_save) { - //std::string path_inp(DATA_PATH_NET1); - //std::string inp_save = "net1_dem_cat.inp"; - //std::string path_rpt(DATA_PATH_RPT); - //std::string path_out(DATA_PATH_OUT); - - int error = 0; int Nindex, ndem; @@ -30,13 +24,13 @@ BOOST_AUTO_TEST_CASE(test_categories_save) error = EN_createproject(&ph); error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, DATA_PATH_OUT); - error = EN_getnodeindex(ph, "12", &Nindex); + error = EN_getnodeindex(ph, (char *)"12", &Nindex); BOOST_REQUIRE(error == 0); error = EN_getnumdemands(ph, Nindex, &ndem); BOOST_REQUIRE(error == 0); BOOST_CHECK(ndem == 1); - error = EN_setdemandname(ph, Nindex, ndem, "Demand category name"); + error = EN_setdemandname(ph, Nindex, ndem, (char *)"Demand category name"); BOOST_REQUIRE(error == 0); error = EN_saveinpfile(ph, "net1_dem_cat.inp"); BOOST_REQUIRE(error == 0); @@ -49,12 +43,6 @@ BOOST_AUTO_TEST_CASE(test_categories_save) BOOST_AUTO_TEST_CASE(test_categories_reopen, * boost::unit_test::depends_on("test_demands/test_categories_save")) { - //std::string inp_save = "net1_dem_cat.inp"; - //std::string path_rpt(DATA_PATH_RPT); - //std::string path_out(DATA_PATH_OUT); - - char demname[80]; - int error = 0; int Nindex, ndem; @@ -66,12 +54,13 @@ BOOST_AUTO_TEST_CASE(test_categories_reopen, * boost::unit_test::depends_on("tes error = EN_open(ph, "net1_dem_cat.inp", DATA_PATH_RPT, DATA_PATH_OUT); BOOST_REQUIRE(error == 0); - error = EN_getnodeindex(ph, "12", &Nindex); + error = EN_getnodeindex(ph, (char *)"12", &Nindex); BOOST_REQUIRE(error == 0); error = EN_getnumdemands(ph, Nindex, &ndem); BOOST_REQUIRE(error == 0); BOOST_CHECK(ndem == 1); - + + char demname[80]; error = EN_getdemandname(ph, Nindex, ndem, demname); BOOST_REQUIRE(error == 0); diff --git a/tests/test_link.cpp b/tests/test_link.cpp index 82c1b64..a712b0f 100644 --- a/tests/test_link.cpp +++ b/tests/test_link.cpp @@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(test_setid_reopen, * boost::unit_test::depends_on("setid_sa BOOST_REQUIRE(error == 0); // Check that 3rd link has its new name - error = EN_getlinkindex(ph, "Link3", &index); + error = EN_getlinkindex(ph, (char *)"Link3", &index); BOOST_REQUIRE(error == 0); BOOST_REQUIRE(index == 3); diff --git a/tests/test_node.cpp b/tests/test_node.cpp index c7351f0..21ca9df 100644 --- a/tests/test_node.cpp +++ b/tests/test_node.cpp @@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE(test_setid_reopen, * boost::unit_test::depends_on("setid_sa BOOST_REQUIRE(error == 0); // Check that 3rd node has its new name - error = EN_getnodeindex(ph, "Node3", &index); + error = EN_getnodeindex(ph, (char *)"Node3", &index); BOOST_REQUIRE(error == 0); BOOST_REQUIRE(index == 3); diff --git a/tests/test_rprtanlys.cpp b/tests/test_rprtanlys.cpp index c9a7c7c..01e452c 100644 --- a/tests/test_rprtanlys.cpp +++ b/tests/test_rprtanlys.cpp @@ -11,8 +11,6 @@ #include "shared_test.hpp" - -using namespace std; using namespace boost; @@ -24,7 +22,7 @@ BOOST_FIXTURE_TEST_CASE(test_rprt_anlysstats, FixtureOpenClose) double array[5]; std::vector test; - vector ref = {3.0, 7.0799498320679432e-06, 1.6680242187483429e-08, + std::vector ref = {3.0, 7.0799498320679432e-06, 1.6680242187483429e-08, 0.0089173150106518495, 0.99999998187144024}; error = EN_solveH(ph); @@ -53,7 +51,7 @@ BOOST_FIXTURE_TEST_CASE(test_anlys_getoption, FixtureOpenClose) double array[13]; std::vector test; - vector ref = {40.0, 0.001, 0.01, 0.5, 1.0, 0.0, 0.0, 1.0, 0.0, 75.0, 0.0, 0.0, 0.0}; + std::vector ref = {40.0, 0.001, 0.01, 0.5, 1.0, 0.0, 0.0, 1.0, 0.0, 75.0, 0.0, 0.0, 0.0}; error = EN_solveH(ph); BOOST_REQUIRE(error == 0); @@ -80,7 +78,7 @@ BOOST_FIXTURE_TEST_CASE(test_anlys_gettimeparam, FixtureOpenClose) long array[16]; std::vector test; - vector ref = {86400, 3600, 300, 7200, 0, 3600, 0, 360, 0, 25, 0, 86400, 86400, 0, 3600, 0}; + std::vector ref = {86400, 3600, 300, 7200, 0, 3600, 0, 360, 0, 25, 0, 86400, 86400, 0, 3600, 0}; error = EN_solveH(ph); BOOST_REQUIRE(error == 0);