Eliminating build warnings on gcc

This commit is contained in:
Michael Tryby
2019-03-19 13:50:39 -04:00
parent 29cfe43e5a
commit a566f914d4
4 changed files with 10 additions and 23 deletions

View File

@@ -16,12 +16,6 @@ BOOST_AUTO_TEST_SUITE (test_demands)
BOOST_AUTO_TEST_CASE(test_categories_save) 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 error = 0;
int Nindex, ndem; int Nindex, ndem;
@@ -30,13 +24,13 @@ BOOST_AUTO_TEST_CASE(test_categories_save)
error = EN_createproject(&ph); error = EN_createproject(&ph);
error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, DATA_PATH_OUT); 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); BOOST_REQUIRE(error == 0);
error = EN_getnumdemands(ph, Nindex, &ndem); error = EN_getnumdemands(ph, Nindex, &ndem);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
BOOST_CHECK(ndem == 1); 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); BOOST_REQUIRE(error == 0);
error = EN_saveinpfile(ph, "net1_dem_cat.inp"); error = EN_saveinpfile(ph, "net1_dem_cat.inp");
BOOST_REQUIRE(error == 0); 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")) 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 error = 0;
int Nindex, ndem; 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); error = EN_open(ph, "net1_dem_cat.inp", DATA_PATH_RPT, DATA_PATH_OUT);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
error = EN_getnodeindex(ph, "12", &Nindex); error = EN_getnodeindex(ph, (char *)"12", &Nindex);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
error = EN_getnumdemands(ph, Nindex, &ndem); error = EN_getnumdemands(ph, Nindex, &ndem);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
BOOST_CHECK(ndem == 1); BOOST_CHECK(ndem == 1);
char demname[80];
error = EN_getdemandname(ph, Nindex, ndem, demname); error = EN_getdemandname(ph, Nindex, ndem, demname);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);

View File

@@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(test_setid_reopen, * boost::unit_test::depends_on("setid_sa
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
// Check that 3rd link has its new name // 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(error == 0);
BOOST_REQUIRE(index == 3); BOOST_REQUIRE(index == 3);

View File

@@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE(test_setid_reopen, * boost::unit_test::depends_on("setid_sa
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
// Check that 3rd node has its new name // 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(error == 0);
BOOST_REQUIRE(index == 3); BOOST_REQUIRE(index == 3);

View File

@@ -11,8 +11,6 @@
#include "shared_test.hpp" #include "shared_test.hpp"
using namespace std;
using namespace boost; using namespace boost;
@@ -24,7 +22,7 @@ BOOST_FIXTURE_TEST_CASE(test_rprt_anlysstats, FixtureOpenClose)
double array[5]; double array[5];
std::vector<double> test; std::vector<double> test;
vector<double> ref = {3.0, 7.0799498320679432e-06, 1.6680242187483429e-08, std::vector<double> ref = {3.0, 7.0799498320679432e-06, 1.6680242187483429e-08,
0.0089173150106518495, 0.99999998187144024}; 0.0089173150106518495, 0.99999998187144024};
error = EN_solveH(ph); error = EN_solveH(ph);
@@ -53,7 +51,7 @@ BOOST_FIXTURE_TEST_CASE(test_anlys_getoption, FixtureOpenClose)
double array[13]; double array[13];
std::vector<double> test; std::vector<double> test;
vector<double> 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<double> 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); error = EN_solveH(ph);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);
@@ -80,7 +78,7 @@ BOOST_FIXTURE_TEST_CASE(test_anlys_gettimeparam, FixtureOpenClose)
long array[16]; long array[16];
std::vector<long> test; std::vector<long> test;
vector<long> ref = {86400, 3600, 300, 7200, 0, 3600, 0, 360, 0, 25, 0, 86400, 86400, 0, 3600, 0}; std::vector<long> ref = {86400, 3600, 300, 7200, 0, 3600, 0, 360, 0, 25, 0, 86400, 86400, 0, 3600, 0};
error = EN_solveH(ph); error = EN_solveH(ph);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);