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_DummyPUSTelemetryPacket.h"
00015
#include "../System/DC_DummyObsClock.h"
00016
#include "TestCaseDummyPUSTelemetryPacket_1.h"
00017
00018 TestCaseDummyPUSTelemetryPacket_1::TestCaseDummyPUSTelemetryPacket_1(
void) :
00019
TestCaseGenericSetUp(ID_DUMMYPUSTELEMETRYPACKET*10+1,"
TestCaseDummyPUSTelemetryPacket_1") {
00020
return;
00021 }
00022
00023 void TestCaseDummyPUSTelemetryPacket_1::runTestCase(
void) {
00024
00025
DC_DummyPUSTelemetryPacket* pTmWord =
new DC_DummyPUSTelemetryPacket;
00026
00027
00028
if ( pTmWord->
getClassId() != ID_DUMMYPUSTELEMETRYPACKET )
00029 { setTestResult(
TEST_FAILURE,
"Wrong class identifier");
00030
return;
00031 }
00032
00033
00034
if (!pTmWord->
isObjectConfigured()) {
00035 setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00036
return;
00037 }
00038
00039
00040
if ( pTmWord->
getUnsignedByte(0) != 0 )
00041 { setTestResult(
TEST_FAILURE,
"Wrong telemetry byte value");
00042
return;
00043 }
00044
00045
00046 pTmWord->
setValue(2);
00047
if ( pTmWord->
getUnsignedByte(0) != 2 )
00048 { setTestResult(
TEST_FAILURE,
"Wrong telemetry byte value");
00049
return;
00050 }
00051
00052
00053 pTmWord->
update();
00054
if ( pTmWord->
getUnsignedByte(0) != 3 )
00055 { setTestResult(
TEST_FAILURE,
"Wrong telemetry byte value");
00056
return;
00057 }
00058
00059
00060 pTmWord->
setValue(255);
00061 pTmWord->
update();
00062
if ( pTmWord->
getUnsignedByte(0) != 0 )
00063 { setTestResult(
TEST_FAILURE,
"Wrong telemetry byte value");
00064
return;
00065 }
00066
00067
00068
if (pTmWord->
getDefaultDestination()!=
TEST_TM_DEF_DEST) {
00069 setTestResult(
TEST_FAILURE,
"Wrong default telemetry destination");
00070
return;
00071 }
00072
00073
if (pTmWord->
getDestination() !=
TEST_TM_DEF_DEST)
00074 { setTestResult(
TEST_FAILURE,
"Wrong telemetry destination");
00075
return;
00076 }
00077
if (pTmWord->
getType() !=
TEST_TM_TYPE)
00078 { setTestResult(
TEST_FAILURE,
"Wrong telemetry type");
00079
return;
00080 }
00081
if (pTmWord->
getSubType() !=
TEST_TM_SUBTYPE)
00082 { setTestResult(
TEST_FAILURE,
"Wrong telemetry sub type");
00083
return;
00084 }
00085
if (pTmWord->
getTimeTag() !=
TEST_TM_TIMETAG)
00086 { setTestResult(
TEST_FAILURE,
"Wrong telemetry time tag");
00087
return;
00088 }
00089
if ( pTmWord->
getPacketId() != (2048+
TEST_TM_APID) )
00090 { setTestResult(
TEST_FAILURE,
"Wrong packet ID");
00091
return;
00092 }
00093
00094
00095 pTmWord->
setDestination(
TEST_TM_DEST);
00096
if (pTmWord->
getDestination() !=
TEST_TM_DEST)
00097 { setTestResult(
TEST_FAILURE,
"Wrong telemetry destination");
00098
return;
00099 }
00100
00101
00102
if (pTmWord->
getObsClock() == pNULL)
00103 { setTestResult(
TEST_FAILURE,
"Wrong clock plug-in");
00104
return;
00105 }
00106
00107 setTestResult(
TEST_SUCCESS,
"Test Successful");
00108
return;
00109
00110 }