handle error codes in tests

This commit is contained in:
0tkl
2023-08-02 11:55:23 +08:00
parent dc721c5ce6
commit 4ca66cc7fe
3 changed files with 9 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS Authors: see AUTHORS
Copyright: see AUTHORS Copyright: see AUTHORS
License: see LICENSE License: see LICENSE
Last Updated: 03/21/2019 Last Updated: 08/02/2023
****************************************************************************** ******************************************************************************
*/ */
@@ -27,7 +27,9 @@ BOOST_AUTO_TEST_CASE(test_categories_save)
EN_Project ph = NULL; EN_Project ph = NULL;
error = EN_createproject(&ph); error = EN_createproject(&ph);
BOOST_REQUIRE(error == 0);
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);
BOOST_REQUIRE(error == 0);
error = EN_getnodeindex(ph, (char *)"12", &Nindex); error = EN_getnodeindex(ph, (char *)"12", &Nindex);
BOOST_REQUIRE(error == 0); BOOST_REQUIRE(error == 0);

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS Authors: see AUTHORS
Copyright: see AUTHORS Copyright: see AUTHORS
License: see LICENSE License: see LICENSE
Last Updated: 06/16/2019 Last Updated: 08/02/2023
****************************************************************************** ******************************************************************************
*/ */
@@ -32,7 +32,9 @@ BOOST_AUTO_TEST_CASE(test_tank_overflow)
EN_Project ph = NULL; EN_Project ph = NULL;
error = EN_createproject(&ph); error = EN_createproject(&ph);
BOOST_REQUIRE(error == 0);
error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, ""); error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, "");
BOOST_REQUIRE(error == 0);
// Get index of the tank and its inlet/outlet pipe // Get index of the tank and its inlet/outlet pipe
error = EN_getnodeindex(ph, (char *)"2", &Nindex); error = EN_getnodeindex(ph, (char *)"2", &Nindex);

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS Authors: see AUTHORS
Copyright: see AUTHORS Copyright: see AUTHORS
License: see LICENSE License: see LICENSE
Last Updated: 07/20/2019 Last Updated: 08/02/2023
****************************************************************************** ******************************************************************************
*/ */
@@ -30,7 +30,9 @@ BOOST_AUTO_TEST_CASE(test_pda_model)
EN_Project ph = NULL; EN_Project ph = NULL;
error = EN_createproject(&ph); error = EN_createproject(&ph);
BOOST_REQUIRE(error == 0);
error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, ""); error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, "");
BOOST_REQUIRE(error == 0);
// Set Demand Multiplier to 10 to cause negative pressures // Set Demand Multiplier to 10 to cause negative pressures
error = EN_setoption(ph, EN_DEMANDMULT, 10); error = EN_setoption(ph, EN_DEMANDMULT, 10);