Generic hardware access library
|
00001 #include "XMLAddressTableTester.hh" 00002 #include <sstream> 00003 00004 std::string HAL::XMLAddressTableTester::getDescription() const { 00005 std::stringstream text; 00006 text << "Tests the boundary check if the XMLAddressTable.\n" 00007 << "The function checkAddressLimits(item, offset) is\n" 00008 << "used to perform the test" 00009 << std::ends; 00010 return text.str(); 00011 } 00012 00013 bool HAL::XMLAddressTableTester::execute() { 00014 try { 00015 HAL::VMEAddressTableXMLFileReader reader1( VMEXMLADDRESSTABLE_1 ); 00016 HAL::VMEAddressTable table1( "VMEADDRESSTABLE1", reader1); 00017 00018 // display table: 00019 std::cout << "\n\n\n\n"; 00020 table1.print(); 00021 std::cout << "\n"; 00022 00023 HAL::VMEAddressTableXMLFileReader reader2( VME64xXMLADDRESSTABLE_1 ); 00024 HAL::VMEAddressTable table2( "VMEADDRESSTABLE2", reader2); 00025 00026 // display table: 00027 std::cout << "\n\n\n\n"; 00028 table2.print(); 00029 std::cout << "\n"; 00030 00031 HAL::PCIAddressTableXMLFileReader reader3( PCIXMLADDRESSTABLE_1 ); 00032 HAL::PCIAddressTable table3( "PCIADDRESSTABLE1", reader3 ); 00033 00034 // display table: 00035 std::cout << "\n\n\n\n"; 00036 table3.print(); 00037 std::cout << "\n"; 00038 00039 00040 } catch (HAL::HardwareAccessException& e) { 00041 std::cout << "!!! ERROR !!! UNEXPECTED EXCETPION !!!" << std::endl; 00042 std::cout << e.what() << std::endl; 00043 return false; 00044 } 00045 // all ok if arrived here 00046 return true; 00047 }