00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
#include "TestCaseTestPUSConfigurableManoeuvre_1.h"
00011
#include "../GeneralInclude/ClassId.h"
00012
#include "../GeneralInclude/Constants.h"
00013
#include "../GeneralInclude/CompilerSwitches.h"
00014
#include "../Utilities/TestCaseWithEvtCheck.h"
00015
#include "../Manoeuvre/DC_TestPUSConfigurableManoeuvre.h"
00016
00017 TestCaseTestPUSConfigurableManoeuvre_1::TestCaseTestPUSConfigurableManoeuvre_1(
void) :
00018
TestCaseWithEvtCheck(ID_TESTPUSCONFIGURABLEMANOEUVRE*10+1,
00019 "
TestCaseTestPUSConfigurableManoeuvre_1") {
00020
return;
00021 }
00022
00023 void TestCaseTestPUSConfigurableManoeuvre_1::runTestCase(
void) {
00024
DC_TestPUSConfigurableManoeuvre *pDCM=
new DC_TestPUSConfigurableManoeuvre();
00025
00026
00027
if (pDCM->
getClassId()!=ID_TESTPUSCONFIGURABLEMANOEUVRE) {
00028 setTestResult(
TEST_FAILURE,
"Wrong class identifier");
00029
return;
00030 }
00031
00032
00033
if (pDCM->
getInitializationActionCounter()!=0 ||
00034 pDCM->
getContinuationActionCounter() !=0 ||
00035 pDCM->
getTerminationActionCounter() !=0) {
00036 setTestResult(
TEST_FAILURE,
"Action counter(s) not equal to zero");
00037
return;
00038 }
00039
00040
00041
if (pDCM->
isCompletionAckRequired() || pDCM->
isProgressAckRequired() || pDCM->
isStartAckRequired() ) {
00042 setTestResult(
TEST_FAILURE,
"Incorrect acknowledge flag default values");
00043
return;
00044 }
00045
00046
00047 pDCM->
setStartAckFlag(
true);
00048 pDCM->
setCompletionAckFlag(
true);
00049 pDCM->
setProgressAckFlag(
true);
00050
if (!pDCM->
isCompletionAckRequired() || !pDCM->
isProgressAckRequired()) {
00051 setTestResult(
TEST_FAILURE,
"Incorrect acknowledge flag default values");
00052
return;
00053 }
00054
00055
00056 pDCM->
setTelecommandId(13);
00057
if (pDCM->
getTelecommandId()!=13) {
00058 setTestResult(
TEST_FAILURE,
"Incorrect telecommand ID value");
00059
return;
00060 }
00061
00062
00063 pDCM->
setInUse(
true);
00064
if (pDCM->
canStart()!=
MAN_CANNOT_START) {
00065 setTestResult(
TEST_FAILURE,
"Incorrect canStart() return value");
00066
return;
00067 }
00068
00069
00070 pDCM->
initialize();
00071
if (pDCM->
getInitializationActionCounter()!=1) {
00072 setTestResult(
TEST_FAILURE,
"initializationActionCounter not incremented");
00073
return;
00074 }
00075
00076
00077 pDCM->
doContinue();
00078
if (pDCM->
getContinuationActionCounter()!=1) {
00079 setTestResult(
TEST_FAILURE,
"continuationActionCounter not incremented");
00080
return;
00081 }
00082
00083
00084
unsigned int nEvt = this->
getNumberOfEvents();
00085 pDCM->
doContinue();
00086
if (pDCM->
getContinuationActionCounter()!=2) {
00087 setTestResult(
TEST_FAILURE,
"continuationActionCounter not incremented");
00088
return;
00089 }
00090
if (!verifyLatestEvent(nEvt+1,EVT_MAN_PROGRESS))
00091
return;
00092
00093
00094
if (pDCM->
canContinue()!=
MAN_CANNOT_CONTINUE) {
00095 setTestResult(
TEST_FAILURE,
"Incorrect canContinue() return value");
00096
return;
00097 }
00098
00099
00100
if (pDCM->
isFinished()!=
MAN_HAS_NOT_TERMINATED) {
00101 setTestResult(
TEST_FAILURE,
"Incorrect isFinished() return value");
00102
return;
00103 }
00104
00105
00106 pDCM->
terminate();
00107
if (pDCM->
getTerminationActionCounter()!=1) {
00108 setTestResult(
TEST_FAILURE,
"terminationActionCounter not incremented");
00109
return;
00110 }
00111
00112
00113 pDCM->
setStartCheckStatus(
MAN_CAN_START);
00114 pDCM->
setContinuationCheckStatus(
MAN_CAN_CONTINUE);
00115 pDCM->
setTerminationCheckStatus(
MAN_HAS_TERMINATED);
00116
00117 pDCM->
initialize();
00118
00119
if (pDCM->
canStart()!=
MAN_CAN_START) {
00120 setTestResult(
TEST_FAILURE,
"Incorrect canStart() return value");
00121
return;
00122 }
00123
00124 pDCM->
doContinue();
00125
00126
if (pDCM->
canContinue()!=
MAN_CAN_CONTINUE) {
00127 setTestResult(
TEST_FAILURE,
"Incorrect canContinue() return value");
00128
return;
00129 }
00130
00131
if (pDCM->
isFinished()!=
MAN_HAS_TERMINATED) {
00132 setTestResult(
TEST_FAILURE,
"Incorrect isFinished() return value");
00133
return;
00134 }
00135
00136 pDCM->
terminate();
00137
00138 setTestResult(
TEST_SUCCESS,
"Test Successful");
00139
return;
00140 }