Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

TestCaseGenericSetUp.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseGenericSetUp.cpp 00005 // 00006 // Version 1.0 00007 // Date 13.04.03 00008 // Author A. Pasetti (P&P Software) 00009 00010 #include "TestCaseGenericSetUp.h" 00011 #include "TestCase.h" 00012 #include "../GeneralInclude/CompilerSwitches.h" 00013 #include "../GeneralInclude/TestConstants.h" 00014 #include "../GeneralInclude/Constants.h" 00015 #include "../Base/CC_RootObject.h" 00016 #include "../Event/DC_EventRepository.h" 00017 #include "../Data/DC_DummyDataPool.h" 00018 #include "../Data/DC_DummyDatabase.h" 00019 #include "../System/DC_DummyObsClock.h" 00020 #include "../System/DC_DummyTracer.h" 00021 #include "../Telemetry/PUSTelemetryPacket.h" 00022 #include "../Telemetry/CC_TelemetryPacketFactory.h" 00023 #include "../Telemetry/DC_PUSTcVerificationPacket.h" 00024 #include "../Telemetry/DC_PUSDataReportingPacket.h" 00025 #include "../Telemetry/DC_DummyPUSTelemetryPacket.h" 00026 #include "../Telecommand/PUSTelecommand.h" 00027 00028 bool TestCaseGenericSetUp::firstActivation = true; 00029 00030 TestCaseGenericSetUp::TestCaseGenericSetUp(int testId, char* testName): 00031 TestCase(testId,testName) { 00032 return; 00033 } 00034 00035 bool TestCaseGenericSetUp::setUpTestCase(void) { 00036 00037 if (firstActivation) { 00038 // Initialize the system list size in class CC_RootObject 00039 CC_RootObject::setSystemListSize(MAX_N_OBJECTS); 00040 00041 // Load an event repository into class CC_RootObject 00042 DC_EventRepository* pRep = new DC_EventRepository(); 00043 DC_DummyObsClock* pClk = new DC_DummyObsClock(); 00044 pRep->setObsClock(pClk); 00045 pRep->setRepositorySize(EVT_REP_SIZE); 00046 00047 // Load repository into CC_RootObject and check success 00048 CC_RootObject::setEventRepository(pRep); 00049 if ( CC_RootObject::getEventRepository()!=pRep ) 00050 return INITIALIZATION_FAILURE; 00051 00052 // Load a dummy database into class CC_RootObject and check success 00053 DC_DummyDatabase* pDB = new DC_DummyDatabase(); 00054 CC_RootObject::setParameterDatabase(pDB); 00055 if ( CC_RootObject::getParameterDatabase()!=pDB ) 00056 return INITIALIZATION_FAILURE; 00057 00058 // Load a dummy datapool into class CC_RootObject and check success 00059 DC_DummyDataPool* pDP = new DC_DummyDataPool(); 00060 CC_RootObject::setDataPool(pDP); 00061 if ( CC_RootObject::getDataPool()!=pDP ) 00062 return INITIALIZATION_FAILURE; 00063 00064 // Load a tracer into class CC_RootObject and check success 00065 DC_DummyTracer* pTrc = new DC_DummyTracer(); 00066 CC_RootObject::setTracer(pTrc); 00067 if ( CC_RootObject::getTracer()!=pTrc ) 00068 return INITIALIZATION_FAILURE; 00069 00070 // Configure the static part of PUS telecommand and telemetry classes 00071 PUSTelemetryPacket::setDefaultDestination(TEST_TM_DEF_DEST); 00072 PUSTelemetryPacket::setApplicationId(TEST_TM_APID); 00073 PUSTelemetryPacket::setObsClock(pClk); 00074 PUSTelecommand::setApplicationId(TEST_TC_APID); 00075 00076 firstActivation = false; 00077 } 00078 00079 return INITIALIZATION_SUCCESS; 00080 } 00081 00082 void TestCaseGenericSetUp::runTestCase(void) { 00083 return; 00084 } 00085 00086 bool TestCaseGenericSetUp::shutDownTestCase(void) { 00087 return SHUTDOWN_SUCCESS; 00088 }
Copyright 2003 P&P Software GmbH - All Rights Reserved