00001
00002
00003
00004
00005
00006
00007
00008
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
00027
if ( pTmWord->
getClassId() != ID_DUMMYTELEMETRYITEM )
00028 { setTestResult(
TEST_FAILURE,
"Wrong class identifier");
00029
return;
00030 }
00031
00032
00033
if ( pTmWord->
isObjectConfigured() )
00034 { setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00035
return;
00036 }
00037
00038
00039 pTmWord->
setNumberOfBytes(2);
00040
if ( !pTmWord->
isObjectConfigured() )
00041 { setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00042
return;
00043 }
00044
00045
00046
if ( pTmWord->
getNumberOfBytes() != 2 )
00047 { setTestResult(
TEST_FAILURE,
"Wrong number of bytes");
00048
return;
00049 }
00050
00051
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
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
00074
if ( !pTmWord->
isValid() )
00075 { setTestResult(
TEST_FAILURE,
"Wrong validity check result");
00076
return;
00077 }
00078
00079
00080 pTmWord->
setValidStatus(
NOT_VALID);
00081
if ( pTmWord->
isValid() )
00082 { setTestResult(
TEST_FAILURE,
"Wrong validity check result");
00083
return;
00084 }
00085
00086
00087
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
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
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
00134 pTmWord->
setInUse(
true);
00135
if (!pTmWord->
isInUse())
00136 { setTestResult(
TEST_FAILURE,
"Wrong inUse status");
00137
return;
00138 }
00139
00140
00141
if ( pTmWord->
getNumberOfBytes() != 2 )
00142 { setTestResult(
TEST_FAILURE,
"Wrong number of bytes");
00143
return;
00144 }
00145
00146
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 }