Fixing memory problems with test_toolkit

Fixes memory leaks and some minor refactoring.
This commit is contained in:
Michael Tryby
2019-04-03 14:05:41 -04:00
parent f99d417301
commit efd86c3ddd
7 changed files with 353 additions and 338 deletions

View File

@@ -14,6 +14,9 @@
#ifndef TEST_TOOLKIT_HPP
#define TEST_TOOLKIT_HPP
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include "epanet2_2.h"
@@ -25,6 +28,9 @@
struct FixtureOpenClose{
FixtureOpenClose() {
error = 0;
ph = NULL;
EN_createproject(&ph);
error = EN_open(ph, DATA_PATH_NET1, DATA_PATH_RPT, DATA_PATH_OUT);
}
@@ -41,6 +47,9 @@ struct FixtureOpenClose{
struct FixtureAfterStep{
FixtureAfterStep() {
error = 0;
ph = NULL;
flag = 0;
tstop = 10800;