232fdc630c
Add a lot of tests for many wx GUI classes. Add tests using the new wxUIActionSimulator class but disable them under OS X as too many of them currently fail there. Refactor the test suite to make organizing the existing tests and adding the new ones easier. Improve documentation using the information gathered while testing the classes. Also update the documentation of the testing system itself. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
39 lines
911 B
C++
39 lines
911 B
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Name: testableframe.h
|
|
// Purpose: An improved wxFrame for unit-testing
|
|
// Author: Steven Lamerton
|
|
// RCS-ID: $Id:$
|
|
// Copyright: (c) 2010 Steven Lamerton
|
|
// Licence: wxWidgets licence
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "wx/frame.h"
|
|
#include "wx/hashmap.h"
|
|
#include "wx/event.h"
|
|
|
|
class wxTestableFrame : public wxFrame
|
|
{
|
|
public:
|
|
wxTestableFrame();
|
|
|
|
void OnEvent(wxEvent& evt);
|
|
|
|
//wxEVT_ANY get the count for all events or a type can be specified
|
|
int GetEventCount(wxEventType type = wxEVT_ANY);
|
|
|
|
private:
|
|
wxLongToLongHashMap m_count;
|
|
};
|
|
|
|
class EventCounter
|
|
{
|
|
public:
|
|
EventCounter(wxWindow* win, wxEventType type);
|
|
~EventCounter();
|
|
|
|
private:
|
|
wxEventType m_type;
|
|
wxTestableFrame* m_frame;
|
|
wxWindow* m_win;
|
|
};
|