Keeping legacy api in epanet2.h epanet2.c and moving new api to epanet2_2.h epanet.c

This commit is contained in:
Michael Tryby
2018-11-29 12:51:47 -05:00
parent 333e87b026
commit b0c7714d72
13 changed files with 1375 additions and 1375 deletions

View File

@@ -14,7 +14,7 @@ A node and link name are changed, the network is saved, reopened and the new nam
#include <iostream>
#include <string>
#include "epanet2.h"
#include "epanet2_2.h"
#define DATA_PATH_INP "./net1.inp"
#define DATA_PATH_RPT "./test.rpt"
@@ -37,13 +37,13 @@ int main(int argc, char *argv[])
string path_rpt(DATA_PATH_RPT);
string path_out(DATA_PATH_OUT);
string inp_save("net1_setid.inp");
int error = 0;
int index;
EN_Project ph = NULL;
EN_createproject(&ph);
error = EN_open(ph, path_inp.c_str(), path_rpt.c_str(), "");
BOOST_REQUIRE(error == 0);
@@ -74,17 +74,17 @@ int main(int argc, char *argv[])
error = EN_close(ph);
BOOST_REQUIRE(error == 0);
EN_deleteproject(&ph);
// Re-open the saved project
EN_createproject(&ph);
error = EN_open(ph, inp_save.c_str(), path_rpt.c_str(), "");
BOOST_REQUIRE(error == 0);
// Check that 3rd node has its new name
error = EN_getnodeindex(ph, newid_2, &index);
BOOST_REQUIRE(error == 0);
BOOST_REQUIRE(index == 3);
// Check that 3rd link has its new name
error = EN_getlinkindex(ph, newid_4, &index);
BOOST_REQUIRE(error == 0);