File indexing completed on 2023-03-17 11:26: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 ** ) try {
0007 initTest();
0008
0009 using namespace edm::storage;
0010 char buf[1024];
0011 std::unique_ptr<Storage> s =
0012 StorageFactory::get()->open("http://cern.ch/cmsbuild/cms/mc/this/file/does/not/exist.root");
0013 assert(s);
0014
0015 s->read(buf, sizeof(buf));
0016 s->close();
0017
0018 std::cout << "stats:\n" << StorageAccount::summaryText() << std::endl;
0019 return EXIT_FAILURE;
0020 } catch (cms::Exception const &e) {
0021 std::cerr << e.explainSelf() << std::endl;
0022 return EXIT_SUCCESS;
0023 } catch (std::exception const &e) {
0024 std::cerr << e.what() << std::endl;
0025 return EXIT_FAILURE;
0026 }