Fixing memory problems with test_toolkit
Fixes memory leaks and some minor refactoring.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user