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

TestCaseDummyPUSTelecommand_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseDummyPUSTelecommand_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_DummyPUSTelecommand.h" 00015 #include "TestCaseDummyPUSTelecommand_1.h" 00016 00017 TestCaseDummyPUSTelecommand_1::TestCaseDummyPUSTelecommand_1(void) : 00018 TestCaseGenericSetUp(ID_DUMMYPUSTELECOMMAND*10+1,"TestCaseDummyPUSTelecommand_1") { 00019 return; 00020 } 00021 00022 void TestCaseDummyPUSTelecommand_1::runTestCase(void) { 00023 00024 // Create the dummy telecommand components 00025 DC_DummyPUSTelecommand* pTc = new DC_DummyPUSTelecommand(); 00026 00027 // Check the value of the class identifier 00028 if ( pTc->getClassId() != ID_DUMMYPUSTELECOMMAND ) 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 // Set and read back the TC attributes 00040 if ( pTc->getTelecommandId() != TEST_TC_ID ) 00041 { setTestResult(TEST_FAILURE, "Wrong TC ID value"); 00042 return; 00043 } 00044 if ( pTc->getType() != TEST_TC_TYPE ) 00045 { setTestResult(TEST_FAILURE, "Wrong TC type value"); 00046 return; 00047 } 00048 if ( pTc->getSubType() != TEST_TC_SUBTYPE ) 00049 { setTestResult(TEST_FAILURE, "Wrong TC subtype value"); 00050 return; 00051 } 00052 if ( pTc->getSource() != TEST_TC_SOURCE ) 00053 { setTestResult(TEST_FAILURE, "Wrong TC source value"); 00054 return; 00055 } 00056 pTc->setTimeTag(5); 00057 if ( pTc->getTimeTag() != 5 ) 00058 { setTestResult(TEST_FAILURE, "Wrong time tag value"); 00059 return; 00060 } 00061 if ( pTc->getAcknowledgeLevel() != 0 ) 00062 { setTestResult(TEST_FAILURE, "Wrong TC acknowledge level"); 00063 return; 00064 } 00065 if ( pTc->getPacketId() != (2048+4096+TEST_TC_APID) ) 00066 { setTestResult(TEST_FAILURE, "Wrong packet ID"); 00067 return; 00068 } 00069 00070 // Check that the telecommand becomes configured 00071 if ( !pTc->isObjectConfigured() ) 00072 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00073 return; 00074 } 00075 00076 // Update acknowledge level and check success 00077 pTc->setAcknowledgeLevel(10); 00078 if ( pTc->isAcceptanceAckRequired() ) 00079 { setTestResult(TEST_FAILURE, "Wrong acceptance acknowledge value"); 00080 return; 00081 } 00082 if ( !pTc->isStartAckRequired() ) 00083 { setTestResult(TEST_FAILURE, "Wrong start acknowledge value"); 00084 return; 00085 } 00086 if ( pTc->isProgressAckRequired() ) 00087 { setTestResult(TEST_FAILURE, "Wrong progress acknowledge value"); 00088 return; 00089 } 00090 if ( !pTc->isCompletionAckRequired() ) 00091 { setTestResult(TEST_FAILURE, "Wrong completion acknowledge value"); 00092 return; 00093 } 00094 00095 // Make two execute requests and check increment of execution counter 00096 pTc->execute(); 00097 pTc->execute(); 00098 if ( pTc->getExecutionCounter() != 2 ) 00099 { setTestResult(TEST_FAILURE, "Wrong execution check counter value"); 00100 return; 00101 } 00102 00103 setTestResult(TEST_SUCCESS,"Test Successful"); 00104 return; 00105 00106 }
Copyright 2003 P&P Software GmbH - All Rights Reserved