Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TestStat.h

Go to the documentation of this file.
00001 // ================================================
00002 // TestStat.h
00003 // A class for keeping track of test statistics 
00004 // ================================================
00005 #ifndef ATLFASTSHOWER_TESTSTAT_H
00006 #define ATLFASTSHOWER_TESTSTAT_H
00007 #include <string>
00008 
00009 class MsgStream;
00010 class ostream;
00011 
00012 namespace FastShower{
00013   class TestStat{
00014   public:
00015     TestStat():m_npass(0),m_ntest(0),m_mess("Failed: "){}
00016     TestStat(int pass, int test):
00017       m_npass(pass),
00018       m_ntest(test),
00019       m_mess("Failed: "){}
00020     TestStat& operator+=(const TestStat& t);
00021     void incPass()                           {++m_npass; ++m_ntest;}
00022     void incFail()                           {           ++m_ntest;}
00023     void incFail(std::string& s)             {
00024       ++m_ntest; cout<<m_mess<<s<<endl;}
00025     bool operator!()                   const {return m_npass!=m_ntest;}
00026     void reset()                             {m_npass=0; m_ntest=0;}
00027     int npass()                        const {return m_npass;}
00028     int ntest()                        const {return m_ntest;}
00029   private:
00030     int m_npass;
00031     int m_ntest;
00032     std::string m_mess;
00033   };
00034   ostream& operator<<(ostream&, const TestStat&); 
00035   TestStat& operator+ (const TestStat&, const TestStat); 
00036 }
00037 #endif
00038 
00039 
00040 
00041 
00042 
00043 

Generated on Tue Mar 18 11:50:07 2003 for FastShowerUtils by doxygen1.3-rc1