Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

TestCaseOutOfRangeProfile_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseOutOfRangeProfile_1.cpp 00005 // 00006 // Version 1.2 00007 // Date 11.04.03 (Version 1.1) 00008 // 01.10.03 (Version 1.2) 00009 // Author A. Pasetti (P&P Software), R. Totaro 00010 // 00011 // Change Record: 00012 // Version 1.2: replaced double and int with TD_Float and TD_Integer 00013 00014 #include "../GeneralInclude/CompilerSwitches.h" 00015 #include "../GeneralInclude/ClassId.h" 00016 #include "../GeneralInclude/TestConstants.h" 00017 #include "../GeneralInclude/Constants.h" 00018 #include "../FDIR/DC_OutOfRangeProfile.h" 00019 #include "../FDIR/RangeProfile.h" 00020 #include "TestCaseOutOfRangeProfile_1.h" 00021 00022 TestCaseOutOfRangeProfile_1::TestCaseOutOfRangeProfile_1(void) : 00023 TestCaseGenericSetUp(ID_OUTOFRANGEPROFILE*10+1,"TestCaseOutOfRangeProfile_1") { 00024 return; 00025 } 00026 00027 void TestCaseOutOfRangeProfile_1::runTestCase(void) { 00028 00029 DC_OutOfRangeProfile* mp = new DC_OutOfRangeProfile(); 00030 00031 // Check the value of the class identifier 00032 if ( mp->getClassId() != ID_OUTOFRANGEPROFILE ) 00033 { setTestResult(TEST_FAILURE, "Wrong class identifier"); 00034 return; 00035 } 00036 00037 // Configure the monitoring profile 00038 TD_Float lb = 10.0; 00039 TD_Float ub = 13.0; 00040 mp->setLowerBound(lb); 00041 mp->setUpperBound(ub); 00042 00043 // Check monitoring check for a case with "no deviation from profile" 00044 if ( mp->deviatesFromProfile((TD_Float)((lb+ub)/2.0)) ) 00045 { setTestResult(TEST_FAILURE, "Wrong monitoring check result"); 00046 return; 00047 } 00048 00049 // Check monitoring check for a case with "deviation from profile" 00050 if ( !mp->deviatesFromProfile((TD_Float)(ub+1.0)) ) 00051 { setTestResult(TEST_FAILURE, "Wrong monitoring check result"); 00052 return; 00053 } 00054 00055 setTestResult(TEST_SUCCESS,"Test Successful"); 00056 return; 00057 00058 }
Copyright 2003 P&P Software GmbH - All Rights Reserved