From efc44215f3ddf4ed3d54de69de4c3b504bc248a7 Mon Sep 17 00:00:00 2001 From: Michael Tryby Date: Thu, 16 Aug 2018 10:26:32 -0400 Subject: [PATCH] Implementing metadata support --- tests/test_output.cpp | 2 +- tools/epanet-output/include/epanet_output.h | 6 +++--- tools/epanet-output/src/epanet_output.c | 4 ++-- tools/epanet-output/src/messages.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_output.cpp b/tests/test_output.cpp index c7fdc7a..78f55ed 100644 --- a/tests/test_output.cpp +++ b/tests/test_output.cpp @@ -145,7 +145,7 @@ BOOST_FIXTURE_TEST_CASE(test_getNetSize, Fixture) BOOST_FIXTURE_TEST_CASE(test_getUnits, Fixture) { int flag; - error = ENR_getUnits(p_handle, ENR_chemUnits, &flag); + error = ENR_getUnits(p_handle, ENR_qualUnits, &flag); BOOST_REQUIRE(error == 0); BOOST_CHECK_EQUAL(flag, ENR_MGL); diff --git a/tools/epanet-output/include/epanet_output.h b/tools/epanet-output/include/epanet_output.h index 8a9b70e..93a8425 100644 --- a/tools/epanet-output/include/epanet_output.h +++ b/tools/epanet-output/include/epanet_output.h @@ -25,7 +25,7 @@ typedef enum { typedef enum { ENR_flowUnits = 1, ENR_pressUnits = 2, - ENR_chemUnits = 3 + ENR_qualUnits = 3 } ENR_Units; typedef enum { @@ -43,7 +43,7 @@ typedef enum { typedef enum { ENR_PSI = 0, - ENR_MTRS = 1, + ENR_MTR = 1, ENR_KPA = 2 } ENR_PressUnits; @@ -53,7 +53,7 @@ typedef enum { ENR_UGL = 2, ENR_HOURS = 3, ENR_PRCNT = 4 -} ENR_ChemUnits; +} ENR_QualUnits; typedef enum { ENR_reportStart = 1, diff --git a/tools/epanet-output/src/epanet_output.c b/tools/epanet-output/src/epanet_output.c index 7f21bee..741304f 100644 --- a/tools/epanet-output/src/epanet_output.c +++ b/tools/epanet-output/src/epanet_output.c @@ -327,7 +327,7 @@ int DLLEXPORT ENR_getUnits(ENR_Handle p_handle, ENR_Units code, int* unitFlag) fread(unitFlag, WORDSIZE, 1, p_data->file); break; - case ENR_chemUnits: + case ENR_qualUnits: offset = 7*WORDSIZE; _fseek(p_data->file, offset, SEEK_SET); fread(unitFlag, WORDSIZE, 1, p_data->file); @@ -846,7 +846,7 @@ void errorLookup(int errcode, char* dest_msg, int dest_len) default: msg = ERRERR; } - strncpy(dest_msg, msg, MSGMAXLEN); + strncpy(dest_msg, msg, MSG_MAXLEN); } int validateFile(ENR_Handle p_handle) diff --git a/tools/epanet-output/src/messages.h b/tools/epanet-output/src/messages.h index d2515e9..bc04a7d 100644 --- a/tools/epanet-output/src/messages.h +++ b/tools/epanet-output/src/messages.h @@ -10,7 +10,7 @@ #ifndef MESSAGES_H_ #define MESSAGES_H_ /*------------------- Error Messages --------------------*/ -#define MSGMAXLEN 53 +#define MSG_MAXLEN 53 #define WARN10 "Warning: model run issued warnings"