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

TestCaseDummyConfigurableManoeuvre_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseDummyConfigurableManoeuvre_1.cpp 00005 // 00006 // Version 1.0 00007 // Date 06.05.03 00008 // Author R. Totaro 00009 00010 #include "TestCaseDummyConfigurableManoeuvre_1.h" 00011 #include "../GeneralInclude/ClassId.h" 00012 #include "../GeneralInclude/Constants.h" 00013 #include "../GeneralInclude/CompilerSwitches.h" 00014 #include "../Manoeuvre/DC_DummyConfigurableManoeuvre.h" 00015 00016 TestCaseDummyConfigurableManoeuvre_1::TestCaseDummyConfigurableManoeuvre_1(void) : 00017 TestCaseGenericSetUp(ID_DUMMYCONFIGURABLEMANOEUVRE*10+1, 00018 "TestCaseDummyConfigurableManoeuvre_1") { 00019 return; 00020 } 00021 00022 void TestCaseDummyConfigurableManoeuvre_1::runTestCase(void) { 00023 DC_DummyConfigurableManoeuvre *pDCM=new DC_DummyConfigurableManoeuvre(); 00024 00025 // Verify correctness of class identifier 00026 if (pDCM->getClassId()!=ID_DUMMYCONFIGURABLEMANOEUVRE) { 00027 setTestResult(TEST_FAILURE,"Wrong class identifier"); 00028 return; 00029 } 00030 00031 // Check that the action counters are set to zero 00032 if (pDCM->getInitializationActionCounter()!=0 || 00033 pDCM->getContinuationActionCounter() !=0 || 00034 pDCM->getTerminationActionCounter() !=0) { 00035 setTestResult(TEST_FAILURE,"Action counter(s) not equal to zero"); 00036 return; 00037 } 00038 00039 // Verify the canStart() return value 00040 pDCM->setInUse(true); 00041 if (pDCM->canStart()!=MAN_CANNOT_START) { 00042 setTestResult(TEST_FAILURE,"Incorrect canStart() return value"); 00043 return; 00044 } 00045 00046 // Verify that the initializationActionCounter is incremented 00047 pDCM->initialize(); 00048 if (pDCM->getInitializationActionCounter()!=1) { 00049 setTestResult(TEST_FAILURE,"initializationActionCounter not incremented"); 00050 return; 00051 } 00052 00053 // Verify that the continuationActionCounter is incremented 00054 pDCM->doContinue(); 00055 if (pDCM->getContinuationActionCounter()!=1) { 00056 setTestResult(TEST_FAILURE,"continuationActionCounter not incremented"); 00057 return; 00058 } 00059 00060 // Check that the continuation flag is properly set 00061 if (pDCM->canContinue()!=MAN_CANNOT_CONTINUE) { 00062 setTestResult(TEST_FAILURE,"Incorrect canContinue() return value"); 00063 return; 00064 } 00065 00066 // Check that the termination flag is properly set 00067 if (pDCM->isFinished()!=MAN_HAS_NOT_TERMINATED) { 00068 setTestResult(TEST_FAILURE,"Incorrect isFinished() return value"); 00069 return; 00070 } 00071 00072 // Verify that the terminationActionCounter is incremented 00073 pDCM->terminate(); 00074 if (pDCM->getTerminationActionCounter()!=1) { 00075 setTestResult(TEST_FAILURE,"terminationActionCounter not incremented"); 00076 return; 00077 } 00078 00079 // Check that the status flags can be modified 00080 pDCM->setStartCheckStatus(MAN_CAN_START); 00081 pDCM->setContinuationCheckStatus(MAN_CAN_CONTINUE); 00082 pDCM->setTerminationCheckStatus(MAN_HAS_TERMINATED); 00083 00084 pDCM->initialize(); 00085 00086 if (pDCM->canStart()!=MAN_CAN_START) { 00087 setTestResult(TEST_FAILURE,"Incorrect canStart() return value"); 00088 return; 00089 } 00090 00091 pDCM->doContinue(); 00092 00093 if (pDCM->canContinue()!=MAN_CAN_CONTINUE) { 00094 setTestResult(TEST_FAILURE,"Incorrect canContinue() return value"); 00095 return; 00096 } 00097 00098 if (pDCM->isFinished()!=MAN_HAS_TERMINATED) { 00099 setTestResult(TEST_FAILURE,"Incorrect isFinished() return value"); 00100 return; 00101 } 00102 00103 pDCM->terminate(); 00104 00105 setTestResult(TEST_SUCCESS,"Test Successful"); 00106 return; 00107 }
Copyright 2003 P&P Software GmbH - All Rights Reserved