wxWidgets/tests/controls/pickerbasetest.cpp
Stefan Csomor da48b9e45d
adding an iOS build to travis (#1847)
* fixing compilation of tests that cannot build

bracket code with the corresponding wxUSE… macros

* adding directive for iOS

* adding a switch for skipping the run - not the build of tests

right now I don’t know yet, how to run the test binary in the iOS simulator, but building it is still a good test in itself

* adding skipping of tests

* increasing minimum deployment to get proper c++17 support

* using --disable-sys-libs, restoring other targets

even when the zlib in -isysroot is used, due to deployment on lower iOS versions inflateValidate may not be available and crash. The guards are evaluated using macros from the zlib from the SDK, not from the lowest version supported.
2020-05-08 08:01:56 +02:00

73 lines
1.8 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: tests/controls/pickerbasetest.cpp
// Purpose: wxPickerBase unit test
// Author: Steven Lamerton
// Created: 2010-08-07
// Copyright: (c) 2010 Steven Lamerton
///////////////////////////////////////////////////////////////////////////////
#include "testprec.h"
#if wxUSE_COLOURPICKERCTRL || \
wxUSE_DIRPICKERCTRL || \
wxUSE_FILEPICKERCTRL || \
wxUSE_FONTPICKERCTRL
#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);
}
#endif