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

TestCaseTelecommandManager_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseTelecommandManager_1.cpp 00005 // 00006 // Version 1.1 00007 // Date 11.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_DummyTelecommandLoader.h" 00014 #include "../Telecommand/CC_TelecommandManager.h" 00015 #include "../System/DC_DummyObsClock.h" 00016 #include "../Telecommand/TelecommandLoader.h" 00017 #include "TestCaseTelecommandManager_1.h" 00018 00019 TestCaseTelecommandManager_1::TestCaseTelecommandManager_1(void) : 00020 TestCaseGenericSetUp(ID_TELECOMMANDMANAGER*10+1,"TestCaseTelecommandManager_1") { 00021 return; 00022 } 00023 00024 void TestCaseTelecommandManager_1::runTestCase(void) { 00025 00026 // Create the telecommand manager 00027 CC_TelecommandManager* pTcm = new CC_TelecommandManager(); 00028 00029 // Check the value of the class identifier 00030 if ( pTcm->getClassId() != ID_TELECOMMANDMANAGER ) 00031 { setTestResult(TEST_FAILURE, "Wrong class identifier"); 00032 return; 00033 } 00034 00035 // Check that the telecommand loader is not configured 00036 if ( pTcm->isObjectConfigured() ) 00037 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00038 return; 00039 } 00040 00041 // Create and load an OBS clock and verify that it is loaded 00042 DC_DummyObsClock* pClk = new DC_DummyObsClock(); 00043 pTcm->setObsClock(pClk); 00044 if ( pTcm->getObsClock() != pClk ) 00045 { setTestResult(TEST_FAILURE, "Wrong OBS clock"); 00046 return; 00047 } 00048 00049 // Create and load a telecommand loader and verify that it is loaded 00050 DC_DummyTelecommandLoader* pTcl = new DC_DummyTelecommandLoader(); 00051 pTcm->setTelecommandLoader(pTcl); 00052 if ( pTcm->getTelecommandLoader() != pTcl ) 00053 { setTestResult(TEST_FAILURE, "Wrong telecommand loader"); 00054 return; 00055 } 00056 00057 // Set the pending telecommand list size and verify correctness 00058 pTcm->setPendingTelecommandListSize(10); 00059 if ( pTcm->getPendingTelecommandListSize() != 10 ) 00060 { setTestResult(TEST_FAILURE, "Wrong pending telecommand list size"); 00061 return; 00062 } 00063 00064 // Check that the telecommand manager is configured 00065 if ( !pTcm->isObjectConfigured() ) 00066 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00067 return; 00068 } 00069 00070 // Check the number of pending telecommands 00071 if ( pTcm->getPendingTelecommands() != 0 ) 00072 { setTestResult(TEST_FAILURE, "Wrong number of pending telecommands"); 00073 return; 00074 } 00075 00076 setTestResult(TEST_SUCCESS,"Test Successful"); 00077 return; 00078 00079 }
Copyright 2003 P&P Software GmbH - All Rights Reserved