guitestresult.h

来自「著名的uncle Bob的Agile software development的」· C头文件 代码 · 共 60 行

H
60
字号


#ifndef CPPUNIT_GUITESTRESULT_H
#define CPPUNIT_GUITESTRESULT_H

#include <afxmt.h>

#ifndef TESTRESULT_H
#include "TestResult.h"
#endif

class TestRunnerDlg;



class GUITestResult : public TestResult 
{
public:
                        GUITestResult (TestRunnerDlg *runner);
                        ~GUITestResult ();

    void                addError    (Test *test, CppUnitException *e);
    void                addFailure  (Test *test, CppUnitException *e);

    void                endTest     (Test *test);
    void                stop ();

protected:
    class LightweightSynchronizationObject : public TestResult::SynchronizationObject
    {
        CCriticalSection    m_syncObject;

    public:
        void                lock ()     { m_syncObject.Lock (); }
        void                unlock ()   { m_syncObject.Unlock (); }
    };

private:
    TestRunnerDlg       *m_runner;
};



// Construct with lightweight synchronization
inline GUITestResult::GUITestResult (TestRunnerDlg *runner)
: m_runner (runner) { setSynchronizationObject (new LightweightSynchronizationObject ()); }


// Destructor
inline GUITestResult::~GUITestResult ()
{}


// Override without protection to prevent deadlock
inline void GUITestResult::stop ()
{ m_stop = true; }


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?