Generic hardware access library
/home/cschwick/hal/generic/classtester/src/common/ASCIIFileAddressTableContainerTester.cc
Go to the documentation of this file.
00001 #include "ASCIIFileAddressTableContainerTester.hh"
00002 #include <sstream>
00003 
00004 HAL::ASCIIFileAddressTableContainerTester::ASCIIFileAddressTableContainerTester( std::string moduleMapperFile,
00005                                                                             std::string addressTableContainerFile )
00006   throw( HAL::IllegalValueException,
00007          HAL::NoSuchFileException,
00008          HAL::XMLProcessingException,
00009          HAL::HardwareAccessException ) 
00010   : moduleMapper_(moduleMapperFile),
00011     addressTableContainer_(moduleMapper_,
00012                            addressTableContainerFile) {
00013 }
00014 
00015 
00016 std::string HAL::ASCIIFileAddressTableContainerTester::getDescription() const {
00017   std::stringstream text;
00018   text << "Tests the HAL::ASCIIFileAddressTableContainer.\n"
00019        << "You need to check the output manually!"
00020        << std::ends;
00021   return text.str();
00022 }
00023 
00024 bool HAL::ASCIIFileAddressTableContainerTester::execute() {
00025   try {
00026     HAL::VMEAddressTable tab1 = addressTableContainer_.getVMETableFromSerialNumber( "daqvme011" );
00027     tab1.print( cout );
00028     HAL::VMEAddressTable tab2 = addressTableContainer_.getVMETableFromSerialNumber( "daqvme021" );
00029     tab2.print( cout );
00030     HAL::VMEAddressTable tab3 = addressTableContainer_.getVMETableFromSerialNumber( "daqvme111" );
00031     tab3.print( cout );
00032     HAL::VMEAddressTable tab4 = addressTableContainer_.getVMETableFromSerialNumber( "daqvme121" );
00033     tab4.print( cout );
00034   } catch (HAL::HardwareAccessException& e) {
00035     std::cout << "!!! ERROR !!! UNEXPECTED EXCETPION !!!" << std::endl;
00036     std::cout << e.what() << std::endl;
00037     return false;
00038   }
00039   // all ok if arrived here
00040   return true;
00041 }