Generic hardware access library
/home/cschwick/hal/generic/classtester/src/common/VME64xFunctionTesterStandard.cc
Go to the documentation of this file.
00001 #include "VME64xFunctionTesterStandard.hh"
00002 
00003 std::string HAL::VME64xFunctionTesterStandard::getName() const {
00004   return("VME64xFunctionTesterStandard");
00005 }
00006 
00007 std::string HAL::VME64xFunctionTesterStandard::getDescription() const {
00008   std::string text = "Tests the class for with the constructor for the standard VME modules";
00009   return text;
00010 }
00011 
00012 bool HAL::VME64xFunctionTesterStandard::execute() {
00013   bool result = true;
00014   HAL::VME64xFunction function = HAL::VME64xFunction( 7,0x001000,3 );
00015   if ( function.getNumberOfMappedWindows() != 1 ) result = false;
00016   if ( ! function.isImplemented() ) result = false;
00017   if ( function.getAddressRank() != 3 ) result = false;
00018 
00019   std::list< HAL::VME64xMappedWindow* > windowList;
00020   windowList = function.getMappedWindowPtrList();
00021   if ( windowList.size() != 1 ) result = false;
00022 
00023   HAL::VME64xMappedWindow* window = windowList.front();
00024 
00025   if ( window->getDataAccessWidth()!=0 ) result = false;
00026   if ( window->getAddressRank() != 3 ) result = false;
00027   if ( window->getAM() != 0  ) result = false;
00028   if ( window->getMappedWindowId() != 0 ) result = false;
00029   if ( window->getBaseaddress() != 0x001000 ) result = false;
00030   if ( ! window->isConfigured() ) result = false;
00031   if ( ! window->isImplemented() ) result = false;
00032   if ( window->hasAnotherWindow() ) result = false;
00033 
00034   try {
00035     window->setADER( 0x100, 0x39 );
00036     result = false;
00037   } catch( HAL::IllegalOperationException& e ) {
00038     std::cout << e.what();
00039   } catch ( HAL::HardwareAccessException& e ) {
00040     std::cout << e.what();
00041     result = false;
00042   }
00043   return result;
00044 }