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

TestCaseDummyObsClock_1.cpp

00001 // 00002 // Copyright 2004 P&P Software GmbH - All Rights Reserved 00003 // 00004 // TestCaseDummyObsClock_1.cpp 00005 // 00006 // Version 1.1 00007 // Date 14.04.03 00008 // Author A. Pasetti (P&P Software) 00009 00010 #include "TestCaseDummyObsClock_1.h" 00011 #include "../GeneralInclude/CompilerSwitches.h" 00012 #include "../GeneralInclude/ClassId.h" 00013 #include "../GeneralInclude/Constants.h" 00014 #include "../Base/CC_RootObject.h" 00015 #include "../System/DC_DummyObsClock.h" 00016 00017 TestCaseDummyObsClock_1::TestCaseDummyObsClock_1(void) : 00018 TestCaseGenericSetUp(ID_DUMMYOBSCLOCK*10+1,"TestCaseDummyObsClock_1") { 00019 return; 00020 } 00021 00022 void TestCaseDummyObsClock_1::runTestCase(void) { 00023 00024 DC_DummyObsClock* pClk = new DC_DummyObsClock(); 00025 00026 // Dummy OBS Clock objects should be configured upon creation 00027 if ( (pClk->isObjectConfigured() != CONFIGURED) ) 00028 { setTestResult(TEST_FAILURE, "Dummy OBS clock component should be configured"); 00029 return; 00030 } 00031 00032 // Check that the timing data have correct values (they should be zero 00033 // upon creation) 00034 if ( (pClk->getTime() != 0) || (pClk->getCycle() != 0) ) 00035 { setTestResult(TEST_FAILURE, "Incorrect timing initial values"); 00036 return; 00037 } 00038 00039 // Set the timing data 00040 pClk->setTime(10); 00041 pClk->setCycle(1); 00042 00043 // Check that the timing data have correct values 00044 if ( (pClk->getTime() != 10) || (pClk->getCycle() != 1) ) 00045 { setTestResult(TEST_FAILURE, "Incorrect timing values"); 00046 return; 00047 } 00048 00049 // Reset clock component and verify that time and cycle are reset to 0 00050 pClk->reset(); 00051 if ( (pClk->getTime() != 0) || (pClk->getCycle() != 0) ) 00052 { setTestResult(TEST_FAILURE, "Timing data have not been correctly reset"); 00053 return; 00054 } 00055 00056 // Do dummy method call 00057 pClk->synchronizeWithSystemTime(); 00058 00059 setTestResult(TEST_SUCCESS,"Test Successful"); 00060 return; 00061 }
Copyright 2003 P&P Software GmbH - All Rights Reserved