00001
00002
00003
00004
00005
00006
00007
00008
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
00025
DC_DummyTelecommand* pTc =
new DC_DummyTelecommand();
00026
00027
00028
if ( pTc->
getClassId() != ID_DUMMYTELECOMMAND )
00029 { setTestResult(
TEST_FAILURE,
"Wrong class identifier");
00030
return;
00031 }
00032
00033
00034
if ( pTc->
isObjectConfigured() )
00035 { setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00036
return;
00037 }
00038
00039
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
00066
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
00079 pTc->
setInUse(
true);
00080
if ( pTc->
isInUse() !=
true)
00081 { setTestResult(
TEST_FAILURE,
"Wrong value of InUse attribute");
00082
return;
00083 }
00084
00085
00086
if ( pTc->
getExecutionCounter() != 0 )
00087 { setTestResult(
TEST_FAILURE,
"Wrong initial value of execution counter");
00088
return;
00089 }
00090
00091
00092
if ( pTc->
getNumberOfRawData() != 0 )
00093 { setTestResult(
TEST_FAILURE,
"Wrong number of raw data");
00094
return;
00095 }
00096
00097
00098
if ( !pTc->
canExecute() )
00099 { setTestResult(
TEST_FAILURE,
"Wrong execution check return value");
00100
return;
00101 }
00102
00103
00104
if ( !pTc->
isValid() )
00105 { setTestResult(
TEST_FAILURE,
"Wrong validity check return value");
00106
return;
00107 }
00108
00109
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
00118
00119 pTc->
setExecutionCheckValue(
TC_CANNOT_EXECUTE);
00120
if ( pTc->
canExecute() )
00121 { setTestResult(
TEST_FAILURE,
"Wrong execution check return value");
00122
return;
00123 }
00124
00125
00126
00127 pTc->
setValidityCheckValue(
NOT_VALID);
00128
if ( pTc->
isValid() )
00129 { setTestResult(
TEST_FAILURE,
"Wrong validity check return value");
00130
return;
00131 }
00132
00133
00134
00135 pTc->
setExecutionCheckCode(1);
00136
if ( pTc->
getExecutionCheckCode()!=1 )
00137 { setTestResult(
TEST_FAILURE,
"Wrong execution check code");
00138
return;
00139 }
00140
00141
00142
00143 pTc->
setValidityCheckCode(1);
00144
if ( pTc->
getValidityCheckCode()!=1 )
00145 { setTestResult(
TEST_FAILURE,
"Wrong validity check code");
00146
return;
00147 }
00148
00149
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 }