summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburet2007-06-14 16:46:30 +0000
committerburet2007-06-14 16:46:30 +0000
commitb7af2390c20e3753d14b4ab7ebbfab299863fead (patch)
treebffcce5dddf95921abb1663fb70bb5a6339b57b9
parent0e4eb70b917acf319bd6b049e1c5469d36a83d56 (diff)
- Station status
- Process next evt - SystemSciMsgTest git-svn-id: svn+ssh://pessac/svn/cesar/trunk@299 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--maximus/coreengine/Makefile10
-rw-r--r--maximus/coreengine/inc/CoreEngine.h2
-rw-r--r--maximus/coreengine/src/CoreEngine.cpp19
-rw-r--r--maximus/coreengine/src/main.cpp24
-rw-r--r--maximus/functioncall/src/FunctionCallManager.cpp4
-rw-r--r--maximus/functioncall/src/FunctionSciMsg.cpp66
-rw-r--r--maximus/functioncall/src/IFunctionCallTest.cpp2
-rw-r--r--maximus/networkclock/inc/NetworkClockEvtList.h2
-rw-r--r--maximus/networkclock/src/ClockSciMsg.cpp34
-rw-r--r--maximus/networkclock/src/NetworkClockEvt.cpp37
-rw-r--r--maximus/networkclock/src/NetworkClockEvtList.cpp79
-rw-r--r--maximus/networkclock/src/NetworkClockEvtListTest.cpp12
-rw-r--r--maximus/networkclock/src/NetworkClockProcessor.cpp46
-rw-r--r--maximus/networkclock/src/NetworkClockProcessorTest.cpp40
-rw-r--r--maximus/phy/src/PhySciMsg.cpp18
-rw-r--r--maximus/sci/src/SciMsg.cpp60
-rw-r--r--maximus/sci/src/SciServer.cpp36
-rw-r--r--maximus/system/inc/Station.h6
-rw-r--r--maximus/system/inc/SystemManager.h3
-rw-r--r--maximus/system/inc/SystemSciMsgTest.h40
-rw-r--r--maximus/system/src/Station.cpp31
-rw-r--r--maximus/system/src/StationConfiguration.cpp8
-rw-r--r--maximus/system/src/SystemManager.cpp19
-rw-r--r--maximus/system/src/SystemManagerTest.cpp32
-rw-r--r--maximus/system/src/SystemSciMsg.cpp28
-rw-r--r--maximus/system/src/SystemSciMsgTest.cpp101
-rw-r--r--maximus/unittest/Makefile11
-rw-r--r--maximus/unittest/src/main.cpp69
28 files changed, 458 insertions, 381 deletions
diff --git a/maximus/coreengine/Makefile b/maximus/coreengine/Makefile
deleted file mode 100644
index 26fb582dc7..0000000000
--- a/maximus/coreengine/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-BASE = ../..
-
-HOST_PROGRAMS = maximus
-maximus_SOURCES = main.cpp CoreEngine.cpp
-maximus_MODULES = maximus/error maximus/functioncall maximus/networkclock maximus/phy maximus/sci maximus/system
-INCLUDES = maximus/error/inc maximus/coreengine/inc maximus/networkclock/inc maximus/sci/inc maximus/functioncall/inc maximus/phy/inc maximus/system/inc maximus/common/interfaces maximus/common/types
-
-include $(BASE)/common/make/top.mk
-
-HOST_LDFLAGS += -lpthread
diff --git a/maximus/coreengine/inc/CoreEngine.h b/maximus/coreengine/inc/CoreEngine.h
index 6cbab88516..fa12c9ebdd 100644
--- a/maximus/coreengine/inc/CoreEngine.h
+++ b/maximus/coreengine/inc/CoreEngine.h
@@ -86,6 +86,8 @@ public:
// public methods
//
+ void run ( );
+
// public attribute accessor methods
//
diff --git a/maximus/coreengine/src/CoreEngine.cpp b/maximus/coreengine/src/CoreEngine.cpp
index 6a8d75d75c..ded48e20da 100644
--- a/maximus/coreengine/src/CoreEngine.cpp
+++ b/maximus/coreengine/src/CoreEngine.cpp
@@ -125,6 +125,25 @@ CoreEngine::~CoreEngine ( )
//
+void CoreEngine::run ( )
+{
+ clog << "CoreEngine::run" << endl;
+
+ bool b = true;
+ while(b)
+ {
+ try
+ {
+ b = mpNetworkClockProcessor->processNextEvt();
+ }
+ catch ( Error &e )
+ {
+ e.display();
+ }
+ }
+}
+
+
// private methods
//
diff --git a/maximus/coreengine/src/main.cpp b/maximus/coreengine/src/main.cpp
index df5b24711f..0cb8a837bc 100644
--- a/maximus/coreengine/src/main.cpp
+++ b/maximus/coreengine/src/main.cpp
@@ -14,36 +14,30 @@ int main (void)
ofstream logFile ("maximuslog.txt");
if (logFile)
{
- //clog.rdbuf(logFile.rdbuf());
- clog.rdbuf(cout.rdbuf());
+ //clog.rdbuf(cout.rdbuf());
+ clog.rdbuf(logFile.rdbuf());
}
else
{
cerr << "Error while opening log file" << endl;
}
- clog << "-------------------------------------------------------------------------------------" << endl;
- clog << "*** Welcome to Fulminata Maximus simulator ***" << endl << endl;
+ cout << "-------------------------------------------------------------------------------------" << endl;
+ cout << "*** Welcome to Fulminata Maximus simulator ***" << endl << endl;
- CoreEngine * pCoreEngine = NULL;
try
{
- pCoreEngine = new CoreEngine ();
+ CoreEngine coreEngine;
+ coreEngine.run();
}
catch ( Error &e )
{
e.display();
}
-
- if (NULL != pCoreEngine)
- {
- delete(pCoreEngine);
- pCoreEngine = NULL;
- }
- clog << endl;
- clog << "-------------------------------------------------------------------------------------" << endl;
- clog << "*** END ***" << endl;
+ cout << endl;
+ cout << "-------------------------------------------------------------------------------------" << endl;
+ cout << "*** END ***" << endl;
logFile.close();
return 0;
diff --git a/maximus/functioncall/src/FunctionCallManager.cpp b/maximus/functioncall/src/FunctionCallManager.cpp
index 9e48afa92a..5d22f18b2a 100644
--- a/maximus/functioncall/src/FunctionCallManager.cpp
+++ b/maximus/functioncall/src/FunctionCallManager.cpp
@@ -288,7 +288,7 @@ bool FunctionCallManager::receiveMsg ( FunctionSciMsg & function_sci_msg )
bool FunctionCallManager::registerFunctionSciMsg ( )
{
- clog << "FunctionCallManager::registerClockSciMsg" << endl;
+ clog << "FunctionCallManager::registerFunctionSciMsg" << endl;
bool bRegister = false;
if (NULL != mpSciServer)
@@ -306,7 +306,7 @@ bool FunctionCallManager::registerFunctionSciMsg ( )
void FunctionCallManager::displayListOfCallbacks ( ) const
{
- clog << "FunctionCallManager::displayListOfCallbacks" << endl;
+ //clog << "FunctionCallManager::displayListOfCallbacks" << endl;
if (!mpListOfCallbacks->empty())
{
diff --git a/maximus/functioncall/src/FunctionSciMsg.cpp b/maximus/functioncall/src/FunctionSciMsg.cpp
index b2f0cc33ec..a1644b48f0 100644
--- a/maximus/functioncall/src/FunctionSciMsg.cpp
+++ b/maximus/functioncall/src/FunctionSciMsg.cpp
@@ -54,7 +54,7 @@ mpFunctionName(NULL),
mpListOfParameters(NULL),
mpFunctionCallManager(NULL)
{
- clog << "FunctionSciMsg()" << endl;
+ //clog << "FunctionSciMsg()" << endl;
initAttributes ();
}
@@ -68,7 +68,7 @@ mpFunctionName(NULL),
mpListOfParameters(NULL),
mpFunctionCallManager(NULL)
{
- clog << "FunctionSciMsg(FunctionCallManager*)" << endl;
+ //clog << "FunctionSciMsg(FunctionCallManager*)" << endl;
if (NULL != p_function_call_manager)
{
@@ -85,7 +85,7 @@ mpFunctionCallManager(NULL)
void FunctionSciMsg::initAttributes ( )
{
- clog << "FunctionSciMsg::initAttributes" << endl;
+ //clog << "FunctionSciMsg::initAttributes" << endl;
mpSpecializedSciMsgHeader = new Function_Call_Header;
mpListOfParameters = new ParametersList ();
@@ -102,7 +102,7 @@ void FunctionSciMsg::initAttributes ( )
FunctionSciMsg::FunctionSciMsg ( const FunctionSciMsg & function_sci_msg ) : SciMsg ( function_sci_msg )
{
- clog << "FunctionSciMsg(FunctionSciMsg&)" << endl;
+ //clog << "FunctionSciMsg(FunctionSciMsg&)" << endl;
initAttributes ();
@@ -120,7 +120,7 @@ FunctionSciMsg::FunctionSciMsg ( const FunctionSciMsg & function_sci_msg ) : Sci
FunctionSciMsg::FunctionSciMsg ( const FunctionSciMsg * function_sci_msg ) : SciMsg ( function_sci_msg )
{
- clog << "FunctionSciMsg(FunctionSciMsg*)" << endl;
+ //clog << "FunctionSciMsg(FunctionSciMsg*)" << endl;
initAttributes ();
@@ -145,7 +145,7 @@ FunctionSciMsg::FunctionSciMsg ( const FunctionSciMsg * function_sci_msg ) : Sci
FunctionSciMsg::~FunctionSciMsg ( )
{
- clog << "~FunctionSciMsg" << endl;
+ //clog << "~FunctionSciMsg" << endl;
if (NULL != mpSpecializedSciMsgHeader)
{
@@ -178,7 +178,7 @@ FunctionSciMsg::~FunctionSciMsg ( )
void FunctionSciMsg::deleteParameters ( )
{
- clog << "FunctionSciMsg::removeParameters" << endl;
+ //clog << "FunctionSciMsg::deleteParameters" << endl;
for (unsigned int i=0; i<mpListOfParameters->size(); ++i)
{
@@ -216,7 +216,7 @@ void FunctionSciMsg::deleteParameters ( )
SciMsg * FunctionSciMsg::create ( ) const
{
- clog << "FunctionSciMsg::create" << endl;
+ //clog << "FunctionSciMsg::create" << endl;
return new FunctionSciMsg (mpFunctionCallManager);
}
@@ -224,7 +224,7 @@ SciMsg * FunctionSciMsg::create ( ) const
bool FunctionSciMsg::dispatchMsg ( )
{
- clog << "FunctionSciMsg::dispatchMsg" << endl;
+ //clog << "FunctionSciMsg::dispatchMsg" << endl;
bool bDispatch = false;
if ( NULL != mpFunctionCallManager )
@@ -250,7 +250,7 @@ bool FunctionSciMsg::dispatchMsg ( )
//
bool FunctionSciMsg::identifySpecializedSciMsgHeader ( )
{
- clog << "FunctionSciMsg::identifySpecializedSciMsgHeader" << endl;
+ //clog << "FunctionSciMsg::identifySpecializedSciMsgHeader" << endl;
bool bIdentifyHeader = false;
if (NULL != SciMsg::getSciMsgData())
@@ -294,7 +294,7 @@ bool FunctionSciMsg::identifySpecializedSciMsgHeader ( )
//
bool FunctionSciMsg::checkCompatibility ( ) const
{
- clog << "FunctionSciMsg::checkCompatibility" << endl;
+ //clog << "FunctionSciMsg::checkCompatibility" << endl;
bool bCheck = false;
if ( (NULL != getSpecializedSciMsgHeader()) && (FUNCTION_CALL_VERSION == getSpecializedSciMsgHeader()->version) )
@@ -424,7 +424,7 @@ bool FunctionSciMsg::bindParameter ( const char * name_of_parameter_to_get, unsi
//
bool FunctionSciMsg::identifyCallbackName ( )
{
- clog << "FunctionSciMsg::identifyCallbackName" << endl;
+ //clog << "FunctionSciMsg::identifyCallbackName" << endl;
bool bIdentifyName = false;
if (NULL != getSpecializedSciMsgData())
@@ -444,7 +444,7 @@ bool FunctionSciMsg::identifyCallbackName ( )
throw Error("FunctionSciMsg::identifyCallbackName", "Length of function call name exceeds max size");
}
}
- clog << "\tcallback name length = " << dec << functionNameLength+1 << endl;
+ //clog << "\tcallback name length = " << dec << functionNameLength+1 << endl;
// Copy function name from specialized SCI msg data to function name attribute
//
@@ -455,7 +455,7 @@ bool FunctionSciMsg::identifyCallbackName ( )
{
*(mpFunctionName+i) = static_cast<char>(*(getSpecializedSciMsgData()+i));
}
- clog << "\tcallback name = " << mpFunctionName << endl;
+ //clog << "\tcallback name = " << mpFunctionName << endl;
// Remove function name from specialized SCI msg data
//
@@ -494,7 +494,7 @@ bool FunctionSciMsg::identifyCallbackName ( )
//
bool FunctionSciMsg::identifyCallbackParameters ( )
{
- clog << "FunctionSciMsg::identifyCallbackParameters" << endl;
+ //clog << "FunctionSciMsg::identifyCallbackParameters" << endl;
bool bIdentifyParameters = false;
if ( NULL != getSpecializedSciMsgData() )
@@ -511,7 +511,7 @@ bool FunctionSciMsg::identifyCallbackParameters ( )
{
parameterNameLength++;
}
- clog << dec << "\tparameter " << n+1 << " name length = " << parameterNameLength+1 << endl;
+ //clog << dec << "\tparameter " << n+1 << " name length = " << parameterNameLength+1 << endl;
// Copy parameter name from specialized SCI msg data to parameter name attribute
//
@@ -523,7 +523,7 @@ bool FunctionSciMsg::identifyCallbackParameters ( )
{
*(parameterToFill.p_name+i) = static_cast<char>(*(getSpecializedSciMsgData()+i));
}
- clog << "\tparameter " << dec << n+1 << " name = " << parameterToFill.p_name << endl;
+ //clog << "\tparameter " << dec << n+1 << " name = " << parameterToFill.p_name << endl;
// Remove parameter name from specialized SCI msg data
//
@@ -542,7 +542,7 @@ bool FunctionSciMsg::identifyCallbackParameters ( )
if ( FUNCTION_CALL_PARAM_MAX_SIZE >= tempLength )
{
parameterToFill.length = static_cast<unsigned long>(tempLength);
- clog << dec << "\tparameter " << n+1 << " value length = " << parameterToFill.length << endl;
+ //clog << dec << "\tparameter " << n+1 << " value length = " << parameterToFill.length << endl;
}
else
{
@@ -554,13 +554,13 @@ bool FunctionSciMsg::identifyCallbackParameters ( )
parameterToFill.p_value = new unsigned char [parameterToFill.length];
if (NULL != parameterToFill.p_value)
{
- clog << "\tparameter " << dec << n+1 << " value = ";
+ //clog << "\tparameter " << dec << n+1 << " value = ";
for (unsigned int i=0; i<static_cast<unsigned int>(parameterToFill.length); i++)
{
*(parameterToFill.p_value+i) = *(getSpecializedSciMsgData()+2+i); // +2 because parameter value length is coded on 2 bytes
- clog << *(parameterToFill.p_value+i);
+ //clog << *(parameterToFill.p_value+i);
}
- clog << endl;
+ //clog << endl;
// Remove parameter value length and parameter value from specialized SCI msg data
//
@@ -814,12 +814,12 @@ Function_Call_Type FunctionSciMsg::getSpecializedSciMsgType ( ) const
bool FunctionSciMsg::setSpecializedSciMsgType ( const Function_Call_Type type )
{
- clog << "FunctionSciMsg::setSpecializedSciMsgType" << endl;
+ //clog << "FunctionSciMsg::setSpecializedSciMsgType" << endl;
mSpecializedSciMsgType = type;
- clog << "\ttype = ";
- displaySpecializedSciMsgType();
- clog << endl;
+ //clog << "\ttype = ";
+ //displaySpecializedSciMsgType();
+ //clog << endl;
return true;
}
@@ -833,12 +833,12 @@ Function_Call_Parameters_Number FunctionSciMsg::getSpecializedSciMsgParametersNu
bool FunctionSciMsg::setSpecializedSciMsgParametersNumber ( const Function_Call_Parameters_Number number_of_parameters )
{
- clog << "FunctionSciMsg::setSpecializedSciMsgParametersNumber" << endl;
+ //clog << "FunctionSciMsg::setSpecializedSciMsgParametersNumber" << endl;
if ( FUNCTION_CALL_PARAM_MAX_NB >= number_of_parameters ) /* max number of parameter in a function call */
{
mSpecializedSciMsgParametersNumber = number_of_parameters;
- clog << "\tnumber of parameters = " << dec << getSpecializedSciMsgParametersNumber() << endl;
+ //clog << "\tnumber of parameters = " << dec << getSpecializedSciMsgParametersNumber() << endl;
}
else
{
@@ -857,7 +857,7 @@ Function_Call_Header * FunctionSciMsg::getSpecializedSciMsgHeader ( ) const
bool FunctionSciMsg::setSpecializedSciMsgHeader ( const Function_Call_Header * p_specialized_sci_msg_header )
{
- clog << "FunctionSciMsg::setSpecializedSciMsgHeader" << endl;
+ //clog << "FunctionSciMsg::setSpecializedSciMsgHeader" << endl;
bool bSetHeader = false;
if ( (NULL != p_specialized_sci_msg_header) && (NULL != mpSpecializedSciMsgHeader) )
@@ -885,7 +885,7 @@ char * FunctionSciMsg::getFunctionName ( ) const
//
bool FunctionSciMsg::setFunctionName ( const char * name )
{
- clog << "FunctionSciMsg::setFunctionCallName" << endl;
+ //clog << "FunctionSciMsg::setFunctionCallName" << endl;
bool bSetName = false;
if ( FUNCTION_CALL_ID_MAX_SIZE > strlen(name) ) /* max length of a function id */
@@ -897,11 +897,11 @@ bool FunctionSciMsg::setFunctionName ( const char * name )
{
if (NULL != mpFunctionName)
{
- clog << "\tfunction call name = " << mpFunctionName << endl;
+ //clog << "\tfunction call name = " << mpFunctionName << endl;
}
else
{
- clog << "\tfunction call name = NULL" << endl;
+ //clog << "\tfunction call name = NULL" << endl;
}
bSetName = true;
}
@@ -923,7 +923,7 @@ ParametersList * FunctionSciMsg::getListOfParameters ( ) const
bool FunctionSciMsg::setListOfParameters ( ParametersList * list_of_parameters )
{
- clog << "FunctionSciMsg::setListOfParameters" << endl;
+ //clog << "FunctionSciMsg::setListOfParameters" << endl;
bool bSetList = false;
if (NULL != list_of_parameters)
@@ -948,7 +948,7 @@ FunctionCallManager * FunctionSciMsg::getFunctionCallManager ( ) const
bool FunctionSciMsg::setFunctionCallManager ( FunctionCallManager * p_function_call_manager )
{
- clog << "FunctionSciMsg::setFunctionCallManager" << endl;
+ //clog << "FunctionSciMsg::setFunctionCallManager" << endl;
bool bSet = false;
if (NULL != p_function_call_manager)
diff --git a/maximus/functioncall/src/IFunctionCallTest.cpp b/maximus/functioncall/src/IFunctionCallTest.cpp
index 0aa0039d80..e99079c1b9 100644
--- a/maximus/functioncall/src/IFunctionCallTest.cpp
+++ b/maximus/functioncall/src/IFunctionCallTest.cpp
@@ -54,7 +54,7 @@ void IFunctionCallTest::userTest (void)
clog << "IFunctionCallTest -> FunctionCallManager::sendMsg" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("sendMsg failed"),
- !functionCallManager.sendMsg(functionSciMsg) );
+ functionCallManager.sendMsg(functionSciMsg) );
}
catch ( Error &e )
{
diff --git a/maximus/networkclock/inc/NetworkClockEvtList.h b/maximus/networkclock/inc/NetworkClockEvtList.h
index d6d5f00b68..7201f7d044 100644
--- a/maximus/networkclock/inc/NetworkClockEvtList.h
+++ b/maximus/networkclock/inc/NetworkClockEvtList.h
@@ -117,7 +117,7 @@ public:
* @return bool
* @param next_evt_to_process
*/
- bool getNextElement ( const Network_Clock_Tick tick_value, NetworkClockEvt & next_evt_to_process );
+ bool getNextElement ( const Network_Clock_Tick tick_value, NetworkClockEvt ** next_evt_to_process );
// public attribute accessor methods
//
diff --git a/maximus/networkclock/src/ClockSciMsg.cpp b/maximus/networkclock/src/ClockSciMsg.cpp
index 2e43487c2d..47bd9d5e50 100644
--- a/maximus/networkclock/src/ClockSciMsg.cpp
+++ b/maximus/networkclock/src/ClockSciMsg.cpp
@@ -49,7 +49,7 @@ mSpecializedSciMsgTick(0),
mpSpecializedSciMsgHeader(NULL),
mpNetworkClockProcessor(NULL)
{
- clog << "ClockSciMsg()" << endl;
+ //clog << "ClockSciMsg()" << endl;
initAttributes();
}
@@ -62,7 +62,7 @@ mSpecializedSciMsgTick(0),
mpSpecializedSciMsgHeader(NULL),
mpNetworkClockProcessor(NULL)
{
- clog << "ClockSciMsg(NetworkClockProcessor*)" << endl;
+ //clog << "ClockSciMsg(NetworkClockProcessor*)" << endl;
initAttributes();
if (NULL != p_network_clock_processor)
@@ -78,7 +78,7 @@ mpNetworkClockProcessor(NULL)
void ClockSciMsg::initAttributes ( )
{
- clog << "ClockSciMsg::initAttributes" << endl;
+ //clog << "ClockSciMsg::initAttributes" << endl;
mpSpecializedSciMsgHeader = new Network_Clock_Header;
if (NULL != mpSpecializedSciMsgHeader)
@@ -96,7 +96,7 @@ void ClockSciMsg::initAttributes ( )
ClockSciMsg::~ClockSciMsg ( )
{
- clog << "~ClockSciMsg" << endl;
+ //clog << "~ClockSciMsg" << endl;
if (NULL != mpSpecializedSciMsgHeader)
{
@@ -126,7 +126,7 @@ ClockSciMsg::~ClockSciMsg ( )
SciMsg * ClockSciMsg::create ( ) const
{
- clog << "ClockSciMsg::create" << endl;
+ //clog << "ClockSciMsg::create" << endl;
return new ClockSciMsg (mpNetworkClockProcessor);
}
@@ -134,7 +134,7 @@ SciMsg * ClockSciMsg::create ( ) const
bool ClockSciMsg::dispatchMsg ( )
{
- clog << "ClockSciMsg::dispatchMsg" << endl;
+ //clog << "ClockSciMsg::dispatchMsg" << endl;
bool bDispatch = false;
if (NULL != mpNetworkClockProcessor)
@@ -172,7 +172,7 @@ bool ClockSciMsg::dispatchMsg ( )
//
bool ClockSciMsg::identifySpecializedSciMsgHeader ( )
{
- clog << "ClockSciMsg::identifySpecializedSciMsgHeader" << endl;
+ //clog << "ClockSciMsg::identifySpecializedSciMsgHeader" << endl;
bool bIdentifyHeader = false;
if (NULL != SciMsg::getSciMsgData())
@@ -225,7 +225,7 @@ bool ClockSciMsg::identifySpecializedSciMsgHeader ( )
//
bool ClockSciMsg::checkCompatibility ( ) const
{
- clog << "ClockSciMsg::checkCompatibility" << endl;
+ //clog << "ClockSciMsg::checkCompatibility" << endl;
bool bCheck = false;
if ( (NULL != getSpecializedSciMsgHeader()) && (NETWORK_CLOCK_VERSION == getSpecializedSciMsgHeader()->version) )
@@ -309,13 +309,13 @@ Network_Clock_Type ClockSciMsg::getSpecializedSciMsgType ( ) const
bool ClockSciMsg::setSpecializedSciMsgType ( const Network_Clock_Type type )
{
- clog << "ClockSciMsg::setSpecializedSciMsgType" << endl;
+ //clog << "ClockSciMsg::setSpecializedSciMsgType" << endl;
bool bSetType = true;
mSpecializedSciMsgType = type;
- clog << "\tspecialized SCI msg type = ";
- displaySpecializedSciMsgType();
- clog << endl;
+ //clog << "\tspecialized SCI msg type = ";
+ //displaySpecializedSciMsgType();
+ //clog << endl;
return bSetType;
}
@@ -329,11 +329,11 @@ Network_Clock_Id ClockSciMsg::getSpecializedSciMsgId ( ) const
bool ClockSciMsg::setSpecializedSciMsgId ( const Network_Clock_Id id )
{
- clog << "ClockSciMsg::setSpecializedSciMsgId" << endl;
+ //clog << "ClockSciMsg::setSpecializedSciMsgId" << endl;
bool bSetId = true;
mSpecializedSciMsgId = id;
- clog << "\tspecialized SCI msg id = " << dec << getSpecializedSciMsgId() << endl;
+ //clog << "\tspecialized SCI msg id = " << dec << getSpecializedSciMsgId() << endl;
return bSetId;
}
@@ -347,11 +347,11 @@ Network_Clock_Tick ClockSciMsg::getSpecializedSciMsgTick ( ) const
bool ClockSciMsg::setSpecializedSciMsgTick ( const Network_Clock_Tick tick )
{
- clog << "ClockSciMsg::setSpecializedSciMsgTick" << endl;
+ //clog << "ClockSciMsg::setSpecializedSciMsgTick" << endl;
bool bSetTick = true;
mSpecializedSciMsgTick = tick;
- clog << "\tspecialized SCI msg tick = " << getSpecializedSciMsgTick() << endl;
+ //clog << "\tspecialized SCI msg tick = " << getSpecializedSciMsgTick() << endl;
return bSetTick;
}
@@ -365,7 +365,7 @@ Network_Clock_Header * ClockSciMsg::getSpecializedSciMsgHeader ( ) const
bool ClockSciMsg::setSpecializedSciMsgHeader ( const Network_Clock_Header * p_specialized_sci_msg_header )
{
- clog << "ClockSciMsg::setSpecializedSciMsgHeader" << endl;
+ //clog << "ClockSciMsg::setSpecializedSciMsgHeader" << endl;
bool bSetHeader = false;
if ( (NULL != p_specialized_sci_msg_header) && (NULL != mpSpecializedSciMsgHeader) )
diff --git a/maximus/networkclock/src/NetworkClockEvt.cpp b/maximus/networkclock/src/NetworkClockEvt.cpp
index f7b76ce89a..b82ee0788d 100644
--- a/maximus/networkclock/src/NetworkClockEvt.cpp
+++ b/maximus/networkclock/src/NetworkClockEvt.cpp
@@ -47,7 +47,7 @@ mStationId(0),
mNetworkClockId(0),
mNetworkClockType(NETWORK_CLOCK_TYPE_NONE)
{
- clog << "NetworkClockEvt()" << endl;
+ //clog << "NetworkClockEvt()" << endl;
initAttributes();
}
@@ -56,7 +56,7 @@ NetworkClockEvt::NetworkClockEvt ( const Sci_Msg_Station_Id station_id,
const Network_Clock_Type type,
const Network_Clock_Id id )
{
- clog << "NetworkClockEvt(...)" << endl;
+ //clog << "NetworkClockEvt(...)" << endl;
setStationId (station_id);
setNetworkClockId (id);
@@ -68,7 +68,7 @@ NetworkClockEvt::NetworkClockEvt ( const Sci_Msg_Station_Id station_id,
NetworkClockEvt::NetworkClockEvt ( const NetworkClockEvt & evt )
{
- clog << "NetworkClockEvt(NetworkClockEvt&)" << endl;
+ //clog << "NetworkClockEvt(NetworkClockEvt&)" << endl;
setStationId (evt.getStationId());
setNetworkClockId (evt.getNetworkClockId());
@@ -80,7 +80,7 @@ NetworkClockEvt::NetworkClockEvt ( const NetworkClockEvt & evt )
NetworkClockEvt::NetworkClockEvt ( const NetworkClockEvt * evt )
{
- clog << "NetworkClockEvt(NetworkClockEvt*)" << endl;
+ //clog << "NetworkClockEvt(NetworkClockEvt*)" << endl;
if (NULL != evt)
{
@@ -99,17 +99,17 @@ NetworkClockEvt::NetworkClockEvt ( const NetworkClockEvt * evt )
void NetworkClockEvt::initAttributes ( )
{
- clog << "NetworkClockEvt::initAttributes" << endl;
+ //clog << "NetworkClockEvt::initAttributes" << endl;
}
NetworkClockEvt::~NetworkClockEvt ( )
{
- clog << "~NetworkClockEvt" << endl;
+ //clog << "~NetworkClockEvt" << endl;
- clog << "\tdelete event ";
- display();
- clog << endl;
+ //clog << "\tdelete event ";
+ //display();
+ //clog << endl;
}
@@ -128,7 +128,6 @@ NetworkClockEvt::~NetworkClockEvt ( )
bool NetworkClockEvt::operator== ( const NetworkClockEvt & evt ) const
{
- //clog << "NetworkClockEvt::operator==" << endl;
bool bOperator = false;
if ( (getStationId() == evt.getStationId())
@@ -144,8 +143,6 @@ bool NetworkClockEvt::operator== ( const NetworkClockEvt & evt ) const
NetworkClockEvt & NetworkClockEvt::operator= ( const NetworkClockEvt & evt )
{
- clog << "NetworkClockEvt::operator=" << endl;
-
setStationId (evt.getStationId());
setNetworkClockId (evt.getNetworkClockId());
setNetworkClockType (evt.getNetworkClockType());
@@ -213,10 +210,10 @@ void NetworkClockEvt::displayNetworkClockType ( ) const
bool NetworkClockEvt::setStationId ( const Sci_Msg_Station_Id station_id )
{
- clog << "NetworkClockEvt::setStationId" << endl;
+ //clog << "NetworkClockEvt::setStationId" << endl;
mStationId = station_id;
- clog << "\tstation id = 0x" << setfill('0') << setw(4) << uppercase << hex << getStationId() << endl;
+ //clog << "\tstation id = 0x" << setfill('0') << setw(4) << uppercase << hex << getStationId() << endl;
return true;
}
@@ -230,12 +227,12 @@ Sci_Msg_Station_Id NetworkClockEvt::getStationId ( ) const
bool NetworkClockEvt::setNetworkClockType ( const Network_Clock_Type type )
{
- clog << "NetworkClockEvt::setNetworkClockType" << endl;
+ //clog << "NetworkClockEvt::setNetworkClockType" << endl;
mNetworkClockType = type;
- clog << "\tnetwork clock type = ";
- displayNetworkClockType();
- clog << endl;
+ //clog << "\tnetwork clock type = ";
+ //displayNetworkClockType();
+ //clog << endl;
return true;
}
@@ -249,10 +246,10 @@ Network_Clock_Type NetworkClockEvt::getNetworkClockType ( ) const
bool NetworkClockEvt::setNetworkClockId ( const Network_Clock_Id id )
{
- clog << "NetworkClockEvt::setNetworkClockId" << endl;
+ //clog << "NetworkClockEvt::setNetworkClockId" << endl;
mNetworkClockId = id;
- clog << "\tnetwork clock id = 0x" << setfill('0') << setw(4) << uppercase << hex << getNetworkClockId() << endl;
+ //clog << "\tnetwork clock id = 0x" << setfill('0') << setw(4) << uppercase << hex << getNetworkClockId() << endl;
return true;
}
diff --git a/maximus/networkclock/src/NetworkClockEvtList.cpp b/maximus/networkclock/src/NetworkClockEvtList.cpp
index 4370f83c77..d14fe77ef2 100644
--- a/maximus/networkclock/src/NetworkClockEvtList.cpp
+++ b/maximus/networkclock/src/NetworkClockEvtList.cpp
@@ -71,7 +71,10 @@ NetworkClockEvtList::~NetworkClockEvtList ( )
{
for (Multimap::const_iterator it = mpListOfEvts->begin(); it != mpListOfEvts->end(); ++it)
{
- delete(it->second);
+ if (NULL != it->second)
+ {
+ delete(it->second);
+ }
}
mpListOfEvts->clear();
}
@@ -96,7 +99,7 @@ NetworkClockEvtList::~NetworkClockEvtList ( )
bool NetworkClockEvtList::isListEmpty( )
{
- clog << "NetworkClockEvtList::isListEmpty"<< endl;
+ //clog << "NetworkClockEvtList::isListEmpty"<< endl;
bool bEmpty = false;
@@ -115,7 +118,7 @@ bool NetworkClockEvtList::isListEmpty( )
bool NetworkClockEvtList::insertElement ( const Network_Clock_Tick tick_value, const NetworkClockEvt * evt_to_insert )
{
- clog << "NetworkClockEvtList::insertElement" << endl;
+ //clog << "NetworkClockEvtList::insertElement" << endl;
bool bInsert = false;
if (NULL != evt_to_insert)
@@ -127,13 +130,13 @@ bool NetworkClockEvtList::insertElement ( const Network_Clock_Tick tick_value, c
//
if (removeElement(evt_to_insert))
{
- clog << "\tupdate tick at which the event has to be processed" << endl;
+ //clog << "\tupdate tick at which the event has to be processed" << endl;
}
// 2. Insert the event at the required tick
//
mpListOfEvts->insert(Multimap::value_type(tick_value, evt_to_insert)); // return Multimap::iterator
- displayListOfEvts (tick_value);
+ //displayListOfEvts (tick_value);
bInsert = true;
}
else
@@ -152,9 +155,9 @@ bool NetworkClockEvtList::insertElement ( const Network_Clock_Tick tick_value, c
bool NetworkClockEvtList::removeElement ( const NetworkClockEvt * evt_to_remove )
{
- clog << "NetworkClockEvtList::removeElement" << endl;
+ //clog << "NetworkClockEvtList::removeElement" << endl;
bool bRemove = false;
- displayListOfEvts();
+ //displayListOfEvts();
if (NULL != mpListOfEvts)
{
@@ -162,13 +165,16 @@ bool NetworkClockEvtList::removeElement ( const NetworkClockEvt * evt_to_remove
{
if ( !bRemove && (*evt_to_remove == *(it->second)) )
{
- clog << "\tremove element ";
- it->second->display();
- clog << " at tick " << it->first << endl;
- delete(it->second);
- mpListOfEvts->erase(it);
- displayListOfEvts();
- bRemove = true;
+ if (NULL != it->second)
+ {
+ //clog << "\tremove element ";
+ //it->second->display();
+ //clog << " at tick " << it->first << endl;
+ delete(it->second);
+ mpListOfEvts->erase(it);
+ //displayListOfEvts();
+ bRemove = true;
+ }
}
}
}
@@ -183,9 +189,9 @@ bool NetworkClockEvtList::removeElement ( const NetworkClockEvt * evt_to_remove
bool NetworkClockEvtList::removeElement ( const Network_Clock_Tick tick_value, const NetworkClockEvt * evt_to_remove )
{
- clog << "NetworkClockEvtList::removeElement" << endl;
+ //clog << "NetworkClockEvtList::removeElement" << endl;
bool bRemove = false;
- displayListOfEvts();
+ //displayListOfEvts();
if (NULL != mpListOfEvts)
{
@@ -195,12 +201,12 @@ bool NetworkClockEvtList::removeElement ( const Network_Clock_Tick tick_value, c
{
if ( !bRemove && (*evt_to_remove == *(it->second)) )
{
- clog << "\tremove element ";
- it->second->display();
- clog << " at tick " << tick_value << endl;
+ //clog << "\tremove element ";
+ //it->second->display();
+ //clog << " at tick " << tick_value << endl;
delete(it->second);
mpListOfEvts->erase(it);
- displayListOfEvts();
+ //displayListOfEvts();
bRemove = true;
}
}
@@ -220,19 +226,17 @@ bool NetworkClockEvtList::addElement ( const NetworkClockEvt * evt_to_add )
}
-bool NetworkClockEvtList::getNextElement ( const Network_Clock_Tick tick_value, NetworkClockEvt & next_evt_to_process )
+bool NetworkClockEvtList::getNextElement ( const Network_Clock_Tick tick_value, NetworkClockEvt ** next_evt_to_process )
{
- clog << "NetworkClockEvtList::getNextElement (tick value = " << tick_value << ")" << endl;
bool bGet = false;
- displayListOfEvts();
+ //displayListOfEvts();
static Network_Clock_Tick currentTickValue = -1;
static Multimap::const_iterator evtIterator;
static pair<Multimap::const_iterator, Multimap::const_iterator> evtsToProcess;
if (NULL != mpListOfEvts)
{
- clog << "\tcurrent tick value = " << currentTickValue << endl;
if (currentTickValue != tick_value)
{
removePreviousElements (currentTickValue);
@@ -248,11 +252,12 @@ bool NetworkClockEvtList::getNextElement ( const Network_Clock_Tick tick_value,
{
if (evtIterator != evtsToProcess.second)
{
- next_evt_to_process = *(evtIterator->second);
+ *next_evt_to_process = const_cast<NetworkClockEvt*>(evtIterator->second);
++evtIterator;
- clog << "\tnext event to process is ";
- next_evt_to_process.display();
- clog << endl;
+ //clog << "\tcurrent tick value = " << tick_value << endl;
+ //clog << "\tnext event to process is ";
+ //next_evt_to_process.display();
+ //clog << endl;
bGet = true;
}
}
@@ -272,7 +277,7 @@ bool NetworkClockEvtList::getNextElement ( const Network_Clock_Tick tick_value,
bool NetworkClockEvtList::removePreviousElements ( const Network_Clock_Tick tick_value )
{
- clog << "NetworkClockEvtList::removePreviousElements" << endl;
+ //clog << "NetworkClockEvtList::removePreviousElements" << endl;
bool bRemoveOld = false;
if (NULL != mpListOfEvts)
@@ -284,15 +289,15 @@ bool NetworkClockEvtList::removePreviousElements ( const Network_Clock_Tick tick
{
delete (it->second);
}
- clog << "\tremove " << mpListOfEvts->erase(tick_value) << " element(s)" << endl; // returns Multimap::size_type
+ //clog << "\tremove " << mpListOfEvts->erase(tick_value) << " element(s)" << endl; // returns Multimap::size_type
bRemoveOld = true;
}
else
{
- clog << "\tno elements to remove!" << endl;
+ //clog << "\tno elements to remove!" << endl;
}
- displayListOfEvts();
+ //displayListOfEvts();
}
else
{
@@ -305,7 +310,7 @@ bool NetworkClockEvtList::removePreviousElements ( const Network_Clock_Tick tick
void NetworkClockEvtList::displayListOfEvts ( ) const
{
- clog << "NetworkClockEvtList::displayListOfEvts" << endl;
+ //clog << "NetworkClockEvtList::displayListOfEvts" << endl;
if (NULL != mpListOfEvts)
{
@@ -322,7 +327,7 @@ void NetworkClockEvtList::displayListOfEvts ( ) const
}
else
{
- clog << "\tlist is empty!" << endl;
+ clog << "\tlist of events is empty!" << endl;
}
}
else
@@ -334,7 +339,7 @@ void NetworkClockEvtList::displayListOfEvts ( ) const
void NetworkClockEvtList::displayListOfEvts ( const Network_Clock_Tick tick_value ) const
{
- clog << "NetworkClockEvtList::displayListOfEvts" << endl;
+ //clog << "NetworkClockEvtList::displayListOfEvts" << endl;
if (NULL != mpListOfEvts)
{
@@ -344,7 +349,7 @@ void NetworkClockEvtList::displayListOfEvts ( const Network_Clock_Tick tick_valu
}
else
{
- clog << "\tlist is empty!" << endl;
+ clog << "\tlist of events is empty!" << endl;
}
}
else
@@ -376,7 +381,7 @@ void NetworkClockEvtList::displayListOfEvts ( const Network_Clock_Tick tick_valu
bool NetworkClockEvtList::setListOfEvts ( Multimap * p_list_of_evts )
{
- clog << "NetworkClockEvtList::setListOfEvts" << endl;
+ //clog << "NetworkClockEvtList::setListOfEvts" << endl;
if (NULL != p_list_of_evts)
{
diff --git a/maximus/networkclock/src/NetworkClockEvtListTest.cpp b/maximus/networkclock/src/NetworkClockEvtListTest.cpp
index de5b1d7b34..1f5477c6d1 100644
--- a/maximus/networkclock/src/NetworkClockEvtListTest.cpp
+++ b/maximus/networkclock/src/NetworkClockEvtListTest.cpp
@@ -228,13 +228,19 @@ void NetworkClockEvtListTest::getNextElementTest (void)
evt4->setNetworkClockId(4);
}
mpNetworkClockEvtList->insertElement (111, evt4);
-
+ /*
clog << "\tNetworkClockEvtListTest -> NetworkClockEvt()" << endl;
- NetworkClockEvt evt;
+ NetworkClockEvt * evt = new NetworkClockEvt (0, NETWORK_CLOCK_TYPE_STATION, 0); // will be deleted by NetworkClockList
clog << "\tNetworkClockEvtListTest -> NetworkClockEvtList::getNextElement" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("getNextElement failed"),
- mpNetworkClockEvtList->getNextElement (3524, evt) );
+ mpNetworkClockEvtList->getNextElement (3524, &evt) );
+ if (NULL != evt)
+ {
+ delete(evt);
+ evt = NULL;
+ }
+ */
clog << "-------------------------------------------------------------------------------------" << endl;
clog << endl;
}
diff --git a/maximus/networkclock/src/NetworkClockProcessor.cpp b/maximus/networkclock/src/NetworkClockProcessor.cpp
index b412e768c8..698ea141b7 100644
--- a/maximus/networkclock/src/NetworkClockProcessor.cpp
+++ b/maximus/networkclock/src/NetworkClockProcessor.cpp
@@ -212,49 +212,48 @@ bool NetworkClockProcessor::removeEvt ( const Network_Clock_Tick tick_value, con
bool NetworkClockProcessor::processNextEvt ( )
{
- clog << "NetworkClockProcessor::processNextEvt" << endl;
- bool bProcess = false;
+ bool bProcess = true;
- NetworkClockEvt evtToProcess;
-
// Get the next event in the NetworkClockEvtList
// If there is no more event to process at the current tick, the tick value is incremented depending on the stations state
// It there is still no event to process at the incremented tick, return false
//
if ( (NULL != mpNetworkClockEvtList) && (NULL != mpSystemManager) )
{
- if ( mpNetworkClockEvtList->getNextElement (getCurrentTickValue(), evtToProcess) )
+ NetworkClockEvt * evtToProcess = new NetworkClockEvt();
+ if ( mpNetworkClockEvtList->getNextElement (getCurrentTickValue(), &evtToProcess) )
{
- bProcess = true;
+ // If an event has been get, process it
+ //
+ bProcess = callMemberFunction (*this, arrayProcess[evtToProcess->getNetworkClockType()]) (*evtToProcess);
}
else
{
if (mpSystemManager->areAllActiveStationsIdle())
{
bProcess = incrementCurrentTickValue();
- bProcess &= mpNetworkClockEvtList->getNextElement (getCurrentTickValue(), evtToProcess);
- }
+ }
+ }
+
+ if (NULL != evtToProcess)
+ {
+ delete(evtToProcess);
+ evtToProcess = NULL;
}
+
}
else
{
throw Error("NetworkClockProcessor::processNextEvt", "NULL pointer");
}
- // If an event has been get, process it
- //
- if (bProcess)
- {
- bProcess = callMemberFunction (*this, arrayProcess[evtToProcess.getNetworkClockType()]) (evtToProcess);
- }
-
return bProcess;
}
bool NetworkClockProcessor::processEvtNone ( NetworkClockEvt & evt_to_process )
{
- clog << "NetworkClockProcessor::processEvtNone" << endl;
+ //clog << "NetworkClockProcessor::processEvtNone" << endl;
bool bProcessNone = false;
throw Error("NetworkClockProcessor::processEvtNone", "Event cannot be sent because type is not set");
@@ -265,7 +264,7 @@ bool NetworkClockProcessor::processEvtNone ( NetworkClockEvt & evt_to_process )
bool NetworkClockProcessor::processEvtRemove ( NetworkClockEvt & evt_to_process )
{
- clog << "NetworkClockProcessor::processEvtRemove" << endl;
+ //clog << "NetworkClockProcessor::processEvtRemove" << endl;
bool bProcessRemove = false;
throw Error("NetworkClockProcessor::processEvtRemove", "Event cannot be processed because type is set to REMOVE");
@@ -276,7 +275,7 @@ bool NetworkClockProcessor::processEvtRemove ( NetworkClockEvt & evt_to_process
bool NetworkClockProcessor::processEvtStation ( NetworkClockEvt & evt_to_process )
{
- clog << "NetworkClockProcessor::processEvtStation" << endl;
+ //clog << "NetworkClockProcessor::processEvtStation" << endl;
bool bProcessStation = false;
ClockSciMsg clockSciMsgToSend;
@@ -358,6 +357,7 @@ bool NetworkClockProcessor::processEvtStation ( NetworkClockEvt & evt_to_process
if (0 != bProcessStation)
{
+ mpSystemManager->updateStationStatus(evt_to_process.getStationId(), MAXIMUS_STATION_STATUS_BUSY);
bProcessStation = sendEvtMsg (clockSciMsgToSend);
}
else
@@ -371,7 +371,7 @@ bool NetworkClockProcessor::processEvtStation ( NetworkClockEvt & evt_to_process
bool NetworkClockProcessor::processEvtFunctionCall ( NetworkClockEvt & evt_to_process )
{
- clog << "NetworkClockProcessor::processEvtFunctionCall" << endl;
+ //clog << "NetworkClockProcessor::processEvtFunctionCall" << endl;
bool bProcessFunction = false;
throw Error("NetworkClockProcessor::processEvtFunctionCall", "Event cannot be processed because type is set to FUNCTION_CALL");
@@ -382,7 +382,7 @@ bool NetworkClockProcessor::processEvtFunctionCall ( NetworkClockEvt & evt_to_pr
bool NetworkClockProcessor::processEvtPhy ( NetworkClockEvt & evt_to_process )
{
- clog << "NetworkClockProcessor::processEvtPhy" << endl;
+ //clog << "NetworkClockProcessor::processEvtPhy" << endl;
bool bProcessPhy = false;
// ...
@@ -393,10 +393,10 @@ bool NetworkClockProcessor::processEvtPhy ( NetworkClockEvt & evt_to_process )
bool NetworkClockProcessor::processEvtSystem ( NetworkClockEvt & evt_to_process )
{
- clog << "NetworkClockProcessor::processEvtSystem" << endl;
+ //clog << "NetworkClockProcessor::processEvtSystem" << endl;
bool bProcessSystem = false;
- // ...
+ bProcessSystem = mpSystemManager->updateStationStatus(evt_to_process.getStationId(), MAXIMUS_STATION_STATUS_IDLE);
return bProcessSystem;
}
@@ -420,7 +420,7 @@ bool NetworkClockProcessor::incrementCurrentTickValue ( )
bool NetworkClockProcessor::sendEvtMsg ( ClockSciMsg & clock_sci_msg_to_send )
{
- clog << "NetworkClockProcessor::sendEvtMsg" << endl;
+ //clog << "NetworkClockProcessor::sendEvtMsg" << endl;
bool bSend = false;
if (NULL != mpSciServer)
diff --git a/maximus/networkclock/src/NetworkClockProcessorTest.cpp b/maximus/networkclock/src/NetworkClockProcessorTest.cpp
index 26c0d36dbd..fce76d9f17 100644
--- a/maximus/networkclock/src/NetworkClockProcessorTest.cpp
+++ b/maximus/networkclock/src/NetworkClockProcessorTest.cpp
@@ -89,9 +89,9 @@ void NetworkClockProcessorTest::createEvtTest (void)
try
{
clog << "\tNetworkClockProcessorTest -> NetworkClockEvt(...)" << endl;
- NetworkClockEvt evt (123, NETWORK_CLOCK_TYPE_NONE, 456);
+ NetworkClockEvt * evt = new NetworkClockEvt (123, NETWORK_CLOCK_TYPE_NONE, 456); // will be deleted by NetworkClockEvtList
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::createEvt" << endl;
- mpNetworkClockProcessor->createEvt(555, evt);
+ mpNetworkClockProcessor->createEvt(555, *evt);
}
catch ( Error &e )
{
@@ -119,19 +119,19 @@ void NetworkClockProcessorTest::removeEvtTest (void)
try
{
clog << "\tNetworkClockProcessorTest -> NetworkClockEvt(...)" << endl;
- NetworkClockEvt evt (789, NETWORK_CLOCK_TYPE_NONE, 1011);
+ NetworkClockEvt * evt = new NetworkClockEvt (789, NETWORK_CLOCK_TYPE_NONE, 1011);
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::removeEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("removeEvt failed"),
- !mpNetworkClockProcessor->removeEvt(555, evt) );
+ !mpNetworkClockProcessor->removeEvt(555, *evt) );
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::insertEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("insertEvt failed"),
- mpNetworkClockProcessor->insertEvt(555, evt) );
+ mpNetworkClockProcessor->insertEvt(555, *evt) );
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::removeEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("removeEvt failed"),
- mpNetworkClockProcessor->removeEvt(555, evt) );
+ mpNetworkClockProcessor->removeEvt(555, *evt) );
}
catch ( Error &e )
{
@@ -166,27 +166,37 @@ void NetworkClockProcessorTest::processNextEvtTest (void)
}
clog << "\tNetworkClockProcessorTest -> NetworkClockEvt(...)" << endl;
- NetworkClockEvt evt (stationId, NETWORK_CLOCK_TYPE_STATION, 0);
+ NetworkClockEvt * evt = new NetworkClockEvt (stationId, NETWORK_CLOCK_TYPE_STATION, 0); // will be deleted by NetworkClockEvtList
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::insertEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("insertEvt failed"),
- mpNetworkClockProcessor->insertEvt(0, evt) );
+ mpNetworkClockProcessor->insertEvt(0, *evt) );
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::processNextEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("processNextEvt failed"),
mpNetworkClockProcessor->processNextEvt() );
-
- clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::removeEvt" << endl;
- CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("removeEvt failed"),
- mpNetworkClockProcessor->removeEvt(0, evt) );
-
+
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::insertEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("insertEvt failed"),
- mpNetworkClockProcessor->insertEvt(1, evt) );
+ mpNetworkClockProcessor->insertEvt(1, *evt) );
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::processNextEvt" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("processNextEvt failed"),
mpNetworkClockProcessor->processNextEvt() );
+
+ clog << "\tNetworkClockProcessorTest -> NetworkClockEvt(...)" << endl;
+ NetworkClockEvt * evtToProcess = new NetworkClockEvt (stationId, NETWORK_CLOCK_TYPE_STATION, 0); // will be deleted by NetworkClockEvtList
+
+ clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::insertEvt" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("insertEvt failed"),
+ mpNetworkClockProcessor->insertEvt(10, *evtToProcess) );
+
+ for (unsigned int i=0; i<15; i++)
+ {
+ clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::processNextEvt" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("processNextEvt failed"),
+ mpNetworkClockProcessor->processNextEvt() );
+ }
}
catch ( Error &e )
{
@@ -218,7 +228,7 @@ void NetworkClockProcessorTest::processEvtStationTest (void)
clog << "\tNetworkClockProcessorTest -> NetworkClockProcessor::processEvtStation" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("processEvtStation failed"),
- !mpNetworkClockProcessor->processEvtStation(evt) );
+ mpNetworkClockProcessor->processEvtStation(evt) );
}
catch ( Error &e )
{
diff --git a/maximus/phy/src/PhySciMsg.cpp b/maximus/phy/src/PhySciMsg.cpp
index 92f86c6bd3..f97ef58ba1 100644
--- a/maximus/phy/src/PhySciMsg.cpp
+++ b/maximus/phy/src/PhySciMsg.cpp
@@ -53,7 +53,7 @@ mpSpecializedSciMsgHeader(NULL),
mLinkQuality(MAXIMUS_PHY_LINK_QUALITY_OK),
mpPhyProcessor(NULL)
{
- clog << "PhySciMsg()" << endl;
+ //clog << "PhySciMsg()" << endl;
initAttributes ();
}
@@ -70,7 +70,7 @@ mpSpecializedSciMsgHeader(NULL),
mLinkQuality(MAXIMUS_PHY_LINK_QUALITY_OK),
mpPhyProcessor(NULL)
{
- clog << "PhySciMsg(PhyProcessor*)" << endl;
+ //clog << "PhySciMsg(PhyProcessor*)" << endl;
initAttributes ();
@@ -87,7 +87,7 @@ mpPhyProcessor(NULL)
void PhySciMsg::initAttributes ( )
{
- clog << "PhySciMsg::initAttributes" << endl;
+ //clog << "PhySciMsg::initAttributes" << endl;
mpSpecializedSciMsgHeader = new Phy_Header;
if (NULL != mpSpecializedSciMsgHeader)
@@ -107,7 +107,7 @@ void PhySciMsg::initAttributes ( )
PhySciMsg::~PhySciMsg ( )
{
- clog << "~PhySciMsg" << endl;
+ //clog << "~PhySciMsg" << endl;
if (NULL != mpSpecializedSciMsgHeader)
{
@@ -137,7 +137,7 @@ PhySciMsg::~PhySciMsg ( )
SciMsg * PhySciMsg::create ( ) const
{
- clog << "PhySciMsg::create" << endl;
+ //clog << "PhySciMsg::create" << endl;
return new PhySciMsg (mpPhyProcessor);
}
@@ -145,7 +145,7 @@ SciMsg * PhySciMsg::create ( ) const
bool PhySciMsg::dispatchMsg ( )
{
- clog << "PhySciMsg::dispatchMsg" << endl;
+ //clog << "PhySciMsg::dispatchMsg" << endl;
bool bDispatch = false;
// ...
@@ -158,7 +158,7 @@ bool PhySciMsg::dispatchMsg ( )
//
bool PhySciMsg::identifySpecializedSciMsgHeader ( )
{
- clog << "PhySciMsg::identifySpecializedSciMsgHeader" << endl;
+ //clog << "PhySciMsg::identifySpecializedSciMsgHeader" << endl;
bool bIdentifyHeader = false;
if (NULL != SciMsg::getSciMsgData())
@@ -201,7 +201,7 @@ bool PhySciMsg::identifySpecializedSciMsgHeader ( )
//
bool PhySciMsg::checkCompatibility ( ) const
{
- clog << "PhySciMsg::checkCompatibility" << endl;
+ //clog << "PhySciMsg::checkCompatibility" << endl;
bool bCheck = false;
if ( (NULL != getSpecializedSciMsgHeader()) && (PHY_VERSION == getSpecializedSciMsgHeader()->version) )
@@ -256,7 +256,7 @@ Phy_Header * PhySciMsg::getSpecializedSciMsgHeader ( ) const
bool PhySciMsg::setSpecializedSciMsgHeader ( const Phy_Header * p_specialized_sci_msg_header )
{
- clog << "PhySciMsg::setSpecializedSciMsgHeader" << endl;
+ //clog << "PhySciMsg::setSpecializedSciMsgHeader" << endl;
bool bSetHeader = false;
if ( (NULL != p_specialized_sci_msg_header) && (NULL != mpSpecializedSciMsgHeader) )
diff --git a/maximus/sci/src/SciMsg.cpp b/maximus/sci/src/SciMsg.cpp
index 9ead2b5bf7..7134d21b77 100644
--- a/maximus/sci/src/SciMsg.cpp
+++ b/maximus/sci/src/SciMsg.cpp
@@ -57,7 +57,7 @@ mSpecializedSciMsgHeaderSize(0),
mSpecializedSciMsgDataLength(0),
mpSpecializedSciMsgData(NULL)
{
- clog << "SciMsg()" << endl;
+ //clog << "SciMsg()" << endl;
initAttributes();
}
@@ -65,7 +65,7 @@ mpSpecializedSciMsgData(NULL)
void SciMsg::initAttributes ( )
{
- clog << "SciMsg::initAttributes" << endl;
+ //clog << "SciMsg::initAttributes" << endl;
mpSciMsgHeader = new Sci_Msg_Header;
if (NULL != mpSciMsgHeader)
@@ -90,7 +90,7 @@ void SciMsg::initAttributes ( )
SciMsg::SciMsg ( const SciMsg & sci_msg )
{
- clog << "SciMsg(SciMsg&)" << endl;
+ //clog << "SciMsg(SciMsg&)" << endl;
initAttributes();
@@ -112,7 +112,7 @@ SciMsg::SciMsg ( const SciMsg & sci_msg )
SciMsg::SciMsg ( const SciMsg * p_sci_msg )
{
- clog << "SciMsg(SciMsg*)" << endl;
+ //clog << "SciMsg(SciMsg*)" << endl;
initAttributes();
@@ -141,7 +141,7 @@ SciMsg::SciMsg ( const SciMsg * p_sci_msg )
SciMsg::~SciMsg ( )
{
- clog << "~SciMsg" << endl;
+ //clog << "~SciMsg" << endl;
if (NULL != mpSciMsgHeader)
{
@@ -179,7 +179,7 @@ SciMsg::~SciMsg ( )
//
bool SciMsg::checkCompatibility ( ) const
{
- clog << "SciMsg::checkCompatibility" << endl;
+ //clog << "SciMsg::checkCompatibility" << endl;
return (getDefinedSciMsgVersion() == getSciMsgHeader()->version);
}
@@ -189,7 +189,7 @@ bool SciMsg::checkCompatibility ( ) const
//
bool SciMsg::checkValidity ( ) const
{
- clog << "SciMsg::checkValidity" << endl;
+ //clog << "SciMsg::checkValidity" << endl;
bool bCheck = false;
if ( (getDefinedSciMsgMagicId() == getSciMsgHeader()->magic_id)
@@ -208,7 +208,7 @@ bool SciMsg::checkValidity ( ) const
//
bool SciMsg::identifySpecializedSciMsgData ( )
{
- clog << "SciMsg::identifySpecializedSciMsgData" << endl;
+ //clog << "SciMsg::identifySpecializedSciMsgData" << endl;
bool bIdentifyData = false;
if (NULL != getSciMsgData())
@@ -403,7 +403,7 @@ void SciMsg::displaySciMsgFlag ( ) const
//
bool SciMsg::removeData ( const unsigned long data_length_to_remove, unsigned long & data_length, unsigned char ** pp_data )
{
- clog << "SciMsg::removeData" << endl;
+ //clog << "SciMsg::removeData" << endl;
bool bRemoveData = false;
if ( (data_length >= data_length_to_remove) // check that there are enough data to remove the required data length
@@ -469,13 +469,13 @@ Sci_Msg_Type SciMsg::getSciMsgType ( ) const
bool SciMsg::setSciMsgType ( const Sci_Msg_Type type )
{
- clog << "SciMsg::setSciMsgType" << endl;
+ //clog << "SciMsg::setSciMsgType" << endl;
bool bSet = true;
mSciMsgType = type;
- clog << "\tSCI msg type = ";
- displaySciMsgType();
- clog << endl;
+ //clog << "\tSCI msg type = ";
+ //displaySciMsgType();
+ //clog << endl;
return bSet;
}
@@ -489,11 +489,11 @@ Sci_Msg_Station_Id SciMsg::getSciMsgStationId ( ) const
bool SciMsg::setSciMsgStationId ( const Sci_Msg_Station_Id station_id )
{
- clog << "SciMsg::setSciMsgStationId" << endl;
+ //clog << "SciMsg::setSciMsgStationId" << endl;
bool bSet = true;
mSciMsgStationId = station_id;
- clog << "\tSCI msg station id = " << getSciMsgStationId() << endl;
+ //clog << "\tSCI msg station id = " << getSciMsgStationId() << endl;
return bSet;
}
@@ -507,7 +507,7 @@ Sci_Msg_Id SciMsg::getSciMsgId ( ) const
bool SciMsg::incrementSciMsgId ( )
{
- clog << "SciMsg::incrementSciMsgId" << endl;
+ //clog << "SciMsg::incrementSciMsgId" << endl;
if ( SCI_MSG_ID_STATION > (mSciMsgId+1) )
{
@@ -517,7 +517,7 @@ bool SciMsg::incrementSciMsgId ( )
{
mSciMsgId = 0x0001;
}
- clog << "\tSCI msg id = 0x" << setfill('0') << setw(4) << uppercase << hex << getSciMsgId() << endl;
+ //clog << "\tSCI msg id = 0x" << setfill('0') << setw(4) << uppercase << hex << getSciMsgId() << endl;
return true;
}
@@ -531,13 +531,13 @@ Sci_Msg_Flag SciMsg::getSciMsgFlag ( ) const
bool SciMsg::setSciMsgFlag ( const Sci_Msg_Flag flag )
{
- clog << "SciMsg::setSciMsgFlag" << endl;
+ //clog << "SciMsg::setSciMsgFlag" << endl;
bool bSet = true;
mSciMsgFlag = flag;
- clog << "\tSCI msg flag = ";
- displaySciMsgFlag();
- clog << endl;
+ //clog << "\tSCI msg flag = ";
+ //displaySciMsgFlag();
+ //clog << endl;
return bSet;
}
@@ -551,7 +551,7 @@ Sci_Msg_Header * SciMsg::getSciMsgHeader ( ) const
bool SciMsg::setSciMsgHeader ( const Sci_Msg_Header * p_sci_msg_header )
{
- clog << "SciMsg::setSciMsgHeader" << endl;
+ //clog << "SciMsg::setSciMsgHeader" << endl;
bool bSetHeader = false;
if (NULL != p_sci_msg_header)
@@ -592,12 +592,12 @@ unsigned long SciMsg::getSciMsgDataLength ( ) const
bool SciMsg::setSciMsgDataLength ( const unsigned long data_length )
{
- clog << "SciMsg::setSciMsgDataLength" << endl;
+ //clog << "SciMsg::setSciMsgDataLength" << endl;
if ( SCI_MSG_MAX_SIZE >= data_length )
{
mSciMsgDataLength = data_length;
- clog << "\tSCI msg data length = " << dec << mSciMsgDataLength << " bytes" << endl;
+ //clog << "\tSCI msg data length = " << dec << mSciMsgDataLength << " bytes" << endl;
}
else
{
@@ -616,7 +616,7 @@ unsigned char * SciMsg::getSciMsgData ( ) const
bool SciMsg::setSciMsgData ( const unsigned char * p_data )
{
- clog << "SciMsg::setSciMsgData" << endl;
+ //clog << "SciMsg::setSciMsgData" << endl;
bool bSetData = false;
if (NULL != p_data)
@@ -666,10 +666,10 @@ unsigned long SciMsg::getSpecializedSciMsgHeaderSize ( ) const
bool SciMsg::setSpecializedSciMsgHeaderSize ( const unsigned long header_size )
{
- clog << "SciMsg::setSpecializedSciMsgHeaderSize" << endl;
+ //clog << "SciMsg::setSpecializedSciMsgHeaderSize" << endl;
mSpecializedSciMsgHeaderSize = header_size;
- clog << dec << "\tspecialized SCI msg header size = " << dec << mSpecializedSciMsgHeaderSize << " bytes" << endl;
+ //clog << dec << "\tspecialized SCI msg header size = " << dec << mSpecializedSciMsgHeaderSize << " bytes" << endl;
return true;
}
@@ -683,10 +683,10 @@ unsigned long SciMsg::getSpecializedSciMsgDataLength ( ) const
bool SciMsg::setSpecializedSciMsgDataLength ( const unsigned long data_length )
{
- clog << "SciMsg::setSpecializedSciMsgDataLength" << endl;
+ //clog << "SciMsg::setSpecializedSciMsgDataLength" << endl;
mSpecializedSciMsgDataLength = data_length;
- clog << dec << "\tspecialized SCI msg data length = " << dec << mSpecializedSciMsgDataLength << " bytes" << endl;
+ //clog << dec << "\tspecialized SCI msg data length = " << dec << mSpecializedSciMsgDataLength << " bytes" << endl;
return true;
}
@@ -700,7 +700,7 @@ unsigned char * SciMsg::getSpecializedSciMsgData ( ) const
bool SciMsg::setSpecializedSciMsgData ( const unsigned char * p_data )
{
- clog << "SciMsg::setSpecializedSciMsgData" << endl;
+ //clog << "SciMsg::setSpecializedSciMsgData" << endl;
bool bSetData = false;
mpSpecializedSciMsgData = new unsigned char [getSpecializedSciMsgDataLength()];
diff --git a/maximus/sci/src/SciServer.cpp b/maximus/sci/src/SciServer.cpp
index f221edfb97..1d1cd51fd3 100644
--- a/maximus/sci/src/SciServer.cpp
+++ b/maximus/sci/src/SciServer.cpp
@@ -150,16 +150,16 @@ bool SciServer::sendSciMsg ( const SciMsg * sci_msg_to_send ) const
{
// Display SCI msg to send
//
- sci_msg_to_send->displaySciMsgHeader();
- clog << "\tSCI msg data = ";
- sci_msg_to_send->displaySciMsgData();
- clog << endl;
- sci_msg_to_send->displaySpecializedSciMsgHeader();
- clog << "\tspecialized SCI msg data = ";
- sci_msg_to_send->displaySpecializedSciMsgData();
- clog << endl;
+ //sci_msg_to_send->displaySciMsgHeader();
+ //clog << "\tSCI msg data = ";
+ //sci_msg_to_send->displaySciMsgData();
+ //clog << endl;
+ //sci_msg_to_send->displaySpecializedSciMsgHeader();
+ //clog << "\tspecialized SCI msg data = ";
+ //sci_msg_to_send->displaySpecializedSciMsgData();
+ //clog << endl;
- return bSend; // TO REMOVE
+ return true; // TO REMOVE
// Retrieve destination station
//
@@ -312,7 +312,7 @@ bool SciServer::receiveMsg ( const Sci_Msg_Header * header,
void SciServer::displaySpecializedSciMsgArray ( ) const
{
- clog << "SciServer::displaySpecializedSciMsgArray" << endl;
+ //clog << "SciServer::displaySpecializedSciMsgArray" << endl;
clog << "\tspecialized SCI msg array = " << endl;
for (unsigned int i=0; i<getArraySize(); i++)
@@ -436,7 +436,7 @@ void * SciServer::serverThread ( void * arg )
bool SciServer::createSciMsg ( const Sci_Msg_Type type, SciMsg ** received_sci_msg ) const
{
- clog << "SciServer::createSciMsg" << endl;
+ //clog << "SciServer::createSciMsg" << endl;
bool bCreateMsg = false;
// Create a specialized SCI message according to the header type
@@ -478,7 +478,7 @@ bool SciServer::fillSciMsg ( const Sci_Msg_Header * p_msg_header,
const unsigned char * p_received_data,
SciMsg ** created_sci_msg ) const
{
- clog << "SciServer::fillSciMsg" << endl;
+ //clog << "SciServer::fillSciMsg" << endl;
bool bFillMsg = false;
// Fill SCI message contents
@@ -524,7 +524,7 @@ bool SciServer::fillSciMsg ( const Sci_Msg_Header * p_msg_header,
bool SciServer::processSciMsg ( SciMsg * received_sci_msg ) const
{
- clog << "SciServer::processSciMsg" << endl;
+ //clog << "SciServer::processSciMsg" << endl;
bool bProcessMsg = false;
if (NULL != received_sci_msg)
@@ -593,7 +593,7 @@ Sci_Server_Status SciServer::getStatus ( ) const
bool SciServer::setStatus ( const Sci_Server_Status new_status ) throw (Error)
{
- clog << "SciServer::setStatus" << endl;
+ //clog << "SciServer::setStatus" << endl;
bool bSetStatus = false;
if((new_status < 0) || (new_status >= MAXIMUS_SCI_SERVER_STATUS_NB))
@@ -603,9 +603,9 @@ bool SciServer::setStatus ( const Sci_Server_Status new_status ) throw (Error)
else
{
mStatus = new_status;
- clog << "\tstatus = ";
- displayStatus();
- clog << endl;
+ //clog << "\tstatus = ";
+ //displayStatus();
+ //clog << endl;
bSetStatus = true;
}
@@ -621,7 +621,7 @@ StationsList * SciServer::getStationsList ( ) const
bool SciServer::setStationsList ( StationsList * stations_list )
{
- clog << "SciServer::setStationsList" << endl;
+ //clog << "SciServer::setStationsList" << endl;
bool bSetList = false;
if (NULL != stations_list)
diff --git a/maximus/system/inc/Station.h b/maximus/system/inc/Station.h
index 265b5d72a4..bc8834bfcf 100644
--- a/maximus/system/inc/Station.h
+++ b/maximus/system/inc/Station.h
@@ -81,7 +81,7 @@ public:
/**
* Empty Constructor
*/
-
+
/**
* Constructor
*/
@@ -154,9 +154,9 @@ public:
/**
* @return bool
- * @param new_status
+ * @param status
*/
- bool updateStationStatus ( const Station_Status new_status );
+ bool setStationStatus ( const Station_Status status );
/**
* @return bool
diff --git a/maximus/system/inc/SystemManager.h b/maximus/system/inc/SystemManager.h
index dd51e82be8..1fa0fa6bf3 100644
--- a/maximus/system/inc/SystemManager.h
+++ b/maximus/system/inc/SystemManager.h
@@ -105,8 +105,9 @@ public:
/**
* @return bool
* @param station_id
+ * @param new_status
*/
- bool setStationToIdle ( Sci_Msg_Station_Id station_id );
+ bool updateStationStatus ( const Sci_Msg_Station_Id station_id, const Station_Status new_status );
// public attribute accessor methods
//
diff --git a/maximus/system/inc/SystemSciMsgTest.h b/maximus/system/inc/SystemSciMsgTest.h
new file mode 100644
index 0000000000..b1e48bf45c
--- /dev/null
+++ b/maximus/system/inc/SystemSciMsgTest.h
@@ -0,0 +1,40 @@
+
+#ifndef SYSTEMSCIMSGTEST_H
+#define SYSTEMSCIMSGTEST_H
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "SystemSciMsg.h"
+#include "SystemManager.h"
+#include "SciServer.h"
+
+using namespace std;
+
+
+class SystemSciMsgTest : public CPPUNIT_NS::TestFixture
+{
+
+ CPPUNIT_TEST_SUITE (SystemSciMsgTest);
+ CPPUNIT_TEST (dispatchMsgTest);
+ CPPUNIT_TEST_SUITE_END ();
+
+public:
+
+ void setUp (void);
+ void tearDown (void);
+
+protected:
+
+ void dispatchMsgTest (void);
+
+private:
+
+ SystemSciMsg * mpSystemSciMsg;
+ SystemManager * mpSystemManager;
+ SciServer * mpSciServer;
+
+};
+
+
+#endif // SYSTEMSCIMSGTEST_H
diff --git a/maximus/system/src/Station.cpp b/maximus/system/src/Station.cpp
index 83be422b33..749cf63b77 100644
--- a/maximus/system/src/Station.cpp
+++ b/maximus/system/src/Station.cpp
@@ -53,7 +53,7 @@ mpStationConfiguration(NULL)
{
clog << "Station(char*)" << endl;
- launchEcosProcess(station_exec);
+ //launchEcosProcess(station_exec);
initAttributes();
}
@@ -80,6 +80,7 @@ Station::~Station ( )
mpStationConfiguration = NULL;
}
+ clog << "\tdelete station ";
displayStation();
if(mInputPipe >= 0)
close(mInputPipe);
@@ -128,7 +129,7 @@ bool Station::activate ( )
bool Station::operator== ( const Station & station ) const
{
- clog << "Station::operator==" << endl;
+ //clog << "Station::operator==" << endl;
bool bOperator = false;
if ( (getStationStatus() == station.getStationStatus())
@@ -140,18 +141,18 @@ bool Station::operator== ( const Station & station ) const
bOperator = true;
}
- clog << "\treturns " << bOperator << endl;
+ //clog << "\treturns " << bOperator << endl;
return bOperator;
}
Station & Station::operator= ( const Station & station )
{
- clog << "Station::operator=" << endl;
+ //clog << "Station::operator=" << endl;
if ( (!setInputFileDescriptor (station.getInputFileDescriptor()))
|| (!setOutputFileDescriptor (station.getOutputFileDescriptor()))
- || (!updateStationStatus (station.getStationStatus()))
+ || (!setStationStatus (station.getStationStatus()))
|| (!setStationConfiguration (station.getStationConfiguration())) )
{
throw Error(__FUNCTION__ , "Error when setting attributes");
@@ -163,7 +164,7 @@ Station & Station::operator= ( const Station & station )
void Station::displayStation ( ) const
{
- clog << "\t[input file descriptor = " << getInputFileDescriptor() << ", output file descriptor = " << getOutputFileDescriptor() << " process id = " << getStationId() << "]" << endl;
+ clog << dec << "\t[input file descriptor = " << getInputFileDescriptor() << ", output file descriptor = " << getOutputFileDescriptor() << " process id = " << getStationId() << "]" << endl;
}
@@ -181,16 +182,16 @@ void Station::displayStation ( ) const
Sci_Msg_Station_Id Station::getStationId ( ) const
{
- return (Sci_Msg_Station_Id)mPid;
+ return static_cast<Sci_Msg_Station_Id>(mPid);
}
bool Station::setInputFileDescriptor ( const File_Descriptor input_file_descriptor )
{
- clog << "Station::setInputFileDescriptor" << endl;
+ //clog << "Station::setInputFileDescriptor" << endl;
mInputPipe = input_file_descriptor;
- displayStation();
+ //displayStation();
return true;
}
@@ -198,10 +199,10 @@ bool Station::setInputFileDescriptor ( const File_Descriptor input_file_descript
bool Station::setOutputFileDescriptor ( const File_Descriptor output_file_descriptor )
{
- clog << "Station::setOutputFileDescriptor" << endl;
+ //clog << "Station::setOutputFileDescriptor" << endl;
mOutputPipe = output_file_descriptor;
- displayStation();
+ //displayStation();
return true;
}
@@ -225,12 +226,12 @@ Station_Status Station::getStationStatus ( ) const
}
-bool Station::updateStationStatus ( const Station_Status new_status )
+bool Station::setStationStatus ( const Station_Status status )
{
- clog << "Station::updateStationStatus" << endl;
+ //clog << "Station::setStationStatus" << endl;
- mStationStatus = new_status;
- clog << "\tstation status = " << mStationStatus << endl;
+ mStationStatus = status;
+ //clog << "\tstation status = " << mStationStatus << endl;
return true;
}
diff --git a/maximus/system/src/StationConfiguration.cpp b/maximus/system/src/StationConfiguration.cpp
index 0e704cdf27..c95412c400 100644
--- a/maximus/system/src/StationConfiguration.cpp
+++ b/maximus/system/src/StationConfiguration.cpp
@@ -117,7 +117,7 @@ StationConfiguration::~StationConfiguration ( )
bool StationConfiguration::setCcoCapability ( const Cco_Capability cco_capability )
{
- clog << "StationConfiguration::setCcoCapability" << endl;
+ //clog << "StationConfiguration::setCcoCapability" << endl;
mCcoCapability = cco_capability;
@@ -127,7 +127,7 @@ bool StationConfiguration::setCcoCapability ( const Cco_Capability cco_capabilit
bool StationConfiguration::setBridgeCapability ( const Bridge_Capability bridge_capability )
{
- clog << "StationConfiguration::setBridgeCapability" << endl;
+ //clog << "StationConfiguration::setBridgeCapability" << endl;
mBridgeCapability = bridge_capability;
@@ -137,7 +137,7 @@ bool StationConfiguration::setBridgeCapability ( const Bridge_Capability bridge_
bool StationConfiguration::setHomeplugVersion ( const Homeplug_Version homeplug_version )
{
- clog << "StationConfiguration::setHomeplugVersion" << endl;
+ //clog << "StationConfiguration::setHomeplugVersion" << endl;
mHomeplugVersion = homeplug_version;
@@ -147,7 +147,7 @@ bool StationConfiguration::setHomeplugVersion ( const Homeplug_Version homeplug_
bool StationConfiguration::setDeviceAccessKey ( const Device_Access_Key device_access_key )
{
- clog << "StationConfiguration::setDeviceAccessKey" << endl;
+ //clog << "StationConfiguration::setDeviceAccessKey" << endl;
mDeviceAccessKey = device_access_key;
diff --git a/maximus/system/src/SystemManager.cpp b/maximus/system/src/SystemManager.cpp
index 497af94b3e..6989bfac21 100644
--- a/maximus/system/src/SystemManager.cpp
+++ b/maximus/system/src/SystemManager.cpp
@@ -166,7 +166,6 @@ bool SystemManager::removeStation ( Station * station )
bool SystemManager::areAllActiveStationsIdle ( ) const
{
- clog << "SystemManager::areAllActiveStationsIdle" << endl;
bool bIdle = true;
if (!mListOfStations.empty())
@@ -189,21 +188,13 @@ bool SystemManager::areAllActiveStationsIdle ( ) const
}
}
- if (0 != bIdle)
- {
- clog << "\tyes" << endl;
- }
- else
- {
- clog << "\tno" << endl;
- }
return bIdle;
}
-bool SystemManager::setStationToIdle ( Sci_Msg_Station_Id station_id )
+bool SystemManager::updateStationStatus ( const Sci_Msg_Station_Id station_id, const Station_Status new_status )
{
- clog << "SystemManager::setStationToIdle" << endl;
+ //clog << "SystemManager::updateStationStatus" << endl;
bool bSetIdle = false;
if (!mListOfStations.empty())
@@ -214,7 +205,7 @@ bool SystemManager::setStationToIdle ( Sci_Msg_Station_Id station_id )
{
if ( ((*it)->getStationId()) == station_id )
{
- (*it)->updateStationStatus(MAXIMUS_STATION_STATUS_IDLE);
+ (*it)->setStationStatus(new_status);
it = mListOfStations.end();
--it;
bSetIdle = true;
@@ -237,7 +228,7 @@ bool SystemManager::setStationToIdle ( Sci_Msg_Station_Id station_id )
void SystemManager::displayListOfStations ( ) const
{
- clog << "SystemManager::displayListOfStations" << endl;
+ //clog << "SystemManager::displayListOfStations" << endl;
if (!mListOfStations.empty())
{
@@ -256,7 +247,7 @@ void SystemManager::displayListOfStations ( ) const
}
else
{
- clog << "\tlist is empty!" << endl;
+ clog << "\tlist of stations is empty!" << endl;
}
}
diff --git a/maximus/system/src/SystemManagerTest.cpp b/maximus/system/src/SystemManagerTest.cpp
index f08d4592d2..75ed227568 100644
--- a/maximus/system/src/SystemManagerTest.cpp
+++ b/maximus/system/src/SystemManagerTest.cpp
@@ -79,10 +79,10 @@ void SystemManagerTest::removeStationTest (void)
{
clog << "\tSystemManagerTest -> SystemManager::setInputFileDescriptor" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setInputFileDescriptor failed"),
- pStation1->setInputFileDescriptor(1) );
+ pStation1->setInputFileDescriptor(-10) );
clog << "\tSystemManagerTest -> SystemManager::setOutputFileDescriptor" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setOutputFileDescriptor failed"),
- pStation1->setOutputFileDescriptor(1) );
+ pStation1->setOutputFileDescriptor(-20) );
}
// Create Station 2
@@ -93,10 +93,10 @@ void SystemManagerTest::removeStationTest (void)
{
clog << "\tSystemManagerTest -> SystemManager::setInputFileDescriptor" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setInputFileDescriptor failed"),
- pStation2->setInputFileDescriptor(1) );
+ pStation2->setInputFileDescriptor(-10) );
clog << "\tSystemManagerTest -> SystemManager::setOutputFileDescriptor" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setOutputFileDescriptor failed"),
- pStation2->setOutputFileDescriptor(2) );
+ pStation2->setOutputFileDescriptor(-20) );
}
// Create Station 3
@@ -107,10 +107,10 @@ void SystemManagerTest::removeStationTest (void)
{
clog << "\tSystemManagerTest -> SystemManager::setInputFileDescriptor" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setInputFileDescriptor failed"),
- pStation3->setInputFileDescriptor(1) );
+ pStation3->setInputFileDescriptor(-10) );
clog << "\tSystemManagerTest -> SystemManager::setOutputFileDescriptor" << endl;
CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setOutputFileDescriptor failed"),
- pStation3->setOutputFileDescriptor(1) );
+ pStation3->setOutputFileDescriptor(-10) );
}
clog << "\tSystemManagerTest -> SystemManager::removeStation" << endl;
@@ -144,9 +144,9 @@ void SystemManagerTest::areAllActiveStationsIdleTest (void)
Station * pStation1 = mpSystemManager->createStation(); // will be deleted by SystemManager
if (NULL != pStation1)
{
- clog << "\tSystemManagerTest -> Station::updateStationStatus" << endl;
- CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("updateStationStatus failed"),
- pStation1->updateStationStatus(MAXIMUS_STATION_STATUS_IDLE) );
+ clog << "\tSystemManagerTest -> Station::setStationStatus" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setStationStatus failed"),
+ pStation1->setStationStatus(MAXIMUS_STATION_STATUS_IDLE) );
}
// Create Station 2
@@ -155,9 +155,9 @@ void SystemManagerTest::areAllActiveStationsIdleTest (void)
Station * pStation2 = mpSystemManager->createStation(); // will be deleted by SystemManager
if (NULL != pStation2)
{
- clog << "\tSystemManagerTest -> Station::updateStationStatus" << endl;
- CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("updateStationStatus failed"),
- pStation2->updateStationStatus(MAXIMUS_STATION_STATUS_IDLE) );
+ clog << "\tSystemManagerTest -> Station::setStationStatus" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setStationStatus failed"),
+ pStation2->setStationStatus(MAXIMUS_STATION_STATUS_IDLE) );
}
// Create Station 3
@@ -166,9 +166,9 @@ void SystemManagerTest::areAllActiveStationsIdleTest (void)
Station * pStation3 = mpSystemManager->createStation(); // will be deleted by SystemManager
if (NULL != pStation3)
{
- clog << "\tSystemManagerTest -> Station::updateStationStatus" << endl;
- CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("updateStationStatus failed"),
- pStation3->updateStationStatus(MAXIMUS_STATION_STATUS_IDLE) );
+ clog << "\tSystemManagerTest -> Station::setStationStatus" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setStationStatus failed"),
+ pStation3->setStationStatus(MAXIMUS_STATION_STATUS_IDLE) );
}
clog << "\tSystemManagerTest -> SystemManager::areAllActiveStationsIdle" << endl;
@@ -178,7 +178,7 @@ void SystemManagerTest::areAllActiveStationsIdleTest (void)
if (NULL != pStation2)
{
clog << "\tSystemManagerTest -> Station::setStationStatus" << endl;
- pStation2->updateStationStatus(MAXIMUS_STATION_STATUS_BUSY);
+ pStation2->setStationStatus(MAXIMUS_STATION_STATUS_BUSY);
}
clog << "\tSystemManagerTest -> SystemManager::areAllActiveStationsIdle" << endl;
diff --git a/maximus/system/src/SystemSciMsg.cpp b/maximus/system/src/SystemSciMsg.cpp
index 831b0d502b..0ebd9907cb 100644
--- a/maximus/system/src/SystemSciMsg.cpp
+++ b/maximus/system/src/SystemSciMsg.cpp
@@ -47,7 +47,7 @@ mSpecializedSciMsgType(SYSTEM_TYPE_NONE),
mpSpecializedSciMsgHeader(NULL),
mpSystemManager(NULL)
{
- clog << "SystemSciMsg()" << endl;
+ //clog << "SystemSciMsg()" << endl;
initAttributes ();
}
@@ -58,7 +58,7 @@ mSpecializedSciMsgType(SYSTEM_TYPE_NONE),
mpSpecializedSciMsgHeader(NULL),
mpSystemManager(NULL)
{
- clog << "SystemSciMsg(SystemManager*)" << endl;
+ //clog << "SystemSciMsg(SystemManager*)" << endl;
initAttributes ();
@@ -75,7 +75,7 @@ mpSystemManager(NULL)
void SystemSciMsg::initAttributes ( )
{
- clog << "SystemSciMsg::initAttributes" << endl;
+ //clog << "SystemSciMsg::initAttributes" << endl;
mpSpecializedSciMsgHeader = new System_Header;
if (NULL != mpSpecializedSciMsgHeader)
@@ -93,7 +93,7 @@ void SystemSciMsg::initAttributes ( )
SystemSciMsg::~SystemSciMsg ( )
{
- clog << "~SystemSciMsg" << endl;
+ //clog << "~SystemSciMsg" << endl;
if (NULL != mpSpecializedSciMsgHeader)
{
@@ -123,7 +123,7 @@ SystemSciMsg::~SystemSciMsg ( )
SciMsg * SystemSciMsg::create ( ) const
{
- clog << "SystemSciMsg::create" << endl;
+ //clog << "SystemSciMsg::create" << endl;
return new SystemSciMsg (mpSystemManager);
}
@@ -131,14 +131,14 @@ SciMsg * SystemSciMsg::create ( ) const
bool SystemSciMsg::dispatchMsg ( )
{
- clog << "SystemSciMsg::dispatchMsg" << endl;
+ //clog << "SystemSciMsg::dispatchMsg" << endl;
bool bDispatch = false;
if (NULL != mpSystemManager)
{
if ( SYSTEM_TYPE_IDLE == getSpecializedSciMsgType() )
{
- bDispatch = mpSystemManager->setStationToIdle(SciMsg::getSciMsgStationId());
+ bDispatch = mpSystemManager->updateStationStatus(SciMsg::getSciMsgStationId(), MAXIMUS_STATION_STATUS_IDLE);
}
}
else
@@ -154,7 +154,7 @@ bool SystemSciMsg::dispatchMsg ( )
//
bool SystemSciMsg::identifySpecializedSciMsgHeader ( )
{
- clog << "SystemSciMsg::identifySpecializedSciMsgHeader" << endl;
+ //clog << "SystemSciMsg::identifySpecializedSciMsgHeader" << endl;
bool bIdentifyHeader = false;
if (NULL != SciMsg::getSciMsgData())
@@ -199,7 +199,7 @@ bool SystemSciMsg::identifySpecializedSciMsgHeader ( )
//
bool SystemSciMsg::checkCompatibility ( ) const
{
- clog << "SystemSciMsg::checkCompatibility" << endl;
+ //clog << "SystemSciMsg::checkCompatibility" << endl;
bool bCheck = false;
if ( (NULL != getSpecializedSciMsgHeader()) && (SYSTEM_VERSION == getSpecializedSciMsgHeader()->version) )
@@ -267,12 +267,12 @@ System_Type SystemSciMsg::getSpecializedSciMsgType ( ) const
bool SystemSciMsg::setSpecializedSciMsgType ( const System_Type type )
{
- clog << "SystemSciMsg::setSpecializedSciMsgType" << endl;
+ //clog << "SystemSciMsg::setSpecializedSciMsgType" << endl;
mSpecializedSciMsgType = type;
- clog << "\tsystem SCI msg type = ";
- displaySpecializedSciMsgType();
- clog << endl;
+ //clog << "\tsystem SCI msg type = ";
+ //displaySpecializedSciMsgType();
+ //clog << endl;
return true;
}
@@ -286,7 +286,7 @@ System_Header * SystemSciMsg::getSpecializedSciMsgHeader ( ) const
bool SystemSciMsg::setSpecializedSciMsgHeader ( const System_Header * p_specialized_sci_msg_header )
{
- clog << "SystemSciMsg::setSpecializedSciMsgHeader" << endl;
+ //clog << "SystemSciMsg::setSpecializedSciMsgHeader" << endl;
bool bSetHeader = false;
if ( (NULL != p_specialized_sci_msg_header) && (NULL != mpSpecializedSciMsgHeader) )
diff --git a/maximus/system/src/SystemSciMsgTest.cpp b/maximus/system/src/SystemSciMsgTest.cpp
new file mode 100644
index 0000000000..e4b687a489
--- /dev/null
+++ b/maximus/system/src/SystemSciMsgTest.cpp
@@ -0,0 +1,101 @@
+
+#include "SystemSciMsgTest.h"
+#include "SciServer.h"
+#include "SystemManager.h"
+
+#include <iostream>
+using namespace std;
+
+CPPUNIT_TEST_SUITE_REGISTRATION (SystemSciMsgTest);
+
+
+void SystemSciMsgTest::setUp (void)
+{
+ clog << "SystemSciMsgTest::setUp" << endl;
+
+ clog << "\tSystemSciMsgTest -> SciServer()" << endl;
+ mpSciServer = new SciServer();
+ clog << "\tSystemSciMsgTest -> SystemManager(SciServer*)" << endl;
+ mpSystemManager = new SystemManager (mpSciServer);
+ clog << "\tSystemSciMsgTest -> SystemSciMsg(SystemManager*)" << endl;
+ mpSystemSciMsg = new SystemSciMsg (mpSystemManager);
+}
+
+
+void SystemSciMsgTest::tearDown (void)
+{
+ clog << "SystemSciMsgTest::tearDown" << endl;
+
+ if (NULL != mpSystemSciMsg)
+ {
+ clog << "\tSystemSciMsgTest -> ~SystemSciMsg" << endl;
+ delete mpSystemSciMsg;
+ mpSystemSciMsg = NULL;
+ }
+ if (NULL != mpSystemManager)
+ {
+ clog << "\tSystemSciMsgTest -> ~SystemManager" << endl;
+ delete (mpSystemManager);
+ mpSystemManager = NULL;
+ }
+ if (NULL != mpSciServer)
+ {
+ clog << "\tSystemSciMsgTest -> ~SciServer" << endl;
+ delete (mpSciServer);
+ mpSciServer = NULL;
+ }
+}
+
+
+void SystemSciMsgTest::dispatchMsgTest (void)
+{
+ clog << endl;
+ clog << "-------------------------------------------------------------------------------------" << endl;
+ clog << "*** UNITARY TEST OF SystemSciMsg::dispatchMsg ***" << endl;
+
+ if (NULL != mpSystemSciMsg)
+ {
+ try
+ {
+ clog << "\tSystemSciMsgTest -> SystemSciMsg::dispatch" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("dispatchMsg failed"),
+ !mpSystemSciMsg->dispatchMsg() );
+
+ clog << "\tSystemSciMsgTest -> SystemSciMsg::setSpecializedSciMsgType" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setSpecializedSciMsgType failed"),
+ mpSystemSciMsg->setSpecializedSciMsgType(SYSTEM_TYPE_IDLE) );
+
+ Station * pStation = mpSystemManager->createStation(); // will be deleted by SystemManager
+ clog << "\tSystemSciMsgTest -> SciMsg::setSciMsgStationId" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("setSciMsgStationId failed"),
+ mpSystemSciMsg->setSciMsgStationId(pStation->getStationId()) );
+
+ clog << "\tSystemSciMsgTest -> SystemSciMsg::dispatch" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("dispatchMsg failed"),
+ mpSystemSciMsg->dispatchMsg() );
+
+ // Check results
+ //
+ clog << "\tSystemSciMsgTest -> Station::getStationStatus" << endl;
+ CPPUNIT_ASSERT_MESSAGE ( CPPUNIT_NS::Message("dispatchMsg failed"),
+ MAXIMUS_STATION_STATUS_IDLE == pStation->getStationStatus() );
+
+ if (NULL != pStation)
+ {
+ pStation = NULL;
+ }
+ }
+ catch ( Error &e )
+ {
+ e.display();
+ }
+ }
+ else
+ {
+ CPPUNIT_FAIL ( "Initialized SystemSciMsg pointer is NULL" );
+ }
+
+ clog << "-------------------------------------------------------------------------------------" << endl;
+ clog << endl;
+}
+
diff --git a/maximus/unittest/Makefile b/maximus/unittest/Makefile
deleted file mode 100644
index a356c6ec59..0000000000
--- a/maximus/unittest/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BASE = ../..
-
-CPPUNIT_PATH=/opt/cppunit
-HOST_PROGRAMS = unittest
-unittest_SOURCES = main.cpp ../../coreengine/src/CoreEngineTest.cpp ../../networkclock/src/NetworkClockProcessorTest.cpp ../../networkclock/src/NetworkClockEvtListTest.cpp ../../networkclock/src/NetworkClockEvtTest.cpp ../../sci/src/SciServerTest.cpp ../../sci/src/SciMsgTest.cpp ../../system/src/SystemManagerTest.cpp ../../system/src/StationTest.cpp ../../system/src/StationConfigurationTest.cpp ../../functioncall/src/FunctionCallManagerTest.cpp ../../functioncall/src/FunctionSciMsgTest.cpp ../../functioncall/src/IFunctionCallTest.cpp ../../error/src/ErrorTest.cpp ../../phy/src/PhyProcessorTest.cpp
-unittest_MODULES = maximus/error maximus/functioncall maximus/networkclock maximus/phy maximus/sci maximus/system maximus/coreengine
-INCLUDES = maximus/error/inc maximus/coreengine/inc maximus/networkclock/inc maximus/sci/inc maximus/functioncall/inc maximus/phy/inc maximus/system/inc maximus/common/interfaces maximus/common/types
-
-include $(BASE)/common/make/top.mk
-
-HOST_LDFLAGS += -L${CPPUNIT_PATH}/lib -lstdc++ -lcppunit -ldl -lpthread
diff --git a/maximus/unittest/src/main.cpp b/maximus/unittest/src/main.cpp
deleted file mode 100644
index bcbde70812..0000000000
--- a/maximus/unittest/src/main.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-
-#include "CoreEngine.h"
-#include "Error.h"
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-#include <iostream> // for 'cout', 'cerr' and 'clog'
-#include <fstream> // for ofstream'
-using namespace std;
-
-
-int main (void)
-{
- int returnValue = -1;
-
- // Create a file for logging
- //
- ofstream logFile("unittestlog.txt");
- if (logFile)
- {
- clog.rdbuf(logFile.rdbuf());
- //clog.rdbuf(cout.rdbuf());
- }
- else
- {
- cerr << "Error while opening log file" << endl;
- }
-
- clog << "-------------------------------------------------------------------------------------" << endl;
- clog << "*** Welcome to Fulminata Maximus simulator unitary tests ***" << endl << endl;
-
- try
- {
- cout << "testresult" << endl;
- CPPUNIT_NS :: TestResult testresult;
-
- cout << "collectedresults" << endl;
- CPPUNIT_NS :: TestResultCollector collectedresults;
- testresult.addListener (&collectedresults);
-
- cout << "testrunner" << endl;
- CPPUNIT_NS :: TestRunner testrunner;
- testrunner.addTest (CPPUNIT_NS :: TestFactoryRegistry :: getRegistry ().makeTest ());
- testrunner.run (testresult);
-
- cout << "compileroutputter" << endl;
- CPPUNIT_NS :: CompilerOutputter compileroutputter (&collectedresults, std::cerr);
- compileroutputter.write ();
-
- returnValue = collectedresults.wasSuccessful () ? 0 : 1;
- }
- catch ( Error &e )
- {
- e.display();
- }
-
- clog << endl;
- clog << "-------------------------------------------------------------------------------------" << endl;
- clog << "*** END ***" << endl;
- clog << flush;
- logFile.close();
-
- return returnValue;
-}
-