|
我有一个继承自mfcCButton 的类CXButton
class CXButton: public CButton
{
public:
//##ModelId=4558394500CD
CXButton();
public:
int m_iSpeed;
void SetSpeed(int nSpeed) { m_iSpeed = nSpeed; }
int GetSpeed() { return m_iSpeed; }
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CButtonEx)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CXButton();
// Generated message map functions
protected:
//{{AFX_MSG(CButtonEx)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
问题,我如何用CppUnit来测试这个类的如下三个成员函数呢:
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
因为这三个成员函数都没有返回值,而CppUnit的Asset都是根据返回值了做判断的。。 |
|