Reorganizing unit tests

Unit tests for the toolkit are consolidated into one test module with a separate test suite for related API functions.
This commit is contained in:
Michael Tryby
2019-03-21 13:11:10 -04:00
parent 80ce382a38
commit 5687c63548
17 changed files with 511 additions and 363 deletions

View File

@@ -1,17 +1,20 @@
// Test of ENsetlinktype EPANET API Function
#define _CRT_SECURE_NO_DEPRECATE
/*
This is a test for the API function that changes a link's type.
Two links in Net1.inp are changed: Pipe 113 is reversed with a CV added
and Pipe 121 is changed to a 100 psi PRV. After running the revised model,
at hour 0 the flow in Pipe 113 should be zero and the pressure at node 31
of the PRV 121 should be 100.
******************************************************************************
Project: OWA EPANET
Version: 2.2
Module: test_link.cpp
Description: Tests EPANET toolkit api functions
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 03/21/2019
******************************************************************************
*/
#define BOOST_TEST_MODULE "link"
#define BOOST_ALL_DYN_LINK
#include <boost/test/unit_test.hpp>
#include "shared_test.hpp"
#include "test_toolkit.hpp"
BOOST_AUTO_TEST_SUITE (test_link)
@@ -86,12 +89,8 @@ BOOST_AUTO_TEST_CASE(test_setlinktype)
EN_deleteproject(&ph);
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(setid_save_reopen)
BOOST_AUTO_TEST_CASE(test_setid_save)
BOOST_AUTO_TEST_CASE(test_link_setid_save)
{
int error = 0;
@@ -120,7 +119,7 @@ BOOST_AUTO_TEST_CASE(test_setid_save)
EN_deleteproject(&ph);
}
BOOST_AUTO_TEST_CASE(test_setid_reopen, * boost::unit_test::depends_on("setid_save_reopen/test_setid_save"))
BOOST_AUTO_TEST_CASE(test_link_setid_reopen, * boost::unit_test::depends_on("test_link/test_link_setid_save"))
{
int error = 0;
int index;