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

TestCaseDummyTelecommand_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseDummyTelecommand_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/Constants.h" 00013 #include "../GeneralInclude/TestConstants.h" 00014 #include "../Telecommand/DC_DummyTelecommand.h" 00015 #include "TestCaseDummyTelecommand_1.h" 00016 00017 TestCaseDummyTelecommand_1::TestCaseDummyTelecommand_1(void) : 00018 TestCaseGenericSetUp(ID_DUMMYTELECOMMAND*10+1,"TestCaseDummyTelecommand_1") { 00019 return; 00020 } 00021 00022 void TestCaseDummyTelecommand_1::runTestCase(void) { 00023 00024 // Create the dummy telecommand components 00025 DC_DummyTelecommand* pTc = new DC_DummyTelecommand(); 00026 00027 // Check the value of the class identifier 00028 if ( pTc->getClassId() != ID_DUMMYTELECOMMAND ) 00029 { setTestResult(TEST_FAILURE, "Wrong class identifier"); 00030 return; 00031 } 00032 00033 // Check configuration status 00034 if ( pTc->isObjectConfigured() ) 00035 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00036 return; 00037 } 00038 00039 // Check default values of TC attributes 00040 if ( pTc->getTelecommandId() != pTc->getInstanceId() ) 00041 { setTestResult(TEST_FAILURE, "Wrong TC ID value"); 00042 return; 00043 } 00044 if ( pTc->getType() != (pTc->getClassId()%256) ) 00045 { setTestResult(TEST_FAILURE, "Wrong TC type value"); 00046 return; 00047 } 00048 if ( pTc->getSubType() != 0 ) 00049 { setTestResult(TEST_FAILURE, "Wrong TC subtype value"); 00050 return; 00051 } 00052 if ( pTc->getSource() != 0 ) 00053 { setTestResult(TEST_FAILURE, "Wrong telecommand source attribute"); 00054 return; 00055 } 00056 if ( pTc->getAcknowledgeLevel() != 0 ) 00057 { setTestResult(TEST_FAILURE, "Wrong TC acknowledge value"); 00058 return; 00059 } 00060 if ( pTc->isInUse() != false ) 00061 { setTestResult(TEST_FAILURE, "Wrong initial value of InUse attribute"); 00062 return; 00063 } 00064 00065 // Set the telecommand time tag and verify that 00066 // the telecommand becomes configured 00067 TD_ObsTime tt = 20; 00068 pTc->setTimeTag(tt); 00069 if ( pTc->getTimeTag() != (TD_ObsTime)tt ) 00070 { setTestResult(TEST_FAILURE, "Wrong time tag value"); 00071 return; 00072 } 00073 if ( !pTc->isObjectConfigured() ) 00074 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00075 return; 00076 } 00077 00078 // Change the value of the "in use" attribute and check success 00079 pTc->setInUse(true); 00080 if ( pTc->isInUse() != true) 00081 { setTestResult(TEST_FAILURE, "Wrong value of InUse attribute"); 00082 return; 00083 } 00084 00085 // Check the initial value of the execution counter 00086 if ( pTc->getExecutionCounter() != 0 ) 00087 { setTestResult(TEST_FAILURE, "Wrong initial value of execution counter"); 00088 return; 00089 } 00090 00091 // Check the number of raw data 00092 if ( pTc->getNumberOfRawData() != 0 ) 00093 { setTestResult(TEST_FAILURE, "Wrong number of raw data"); 00094 return; 00095 } 00096 00097 // Check the execution check return value 00098 if ( !pTc->canExecute() ) 00099 { setTestResult(TEST_FAILURE, "Wrong execution check return value"); 00100 return; 00101 } 00102 00103 // Check the validity check return value 00104 if ( !pTc->isValid() ) 00105 { setTestResult(TEST_FAILURE, "Wrong validity check return value"); 00106 return; 00107 } 00108 00109 // Make two execute requests and check increment of execution counter 00110 pTc->execute(); 00111 pTc->execute(); 00112 if ( pTc->getExecutionCounter() != 2 ) 00113 { setTestResult(TEST_FAILURE, "Wrong execution check counter value"); 00114 return; 00115 } 00116 00117 // Change the execution check return value and check that the change is 00118 // implemented 00119 pTc->setExecutionCheckValue(TC_CANNOT_EXECUTE); 00120 if ( pTc->canExecute() ) 00121 { setTestResult(TEST_FAILURE, "Wrong execution check return value"); 00122 return; 00123 } 00124 00125 // Change the validity check return value and check that the change is 00126 // implemented 00127 pTc->setValidityCheckValue(NOT_VALID); 00128 if ( pTc->isValid() ) 00129 { setTestResult(TEST_FAILURE, "Wrong validity check return value"); 00130 return; 00131 } 00132 00133 // Change the execution check code and check that the change is 00134 // implemented 00135 pTc->setExecutionCheckCode(1); 00136 if ( pTc->getExecutionCheckCode()!=1 ) 00137 { setTestResult(TEST_FAILURE, "Wrong execution check code"); 00138 return; 00139 } 00140 00141 // Change the validity check code and check that the change is 00142 // implemented 00143 pTc->setValidityCheckCode(1); 00144 if ( pTc->getValidityCheckCode()!=1 ) 00145 { setTestResult(TEST_FAILURE, "Wrong validity check code"); 00146 return; 00147 } 00148 00149 // Dummy method calls 00150 pTc->setAcknowledgeLevel(0); 00151 pTc->setTelecommandId(0); 00152 pTc->setSource(0); 00153 pTc->setType(0); 00154 pTc->setSubType(0); 00155 00156 setTestResult(TEST_SUCCESS,"Test Successful"); 00157 return; 00158 00159 }
Copyright 2003 P&P Software GmbH - All Rights Reserved