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

TestCaseDummyTelemetryPacket_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseDummyTelemetryPacket_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 "../GeneralInclude/Constants.h" 00014 #include "../Telemetry/DC_DummyTelemetryPacket.h" 00015 #include "TestCaseDummyTelemetryPacket_1.h" 00016 00017 TestCaseDummyTelemetryPacket_1::TestCaseDummyTelemetryPacket_1(void) : 00018 TestCaseGenericSetUp(ID_DUMMYTELEMETRYITEM*10+1,"TestCaseDummyTelemetryPacket_1") { 00019 return; 00020 } 00021 00022 void TestCaseDummyTelemetryPacket_1::runTestCase(void) { 00023 00024 DC_DummyTelemetryPacket* pTmWord = new DC_DummyTelemetryPacket(); 00025 00026 // Check the value of the class identifier 00027 if ( pTmWord->getClassId() != ID_DUMMYTELEMETRYITEM ) 00028 { setTestResult(TEST_FAILURE, "Wrong class identifier"); 00029 return; 00030 } 00031 00032 // Check configuration statur 00033 if ( pTmWord->isObjectConfigured() ) 00034 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00035 return; 00036 } 00037 00038 // Set number of bytes and check configuration status 00039 pTmWord->setNumberOfBytes(2); 00040 if ( !pTmWord->isObjectConfigured() ) 00041 { setTestResult(TEST_FAILURE, "Wrong configuration status"); 00042 return; 00043 } 00044 00045 // Check number of bytes 00046 if ( pTmWord->getNumberOfBytes() != 2 ) 00047 { setTestResult(TEST_FAILURE, "Wrong number of bytes"); 00048 return; 00049 } 00050 00051 // Check default value of the encapsulated telemetry bytes 00052 if ( pTmWord->getUnsignedByte(0) != 0 ) 00053 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00054 return; 00055 } 00056 if ( pTmWord->getUnsignedByte(1) != 0 ) 00057 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00058 return; 00059 } 00060 00061 // Set and read out the encapsulated telemetry byte 00062 pTmWord->setValue(0,1); 00063 if ( pTmWord->getUnsignedByte(0) != 1 ) 00064 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00065 return; 00066 } 00067 pTmWord->setValue(1,2); 00068 if ( pTmWord->getUnsignedByte(1) != 2 ) 00069 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00070 return; 00071 } 00072 00073 // Check default value of the validity check service 00074 if ( !pTmWord->isValid() ) 00075 { setTestResult(TEST_FAILURE, "Wrong validity check result"); 00076 return; 00077 } 00078 00079 // Set and read out the validity status 00080 pTmWord->setValidStatus(NOT_VALID); 00081 if ( pTmWord->isValid() ) 00082 { setTestResult(TEST_FAILURE, "Wrong validity check result"); 00083 return; 00084 } 00085 00086 // Check update service (the update service simply increments by one the 00087 // value of the telemetry bytes) 00088 pTmWord->update(); 00089 if ( pTmWord->getUnsignedByte(0) != 2 ) 00090 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00091 return; 00092 } 00093 if ( pTmWord->getUnsignedByte(1) != 3 ) 00094 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00095 return; 00096 } 00097 00098 // Check update service with wrap around 00099 pTmWord->setValue(0,255); 00100 pTmWord->update(); 00101 if ( pTmWord->getUnsignedByte(0) != 0 ) 00102 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00103 return; 00104 } 00105 if ( pTmWord->getUnsignedByte(1) != 4 ) 00106 { setTestResult(TEST_FAILURE, "Wrong telemetry byte value"); 00107 return; 00108 } 00109 00110 // Check default values of non-implemented attributes 00111 if (pTmWord->getDestination() != 0) 00112 { setTestResult(TEST_FAILURE, "Wrong telemetry destination"); 00113 return; 00114 } 00115 if (pTmWord->getType() != pTmWord->getClassId()%256 ) 00116 { setTestResult(TEST_FAILURE, "Wrong telemetry type"); 00117 return; 00118 } 00119 if (pTmWord->getSubType() != 0) 00120 { setTestResult(TEST_FAILURE, "Wrong telemetry sub type"); 00121 return; 00122 } 00123 if (pTmWord->getTimeTag() != 0) 00124 { setTestResult(TEST_FAILURE, "Wrong telemetry time tag"); 00125 return; 00126 } 00127 00128 if (pTmWord->isInUse()) 00129 { setTestResult(TEST_FAILURE, "Wrong inUse status"); 00130 return; 00131 } 00132 00133 // Check implementation of "in use" flag 00134 pTmWord->setInUse(true); 00135 if (!pTmWord->isInUse()) 00136 { setTestResult(TEST_FAILURE, "Wrong inUse status"); 00137 return; 00138 } 00139 00140 // Check number of bytes 00141 if ( pTmWord->getNumberOfBytes() != 2 ) 00142 { setTestResult(TEST_FAILURE, "Wrong number of bytes"); 00143 return; 00144 } 00145 00146 // Check default value of fast acquisition service 00147 if ( pTmWord->getStartAddress() != pNULL ) 00148 { setTestResult(TEST_FAILURE, "Wrong fast aquisition service"); 00149 return; 00150 } 00151 if ( pTmWord->isFastAcquisitionImplemented() ) 00152 { setTestResult(TEST_FAILURE, "Wrong fast aquisition service availability check"); 00153 return; 00154 } 00155 00156 setTestResult(TEST_SUCCESS,"Test Successful"); 00157 return; 00158 00159 }
Copyright 2003 P&P Software GmbH - All Rights Reserved