Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:14

0001 /*
0002  * Fake cpp_unit to be used if cpp_unit is not avaliable
0003  *
0004  */
0005 #include <utility>
0006 #include <iostream>
0007 
0008 namespace cppUnit {
0009 
0010    std::pair<int,int> & stats() {
0011     static std::pair<int,int> passedFailed(0,0);
0012     return  passedFailed;
0013   }
0014 
0015   bool test(bool pf) {
0016     if (pf) stats().first++;
0017     else stats().second++;
0018     return pf;
0019   }
0020 
0021   struct Dump {
0022     Dump(){}
0023     ~Dump(){
0024       std::cerr << "Test passed: " << stats().first << std::endl;
0025       std::cerr << "Test failed: " << stats().second << std::endl;
0026     }
0027   };
0028 
0029   
0030 }
0031 
0032 #define CPPUNIT_ASSERT(x) if (!cppUnit::test(x)) std::cerr<< "failed  "<< #x << std::endl;
0033