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

TestCaseDummyTelecommandLoader_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseDummyTelecommandLoader_1.cpp 00005 // 00006 // Version 1.1 00007 // Date 18.04.03 00008 // Author A. Pasetti (P&P Software) 00009 00010 #include "../GeneralInclude/CompilerSwitches.h" 00011 #include "../GeneralInclude/ClassId.h" 00012 #include "../GeneralInclude/TestConstants.h" 00013 #include "../Telecommand/DC_DummyTelecommand.h" 00014 #include "../Telecommand/DC_DummyTelecommandLoader.h" 00015 #include "../Telecommand/CC_TelecommandManager.h" 00016 #include "../System/DC_DummyObsClock.h" 00017 #include "../Telecommand/TelecommandLoader.h" 00018 #include "TestCaseDummyTelecommandLoader_1.h" 00019 00020 TestCaseDummyTelecommandLoader_1::TestCaseDummyTelecommandLoader_1(void) : 00021 TestCaseGenericSetUp(ID_DUMMYTELECOMMANDLOADER*10+1,"TestCaseDummyTelecommandLoader_1") { 00022 return; 00023 } 00024 00025 void TestCaseDummyTelecommandLoader_1::runTestCase(void) { 00026 00027 // Create the dummy telecommand loader 00028 DC_DummyTelecommandLoader* pTcl = new DC_DummyTelecommandLoader(); 00029 00030 // Create and configure a telecommand manager 00031 CC_TelecommandManager* pTcm = new CC_TelecommandManager(); 00032 DC_DummyObsClock* pClk = new DC_DummyObsClock(); 00033 pTcm->setPendingTelecommandListSize(10); 00034 pTcm->setObsClock(pClk); 00035 pTcm->setTelecommandLoader(pTcl); 00036 pTcl->setTelecommandManager(pTcm); 00037 00038 // Check the value of the class identifier 00039 if ( pTcl->getClassId() != ID_DUMMYTELECOMMANDLOADER ) 00040 { setTestResult(TEST_FAILURE, "Wrong class identifier"); 00041 return; 00042 } 00043 00044 // Check that the telecommand loader is not configured 00045 if ( pTcl->isObjectConfigured() ) 00046 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00047 return; 00048 } 00049 00050 // Create, configure and load three sample telecommands 00051 // and verify that the telecommand loader becomes configured 00052 DC_DummyTelecommand* pSampleTc1 = new DC_DummyTelecommand(); 00053 DC_DummyTelecommand* pSampleTc2 = new DC_DummyTelecommand(); 00054 DC_DummyTelecommand* pSampleTc3 = new DC_DummyTelecommand(); 00055 pSampleTc1->setTimeTag(0); 00056 pSampleTc2->setTimeTag(0); 00057 pSampleTc3->setTimeTag(0); 00058 pTcl->setSampleTelecommand(0,pSampleTc1); 00059 pTcl->setSampleTelecommand(1,pSampleTc2); 00060 pTcl->setSampleTelecommand(2,pSampleTc3); 00061 if ( !pTcl->isObjectConfigured() ) 00062 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00063 return; 00064 } 00065 00066 // Send two activation requests to the telecommand loader and verify 00067 // increment of allocation counter 00068 pTcl->activate(); 00069 pTcl->activate(); 00070 if ( pTcl->getAllocationCounter() != 2 ) 00071 { setTestResult(TEST_FAILURE, "Wrong value of allocation counter"); 00072 return; 00073 } 00074 00075 setTestResult(TEST_SUCCESS,"Test Successful"); 00076 return; 00077 00078 }
Copyright 2003 P&P Software GmbH - All Rights Reserved