Commit Graph

2389 Commits

Author SHA1 Message Date
New Pagodi
a4b688cb45 Regenerate the test make files to include the new STC test 2019-03-20 17:07:47 -05:00
New Pagodi
7b0c7495e3 Add gui test for STC popup items
With wxSTC, popup autocompletion lists and call tips need to be able to
show their information and respond to mouse clicks, but should never
take focus from their parent STC. This test verifies that these popups
function in this manner.
2019-03-20 17:07:39 -05:00
Vadim Zeitlin
23ddf26571 Fix bug with wxRadioButton state changing unexpectedly in wxMSW
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.

Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.

This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.

Also add a unit test checking that things work correctly in the scenario
described above.

Closes https://github.com/wxWidgets/wxWidgets/pull/1257

Closes #18341.
2019-03-18 18:29:19 +01:00
Vadim Zeitlin
3e0238e089 Merge branch 'wrapsizer' of https://github.com/thesiv/wxWidgets
Fix wxWrapSizer min size calculation in the secondary direction and
improve its unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/1258
2019-03-18 18:22:07 +01:00
Ilya Sinitsyn
d5a6a5a627 Add unit test for wxWrapSizer::CalcMinFromMinor
Add a unit test for a special case of a wrap sizer min size caclulation.
Test wxWrapSizer::CalcMinFromMinor function for this case, when a wrap
sizer used inside a sizer with the same alignment.
2019-03-15 04:16:41 +07:00
Ilya Sinitsyn
e2a9fb1fba Use CATCH in WrapSizer unit tests
Use CATCH instead of CppUnit for unit tests of wxWrapSizer.
2019-03-15 04:14:22 +07:00
Vadim Zeitlin
5a78b82673 Add support for passing nullptr to wx pseudo-vararg functions
Allow passing literal nullptr as an argument corresponding to "%p" in
the format string.

See https://github.com/wxWidgets/wxWidgets/pull/1251

Closes #18355.
2019-03-09 01:14:31 +01:00
Ryan Norton
b7f3a2b30f Make parsing wxURI paths more conforming to RFC 3986
Don't recognize the "path" following the port number without a slash as
a path, this is invalid according to the RFC.

Also require two leading slashes for URIs without the authority part.
2019-02-23 14:36:36 +01:00
Vadim Zeitlin
466a2d000f Use CHECK() in wxURI unit test case
This allows the subsequent tests to still run even if one of the tests
fails, which is more useful in this test than CPPUNIT_ASSERT_EQUAL(),
which maps to REQUIRE() and so stops the test execution as soon as any
check fails, because the tests are independent.
2019-02-23 14:11:58 +01:00
Graham Dawes
5d2663432e Delete child items in wxTreeCtrl::Delete under wxQT 2019-02-11 08:14:25 +00:00
Graham Dawes
c87e959a4a Add test for wxTreeCtrl::GetItemCount() 2019-02-05 19:49:36 +00:00
Vadim Zeitlin
ddc550105e Merge branch 'qt-radio-groups'
Fix radio button grouping in Qt.

See https://github.com/wxWidgets/wxWidgets/pull/1212
2019-02-05 03:03:10 +01:00
Vadim Zeitlin
9886c25645 Ensure that test notebook is destroyed after the end of its test
Don't let wxNotebook created in the recently added test for the events
generated when adding pages to it continue to live after the test end as
this breaks the subsequent tests using wxUIActionSimulator (but only
when using MinGW, for some reason).
2019-02-02 17:40:33 +01:00
Vadim Zeitlin
0a7b5a9879 Ensure that test windows are destroyed in TLW unit test
Don't leave the maximized frame created in the test case for getting
events from it lying around needlessly.
2019-02-02 17:31:05 +01:00
Vadim Zeitlin
2a907769fb Suppress all -Wmissing-field-initializers in the test suite
There were many dozens of such warnings given for the various arrays
used in the tests and it just doesn't seem feasible nor desirable to fix
them all, so just suppress the warnings for all these arrays to get rid
of them with recent (7+?) versions of gcc.
2019-02-02 17:25:37 +01:00
Vadim Zeitlin
a913393147 Test that controls between radio buttons don't break grouping
Add a test checking that even not directly consecutive radio buttons are
still treated as being part of the same radio group.
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
d403c9ecce Slightly simplify radio buttons creation in the unit test
No real changes, just add a temporary variable for the parent and use
more useful (and shorter) labels for the buttons.
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
c5f9bed8ff Merge branch 'tlw-activate-event'
Extend activation event unit tests and enable them for wxGTK where they
seem to pass too now.

See https://github.com/wxWidgets/wxWidgets/pull/1194
2019-01-30 17:40:03 +01:00
Vadim Zeitlin
4d16029f8b Merge branch 'notebook-add-page-events'
Harmonize events sent by wxNotebook::AddPage(): they are now sent only
when adding any page except the first one if it is selected in all
ports.

See https://github.com/wxWidgets/wxWidgets/pull/1192
2019-01-30 17:38:51 +01:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Vadim Zeitlin
f9323e4b87 Enable tests for wxTopLevelWindow::IsActive() for wxGTK too
After the addition of EventCounter::WaitEvent() call in the previous
commit these checks pass as well (with another WaitEvent() added to wait
for deactivation event as well).
2019-01-29 00:16:52 +01:00
Vadim Zeitlin
e599e26395 Test that showing a TLW generates wxActivateEvent
Wait until wxEVT_ACTIVATE arrives and check that it does.
2019-01-29 00:16:50 +01:00
Vadim Zeitlin
c22e81c7a1 Extend unit test for events generated by wxNotebook::AddPage()
In addition to checking that adding the first page doesn't generate any
events, check that adding another page later does generate them.
2019-01-28 19:01:17 +01:00
Vadim Zeitlin
6fdcfd8199 Add unit test for no events when adding first wxNotebook page
Adding the first page shouldn't generate any events even if the
selection does change (from -1 to 0) internally.
2019-01-28 18:21:32 +01:00
Vadim Zeitlin
5811d541da Refactor code waiting for events in the test suite
We already had WX_ASSERT_EVENT_OCCURS_IN macro and a recent commit also
added code doing almost the same thing manually in wxTopLevelWindow unit
test, which was one version too many.

Replace both of them with the new EventCounter::WaitEvent().

No real changes, this is just a refactoring.
2019-01-24 22:52:46 +01:00
Vadim Zeitlin
f4ea128007 Include wx/stopwatch.h explicitly from wxTextCtrl unit test
Don't rely on it being implicitly included from another header when we
use wxStopWatch in this file (with wxGTK only).
2019-01-24 22:52:46 +01:00
Vadim Zeitlin
7c831d25ee Group headers together in wxTextCtrl unit test
No real changes.
2019-01-24 22:52:46 +01:00
Richard Smith
537b2c3bb0 Reinstate wxTextCtrl unit test previously disabled for wxQt
This test was fixed by earlier changes to wxQt font styles and passes
now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1169
2019-01-23 16:48:26 +01:00
Vadim Zeitlin
8703f0c437 Merge branch 'qt-dropdown'
Make wxQt wxComboBox behave more consistently with the other ports. Also
includes related fixes to wxChoice and wxTextEntry.

See https://github.com/wxWidgets/wxWidgets/pull/1161
2019-01-22 15:45:03 +01:00
Richard Smith
4c05b3650a Add a test for WriteText and fix implementation in wxQt 2019-01-21 23:09:17 +01:00
Vojtech Kral
63432e5ef5 Fix wxShowEvent not being received for maximized frames on MSW
Send wxEVT_SHOW explicitly when showing a maximized TLW under MSW as the
system doesn't send WM_SHOW in this case (as documented in the MSDN and
also confirmed by testing).

Closes https://github.com/wxWidgets/wxWidgets/pull/1153
2019-01-21 18:38:46 +01:00
Vadim Zeitlin
288d26598c Merge branch 'dvc-var-height'
Optimize generic wxDataViewCtrl performance with variable line heights.

Closes https://github.com/wxWidgets/wxWidgets/pull/1053
2019-01-16 01:25:06 +01:00
Vadim Zeitlin
9a27ea5a2d Merge branch 'ci-url-test'
Try to work around the errors in URL test under AppVeyor.

See https://github.com/wxWidgets/wxWidgets/pull/1138
2019-01-14 23:41:31 +01:00
chris2oph
dd306cac77 Various wxFont fixes in wxQt
Implement point/pixel size accessors correctly.

Implement support for strike-through fonts.

Also implement DoSetNativeFontInfo() for wxQt.

Make wxFont unit test pass by accounting for Qt-specific aspects.

Closes https://github.com/wxWidgets/wxWidgets/pull/1113
2019-01-14 23:39:02 +01:00
Vadim Zeitlin
3c468260ff Retry in URL test when running in a CI environment
There are episodic failures in this test when running under AppVeyor,
check if retrying to connect can work around them.
2019-01-12 15:39:09 +01:00
Vadim Zeitlin
50c90f9174 Use wxScopedPtr<> in URL unit test
Don't leak the stream if an error happens in the rest of the test.
2019-01-12 15:35:44 +01:00
ali kettab
36f6f8ad49 wxTextValidator improvements
Improve char inclusion/exclusion support; update the sample to show more
features of this class and add a unit test for it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1093
2019-01-05 23:33:35 +01:00
Vadim Zeitlin
dcee3ce899 Suppress some harmless clang warnings in the test suite
Use wxCLANG_WARNING_SUPPRESS() to avoid multiple warnings in CATCH
headers as well as in some of our own tests.
2019-01-04 23:51:31 +01:00
Vadim Zeitlin
7f63adde95 Merge branch 'select-after-delete'
Harmonize behaviour of wxItemContainer::Delete() for all controls and
ports when using single selection.

See https://github.com/wxWidgets/wxWidgets/pull/1080

Closes #18267.
2019-01-04 14:01:02 +01:00
Cătălin Răceanu
5885b2f142 Test that selecting 'single' radio button does not reset others
Add a unit test for the expected behaviour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1102
2019-01-04 13:59:06 +01:00
chris2oph
155a19a1a2 Improve checks for dates range in wxQt wxCalendarCtrl
Account for the minimum and maximum dates supported by QDatePicker, both
in the code and in the test suite, which shouldn't rely on not having
any range restrictions in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1088
2019-01-03 00:18:37 +01:00
Vadim Zeitlin
6f0c5f65b6 Add "aui" project to MSVS 2017 unit tests solution file too
This should have been done in e9cbbede00
which updated the solution files for all the other MSVS versions, but
somehow forgot this one.

See https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-30 16:02:09 +01:00
Richard Smith
0fbf87d11b Split single/multi line behaviour in Qt wxTextCtrl
Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.

Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1039
2018-12-24 01:52:07 +01:00
Sebastian Walderich
e9cbbede00 Implement wxAuiNotebook::GetBestSize()
Compute the best size of the notebook, taking into account all the
different layout possibilities, and add a test checking that this works
as expected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-23 17:05:09 +01:00
Vadim Zeitlin
b2cdd287bb Resolve change log conflict with master
Reapply the change log change manually to master version of the file to
let the CI builds merge this branch automatically.
2018-12-20 02:24:49 +01:00
Vadim Zeitlin
b825c49c2e Document and test wxItemContainer::Delete() selection handling
Add test checking that selection is reset when deleting the selected
item or any item before, but not after, it.

Also explicitly document this behaviour.
2018-12-15 23:47:26 +01:00
Vadim Zeitlin
e0e4f16282 Fix a typo in ItemContainerTestCase comment
No real changes, just fix a copy-and-pasto.
2018-12-15 23:04:30 +01:00
Vadim Zeitlin
4ed28f681f Add a common tag for wxItemContainer-derived classes tests
This makes it possible to run the tests for all controls implementing
wxItemContainer interface by just passing "[item-container]" on the test
command line.
2018-12-15 23:04:30 +01:00
Graham Dawes
db15e99884 Fix wxBitmap::GetRawData() in wxQt
This method used to return a dangling pointer to a temporary buffer,
which resulted in a crash when using it, e.g. in the unit test.

Fix this by keeping a QImage as a member in wxBitmapRefData, so that the
pointer to its data remain valid until UngetRawData() is called.

Also check that GetRawData() returns a non-null pointer in the test.

Closes https://github.com/wxWidgets/wxWidgets/pull/1067
2018-12-13 15:24:54 +01:00
Vadim Zeitlin
c95f668b21 Fix use of dangling pointer in ButtonTestCase::Disabled()
Fix the test added in dfec7aa0c0 which
deleted the button pointer used by EventCounter by simply moving
EventCounter initialization after the button re-creation.

See #16385.
2018-12-13 00:39:25 +01:00