diff --git a/examples/Persistency/CMakeLists.txt b/examples/Persistency/CMakeLists.txt index d56251dbb83f759c21ed2e65462f79151d756886..8ed335005f02f359f31ac33d7ced28551a020907 100644 --- a/examples/Persistency/CMakeLists.txt +++ b/examples/Persistency/CMakeLists.txt @@ -28,7 +28,7 @@ dd4hep_add_test_reg( Persist_Conditions_Save COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" EXEC_ARGS geoPluginRun -plugin DD4hep_PersistencyExample_write_cond -output Conditions.root - REGEX_PASS "\\+\\+\\+ Wrote 1360 bytes to file Conditions.root" + REGEX_PASS "\\+\\+\\+ PASSED Wrote 14 conditions to file." REGEX_FAIL " ERROR ;EXCEPTION;Exception;FAILED" ) # @@ -37,7 +37,7 @@ dd4hep_add_test_reg( Persist_Conditions_Restore COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" EXEC_ARGS geoPluginRun -plugin DD4hep_PersistencyExample_read_cond -input Conditions.root - REGEX_PASS "\\+\\+\\+ Read successfully 14 conditions. Result=1637" + REGEX_PASS "\\+\\+\\+ Read successfully 14 conditions. Result=172" REGEX_FAIL " ERROR ;EXCEPTION;Exception;FAILED" ) # diff --git a/examples/Persistency/src/PersistencySetup.cpp b/examples/Persistency/src/PersistencySetup.cpp index aea2ad59be32ad9381b4f0bb7ae02742b92d2647..95f170b08de9ecc3954b699e8f89fe942ab46700 100644 --- a/examples/Persistency/src/PersistencySetup.cpp +++ b/examples/Persistency/src/PersistencySetup.cpp @@ -37,7 +37,7 @@ int dd4hep::PersistencyExamples::printCondition(Condition cond) { else if ( gr->type() == typeid(string) ) result += cond.get<string>().length(); else if ( gr->type() == typeid(Delta) ) - result += sizeof(cond.get<Delta>()); + { ++result; cond.get<Delta>(); } else if ( gr->type() == typeid(AlignmentData) ) { if ( dynamic_cast<detail::AlignmentObject*>(cond.ptr()) ) { AlignmentCondition ac = cond; @@ -47,7 +47,8 @@ int dd4hep::PersistencyExamples::printCondition(Condition cond) { ok ? "SUCCESS" : "ERROR", cond.name(),cond.data().ptr(),&ac->values(), ok ? "[Good-payload-mapping]" : "[Bad-payload-mapping]"); } - result += sizeof(cond.get<AlignmentData>()); + ++result; + cond.get<AlignmentData>(); } else if ( gr->type() == typeid(vector<int>) ) result += int(cond.get<vector<int> >().size()); diff --git a/examples/Persistency/src/TestWriteConditions.cpp b/examples/Persistency/src/TestWriteConditions.cpp index dbf5580e92f47830ea1d97fc3f2d96006122579b..8ee682f1fea432799238000f43666c587edcf98b 100644 --- a/examples/Persistency/src/TestWriteConditions.cpp +++ b/examples/Persistency/src/TestWriteConditions.cpp @@ -108,7 +108,8 @@ static int persistency_example (Detector& /* description */, int argc, char** ar printout(INFO,"Example","+++ Writing generic conditions vector to %s",output.c_str()); int nbytes = io.write(output,"Conditions",conditions); printout(INFO,"Example","+++ Wrote %d bytes to file %s",nbytes,output.c_str()); - + printout(INFO,"Example","+++ %s %ld conditions to file.", + nbytes > 0 ? "PASSED Wrote" : "FAILED +++ Could not write",conditions.size()); // All done. return 1; }