Merge the new GUI tests from SOC2010_GUI_TEST branch.
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
This commit is contained in:
66
tests/controls/pickerbasetest.cpp
Normal file
66
tests/controls/pickerbasetest.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tests/controls/pickerbasetest.cpp
|
||||
// Purpose: wxPickerBase unit test
|
||||
// Author: Steven Lamerton
|
||||
// Created: 2010-08-07
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2010 Steven Lamerton
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#include "wx/pickerbase.h"
|
||||
#include "pickerbasetest.h"
|
||||
|
||||
void PickerBaseTestCase::Margin()
|
||||
{
|
||||
wxPickerBase* const base = GetBase();
|
||||
|
||||
CPPUNIT_ASSERT(base->HasTextCtrl());
|
||||
CPPUNIT_ASSERT(base->GetInternalMargin() >= 0);
|
||||
|
||||
base->SetInternalMargin(15);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(15, base->GetInternalMargin());
|
||||
}
|
||||
|
||||
void PickerBaseTestCase::Proportion()
|
||||
{
|
||||
wxPickerBase* const base = GetBase();
|
||||
|
||||
CPPUNIT_ASSERT(base->HasTextCtrl());
|
||||
|
||||
base->SetPickerCtrlProportion(1);
|
||||
base->SetTextCtrlProportion(1);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1, base->GetPickerCtrlProportion());
|
||||
CPPUNIT_ASSERT_EQUAL(1, base->GetTextCtrlProportion());
|
||||
}
|
||||
|
||||
void PickerBaseTestCase::Growable()
|
||||
{
|
||||
wxPickerBase* const base = GetBase();
|
||||
|
||||
CPPUNIT_ASSERT(base->HasTextCtrl());
|
||||
|
||||
base->SetPickerCtrlGrowable();
|
||||
base->SetTextCtrlGrowable();
|
||||
|
||||
CPPUNIT_ASSERT(base->IsPickerCtrlGrowable());
|
||||
CPPUNIT_ASSERT(base->IsTextCtrlGrowable());
|
||||
|
||||
base->SetPickerCtrlGrowable(false);
|
||||
base->SetTextCtrlGrowable(false);
|
||||
|
||||
CPPUNIT_ASSERT(!base->IsPickerCtrlGrowable());
|
||||
CPPUNIT_ASSERT(!base->IsTextCtrlGrowable());
|
||||
}
|
||||
|
||||
void PickerBaseTestCase::Controls()
|
||||
{
|
||||
wxPickerBase* const base = GetBase();
|
||||
|
||||
CPPUNIT_ASSERT(base->HasTextCtrl());
|
||||
CPPUNIT_ASSERT(base->GetTextCtrl() != NULL);
|
||||
CPPUNIT_ASSERT(base->GetPickerCtrl() != NULL);
|
||||
}
|
Reference in New Issue
Block a user