Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:46:38

0001 #include "CondFormats/Common/interface/IOVSequence.h"
0002 
0003 #include<iostream>
0004 
0005 int main() {
0006 
0007 
0008   cond::IOVSequence iov;
0009   
0010   iov.add(10,"a","class0");
0011   iov.add(20,"b","class0");
0012   if (iov.add(30,"c","class0")!=2) std::cerr << "error pos" << std::endl;
0013   iov.add(40,"e","class0");
0014 
0015   {
0016     cond::IOVSequence::Container const & v = iov.iovs();
0017 
0018     if (v.size()!=4) std::cerr << "error size" << std::endl;
0019     
0020     if (iov.find(0)!=v.end()) std::cerr << "error find 0" << std::endl;
0021     if (iov.find(5)!=v.end()) std::cerr << "error find 5" << std::endl;
0022     if (iov.find(10)!=v.begin()) std::cerr << "error find 10" << std::endl;
0023     if (iov.find(15)!=(v.begin())) std::cerr << "error find 15" << std::endl;
0024     if (iov.find(25)!=(v.begin()+1)) std::cerr << "error find 25" << std::endl;
0025     if (iov.find(35)!=(v.begin()+2)) std::cerr << "error find 35" << std::endl;
0026     if (iov.find(36)!=(v.begin()+2)) std::cerr << "error find 36" << std::endl;
0027     if (iov.find(40)!=v.end()-1) std::cerr << "error find 40" << std::endl;
0028     if (iov.find(45)!=v.end()-1) std::cerr << "error find 45" << std::endl;
0029     if (iov.findSince(12)!=v.end()) std::cerr << "error findSince 12" << std::endl;
0030     if (iov.findSince(20)!=(v.begin()+1)) std::cerr << "error findSince 20" << std::endl;
0031 
0032 
0033     if (iov.add(50,"f","class0")!=4)  std::cerr << "error in add"  << std::endl;
0034     if (iov.find(45)!=v.end()-2) std::cerr << "error find 45" << std::endl;
0035     if(iov.truncate()!=3)  std::cerr << "error in truncation"  << std::endl;
0036     if (iov.find(45)!=v.end()-1) std::cerr << "error find 45" << std::endl;
0037 
0038     if (iov.add(50,"f","class0")!=4)  std::cerr << "error in add"  << std::endl;
0039     if (iov.find(45)!=v.end()-2) std::cerr << "error find 45" << std::endl;
0040     if(iov.truncate()!=3)  std::cerr << "error in truncation"  << std::endl;
0041     if (iov.find(45)!=v.end()-1) std::cerr << "error find 45" << std::endl;
0042 
0043  
0044 
0045   }
0046 
0047   if(iov.notOrdered()) std::cerr << "error notOrdered" << std::endl;
0048 
0049   iov.add(35,"d","class0");
0050   if(!iov.notOrdered()) std::cerr << "error not notOrdered" << std::endl;
0051 
0052   { 
0053 
0054     cond::IOVSequence::Container const & v = iov.iovs();
0055 
0056     if (v.size()!=5) std::cerr << "error size" << std::endl;
0057     if (iov.find(25)!=(v.begin()+1)) std::cerr << "error find 25" << std::endl;
0058     if (iov.find(35)!=(v.begin()+3)) std::cerr << "error find 35" << std::endl;
0059     if (iov.find(36)!=(v.begin()+3)) std::cerr << "error find 36" << std::endl;
0060 
0061 
0062     if(!iov.notOrdered()) std::cerr << "error not notOrdered" << std::endl;
0063 
0064 
0065   }
0066 
0067 
0068 
0069   return 0;
0070 
0071 }