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 "../System/DC_DummyObsClock.h"
00015
#include "../Telecommand/DC_DummyCriticalTelecommand.h"
00016
#include "TestCaseDummyCriticalTelecommand_1.h"
00017
00018 TestCaseDummyCriticalTelecommand_1::TestCaseDummyCriticalTelecommand_1(
void) :
00019
TestCaseGenericSetUp(ID_DUMMYCRITICALTELECOMMAND*10+1,
00020 "
TestCaseDummyCriticalTelecommand_1") {
00021
return;
00022 }
00023
00024 void TestCaseDummyCriticalTelecommand_1::runTestCase(
void) {
00025
const TD_ObsTime timeTag =0;
00026
const TD_ObsTime maxArmedDuration=10;
00027
ObsClock *pObsClk =
new DC_DummyObsClock();
00028
DC_DummyCriticalTelecommand *pTC =
new DC_DummyCriticalTelecommand();
00029
00030
00031
if (pTC->
getClassId()!=ID_DUMMYCRITICALTELECOMMAND) {
00032 setTestResult(
TEST_FAILURE,
"Wrong class id");
00033
return;
00034 }
00035
00036
00037 pTC->
setTimeTag(timeTag);
00038
00039
00040
if (pTC->
isObjectConfigured()) {
00041 setTestResult(
TEST_FAILURE,
"Newly created object is configured");
00042
return;
00043 }
00044
00045
00046 pTC->
setMaxArmedDuration(maxArmedDuration);
00047
if (pTC->
isObjectConfigured()) {
00048 setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00049
return;
00050 }
00051
00052
00053
if (pTC->
getMaxArmedDuration()!=maxArmedDuration) {
00054 setTestResult(
TEST_FAILURE,
"getMaxArmedDuration() failed");
00055
return;
00056 }
00057
00058
00059 pTC->
setObsClock(pObsClk);
00060
if (!pTC->
isObjectConfigured()) {
00061 setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00062
return;
00063 }
00064
00065
00066
if (pTC->
getObsClock()!=pObsClk) {
00067 setTestResult(
TEST_FAILURE,
"getObsClock() failed");
00068
return;
00069 }
00070
00071
00072
if (!pTC->
isCritical()) {
00073 setTestResult(
TEST_FAILURE,
"Newly created TC is critical");
00074
return;
00075 }
00076
00077
00078
if (pTC->
isArmed()) {
00079 setTestResult(
TEST_FAILURE,
"Newly created TC is armed");
00080
return;
00081 }
00082
00083
00084 pTC->
setCriticalityLevel(
false);
00085
if (pTC->
isCritical()) {
00086 setTestResult(
TEST_FAILURE,
"setCriticalityLevel() failed");
00087
return;
00088 }
00089
00090
00091
if (pTC->
isImageValid()) {
00092 setTestResult(
TEST_FAILURE,
"The image of a newly created TC is valid");
00093
return;
00094 }
00095
00096 pTC->
setImageValidity(
true);
00097
if (!pTC->
isImageValid()) {
00098 setTestResult(
TEST_FAILURE,
"setImageValidity() failed");
00099
return;
00100 }
00101
00102
00103
if (pTC->
getTimeWhenArmed()>=0) {
00104 setTestResult(
TEST_FAILURE,
"Wrong initial \"time when armed\"");
00105
return;
00106 }
00107
00108 setTestResult(
TEST_SUCCESS,
"Test Successful");
00109
return;
00110 }