Fixes problems with EN_addnode() (#543)
See issue #542 . Also modifies unit test test_node to check that fixup works.
This commit is contained in:
committed by
Sam Hatchett
parent
5f7fd55a36
commit
344700a136
@@ -25,17 +25,21 @@ BOOST_FIXTURE_TEST_CASE(test_adddelete_node, FixtureInitClose)
|
||||
|
||||
error = EN_addnode(ph, (char *)"N2", EN_JUNCTION, &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
error = EN_addnode(ph, (char *)"N4", EN_TANK, &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
error = EN_addnode(ph, (char *)"N3", EN_RESERVOIR, &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
error = EN_addnode(ph, (char *)"N1", EN_JUNCTION, &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
|
||||
error = EN_getnodeindex(ph, (char *)"N1", &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
BOOST_REQUIRE(index == 2);
|
||||
error = EN_getnodeindex(ph, (char *)"N2", &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
error = EN_deletenode(ph, index, EN_UNCONDITIONAL);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
|
||||
error = EN_addnode(ph, (char *)"N4", EN_TANK, &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
|
||||
error = EN_getnodeindex(ph, (char *)"N4", &index);
|
||||
BOOST_REQUIRE(error == 0);
|
||||
error = EN_deletenode(ph, index, EN_UNCONDITIONAL);
|
||||
|
||||
Reference in New Issue
Block a user