Commits

ca...@4525493e-7705-40b1-a816-d608a930855b  committed 048a9b6

fixed unit tests

  • Participants
  • Parent commits d6c3ea6

Comments (0)

Files changed (4)

+2011-10-05  Paolo Calafiura  <calaf@localhost6.localdomain6>
+
+        * tagging CLIDComps-00-06-04
+	* test/CLIDRegistry_test.cxx (main): fixed unit tests
+
 2011-04-28  Charles Leggett
 
         * tagging CLIDComps-00-06-03

File cmt/requirements

 private
 use TestTools       TestTools-*          AtlasTest
 apply_pattern install_runtime
-apply_pattern UnitTest_run unit_test=ClassIDSvc
+apply_pattern UnitTest_run unit_test=ClassIDSvc \
+  extrapatterns="WARNING Could not resolve clid DB"
 apply_pattern UnitTest_run unit_test=CLIDRegistry
 macro_append DOXYGEN_INPUT " ../test ../share " 
 macro_append DOXYGEN_FILE_PATTERNS    " *.icc clid "

File share/ClassIDSvc_test.ref

 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr $Revision: 1.77 $
-                                          running on lxplus438.cern.ch on Fri Apr 29 01:28:58 2011
+                                          running on lxplus424.cern.ch on Thu Oct  6 02:25:36 2011
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
-HistogramPersis...   INFO  'CnvServices':[ 'HbookHistSvc' , 'RootHistSvc' ]
 HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
-ClassIDSvc           INFO Initializing ClassIDSvc - package version CLIDComps-00-06-00
+ClassIDSvc           INFO Initializing ClassIDSvc - package version CLIDComps-00-06-03
 ClassIDSvc          DEBUG Service base class initialized successfully
-ClassIDSvc        WARNING Could not resolve clid DB path notthere.db using DATAPATH [/afs/cern.ch/user/c/calaf/scratch0/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasOffline/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasAnalysis/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasSimulation/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasTrigger/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasReconstruction/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasEvent/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasConditions/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasCore/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/DetCommon/rel_2/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/GAUDI/rel_2/InstallArea/share:/afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_60b/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/GAUDI/rel_2/PartPropSvc/share:/afs/cern.ch/atlas/offline/ReleaseData/v15:/afs/cern.ch/atlas/offline/ReleaseData/v15/testfile:/afs/cern.ch/atlas/project/magfield/CTB] ----- SKIPPING
-ClassIDSvc           INFO  getRegistryEntries: read 3 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 3 CLIDRegistry entries for module ALL
+ClassIDSvc        WARNING Could not resolve clid DB path notthere.db using DATAPATH [/afs/cern.ch/user/c/calaf/scratch0/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasOffline/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasAnalysis/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasSimulation/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasTrigger/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasReconstruction/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasEvent/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasConditions/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasCore/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/DetCommon/rel_0/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/GAUDI/rel_0/InstallArea/share:/afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_61/InstallArea/share:/afs/cern.ch/atlas/software/builds/nightlies/dev/GAUDI/rel_0/PartPropSvc/share:/afs/cern.ch/atlas/offline/ReleaseData/v15:/afs/cern.ch/atlas/offline/ReleaseData/v15/testfile:/afs/cern.ch/atlas/project/magfield/CTB] ----- SKIPPING
+ClassIDSvc           INFO  getRegistryEntries: read 36 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 36 CLIDRegistry entries for module ALL
 Now we expect to see an error message:
 ----Error Message Starts--->>
 ClassIDSvc          FATAL setTypeNameForID: input id 128 is out of allowed range 256 : 2147483647
 <<---Error Message Ends-------
 Now we expect to see an error message:
 ----Error Message Starts--->>
-ClassIDSvc          ERROR uncheckedSetTypePackageForID: CLIDComps-00-06-00 can not set type name <Ble> for CLID 7890: Known name for this ID <Bla> It was set by APack-00-39-98
+ClassIDSvc          ERROR uncheckedSetTypePackageForID: CLIDComps-00-06-03 can not set type name <Ble> for CLID 7890: Known name for this ID <Bla> It was set by APack-00-39-98
 <<---Error Message Ends-------
 Now we expect to see an error message:
 ----Error Message Starts--->>
-ClassIDSvc          ERROR uncheckedSetTypePackageForID: CLIDComps-00-06-00 can not set CLID <9945> for type name Bli: Known CLID for this name <9942> It was set by CLIDComps-00-06-00
+ClassIDSvc          ERROR uncheckedSetTypePackageForID: CLIDComps-00-06-03 can not set CLID <9945> for type name Bli: Known CLID for this name <9942> It was set by CLIDComps-00-06-03
 <<---Error Message Ends-------
 Now we expect to see an error message:
 ----Error Message Starts--->>
 ----Error Message Starts--->>
 ClassIDSvc          ERROR uncheckedSetTypePackageForID: APack-00-39-98 can not set type name <B  l a> for CLID 7890: Known name for this ID <Bla> It was set by APack-00-39-98
 <<---Error Message Ends-------
-ClassIDSvc           INFO finalize: wrote 1025 entries to output CLIDDB file: CLIDTestOut.db
+ClassIDSvc           INFO finalize: wrote 1064 entries to output CLIDDB file: CLIDTestOut.db
 *** ClassIDSvc_test OK ***

File test/CLIDRegistry_test.cxx

   CLIDRegistry::addEntry<12>("Foo", info, "Foo");
   //no upper limit  CLIDRegistry::addEntry<1245736740>("Foo", info);
 #endif
+  unsigned int clids = distance(CLIDRegistry::begin(), CLIDRegistry::end());
   CLIDRegistry::addEntry<1234>("Foo", info, "Foo");
   CLIDRegistry::addEntry<4321>("Bar", info, "Bar");
-  assert( distance(CLIDRegistry::begin(), CLIDRegistry::end()) == 2 );
-  assert( get<0>(*CLIDRegistry::begin()) == 1234 );
-  assert( get<1>(*CLIDRegistry::begin()) == "Foo" );
-  assert( get<2>(*CLIDRegistry::begin()).name() == "CLIDComps" );
+  CLIDRegistry::const_iterator i(CLIDRegistry::begin()), e(CLIDRegistry::end());
+  unsigned int newClids = distance(CLIDRegistry::begin(), CLIDRegistry::end()) - clids;
+
+  assert( newClids == 2 );
+  assert( get<0>(*(CLIDRegistry::end()-2)) == 1234 );
+  assert( get<1>(*(CLIDRegistry::end()-2)) == "Foo" );
+  assert( get<2>(*(CLIDRegistry::end()-2)).name() == "CLIDComps" );
   cerr << "*** CLIDRegistry_test OK ***" <<endl;
   return 0;
 }