00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
#include "../GeneralInclude/CompilerSwitches.h"
00015
#include "../GeneralInclude/ClassId.h"
00016
#include "../GeneralInclude/TestConstants.h"
00017
#include "../GeneralInclude/Constants.h"
00018
#include "../FDIR/MonitoringProfile.h"
00019
#include "../FDIR/DC_StuckDataProfile.h"
00020
#include "../Event/DC_EventRepository.h"
00021
#include "TestCaseStuckDataProfile_1.h"
00022
00023 TestCaseStuckDataProfile_1::TestCaseStuckDataProfile_1(
void) :
00024
TestCaseGenericSetUp(ID_STUCKDATAPROFILE*10+1,"
TestCaseStuckDataProfile_1") {
00025
return;
00026 }
00027
00028 void TestCaseStuckDataProfile_1::runTestCase(
void) {
00029
00030
DC_StuckDataProfile* mp =
new DC_StuckDataProfile();
00031
unsigned int stuckThreshold = 2;
00032
TD_Integer sv = 10;
00033
00034
00035
if ( mp->
getClassId() != ID_STUCKDATAPROFILE )
00036 { setTestResult(
TEST_FAILURE,
"Wrong class identifier");
00037
return;
00038 }
00039
00040
00041
if ( mp->
isObjectConfigured() )
00042 { setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00043
return;
00044 }
00045
00046
00047 mp->
setStuckThreshold(stuckThreshold);
00048
if ( mp->
getStuckThreshold() != stuckThreshold )
00049 { setTestResult(
TEST_FAILURE,
"Wrong stuck threshold value");
00050
return;
00051 }
00052
00053
00054
if ( !mp->
isObjectConfigured() )
00055 { setTestResult(
TEST_FAILURE,
"Wrong configuration status");
00056
return;
00057 }
00058
00059
00060
if ( mp->
deviatesFromProfile(sv) )
00061 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00062
return;
00063 }
00064
if ( mp->
deviatesFromProfile(sv) )
00065 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00066
return;
00067 }
00068
if ( mp->
deviatesFromProfile((
TD_Integer)(sv+1)) )
00069 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00070
return;
00071 }
00072
00073
00074
if ( mp->
deviatesFromProfile(sv) )
00075 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00076
return;
00077 }
00078
if ( mp->
deviatesFromProfile(sv) )
00079 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00080
return;
00081 }
00082
if ( !mp->
deviatesFromProfile(sv) )
00083 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00084
return;
00085 }
00086
00087
00088
if ( mp->
deviatesFromProfile((
TD_Integer)(sv+1)) )
00089 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00090
return;
00091 }
00092
if ( mp->
deviatesFromProfile((
TD_Integer)(sv+1)) )
00093 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00094
return;
00095 }
00096 mp->
reset();
00097
if ( mp->
deviatesFromProfile((
TD_Integer)(sv+1)) )
00098 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00099
return;
00100 }
00101
if ( mp->
deviatesFromProfile((
TD_Integer)(sv+1)) )
00102 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00103
return;
00104 }
00105
if ( !mp->
deviatesFromProfile((
TD_Integer)(sv+1)) )
00106 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result");
00107
return;
00108 }
00109
00110
00111
if (
isNonNominalCheckAllowed()) {
00112
if ( !mp->
deviatesFromProfile((
TD_Float)1.0) )
00113 { setTestResult(
TEST_FAILURE,
"Wrong monitoring check result for real-valued argument");
00114
return;
00115 }
00116 }
00117
00118 setTestResult(
TEST_SUCCESS,
"Test Successful");
00119
return;
00120
00121 }