Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:46

0001 #include "FWCore/Utilities/interface/Exception.h"
0002 #include "Utilities/StorageFactory/interface/Storage.h"
0003 #include "Utilities/StorageFactory/test/Test.h"
0004 #include <cassert>
0005 
0006 int main(int, char ** /*argv*/) try {
0007   initTest();
0008 
0009   using namespace edm::storage;
0010   IOSize n;
0011   IOSize size = 1024;
0012   char buf[size];
0013   std::unique_ptr<Storage> s = StorageFactory::get()->open(
0014       "http://cern.ch/cmsbuild/cms/Run2011A/PhotonHad/AOD"
0015       "/12Oct2013-v1/00000/024938EB-3445-E311-A72B-002590593920.root");
0016   assert(s);
0017 
0018   if ((n = s->read(buf, sizeof(buf)) != size)) {
0019     std::cout << "Requested: " << size << " Got: " << n;
0020     s->close();
0021     std::cout << "stats:\n" << StorageAccount::summaryText() << std::endl;
0022     return EXIT_FAILURE;
0023   }
0024   s->close();
0025   std::cout << "stats:\n" << StorageAccount::summaryText() << std::endl;
0026   return EXIT_SUCCESS;
0027 } catch (cms::Exception const &e) {
0028   std::cerr << e.explainSelf() << std::endl;
0029   return EXIT_FAILURE;
0030 } catch (std::exception const &e) {
0031   std::cerr << e.what() << std::endl;
0032   return EXIT_FAILURE;
0033 }