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 TESTATLFAST_TESTSTAT_H
00006 #define TESTATLFAST_TESTSTAT_H
00007 #include <string>
00008 
00009 class MsgStream;
00010 class ostream;
00011 
00012 namespace TestAtlfast{
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   MsgStream& operator<<(MsgStream&, const TestStat&); 
00035   ostream& operator<<(ostream&, const TestStat&); 
00036   MsgStream& operator+ (const TestStat&, const TestStat); 
00037 }
00038 #endif
00039 
00040 
00041 
00042 
00043 
00044 

Generated on Thu Apr 18 12:04:30 2002 for TestAtlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001