Commit Graph

2006 Commits

Author SHA1 Message Date
Vadim Zeitlin
ba8a594bb3 Remove unnecessary wxLogDebug() from the test cases
Tests can be traced using CATCH command line options already, so these
log statements were useless.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
12e2f9c0cc Get rid of CppUnit::TestCase subclass
Use a test fixture instead.

This gets rid of some boilerplate and allows to avoid repeating
preprocessor checks.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
9adcae898f Make wxFileSystemWatcherEvent handler non-virtual and private
There is no reason for it to be neither virtual nor public.
2019-04-26 02:52:57 +02:00
Vadim Zeitlin
194fa8b4ca Remove unneeded KeepWaiting() and AfterWait() functions
These functions were never used anywhere and their meaning was not
clear, so just drop them.

Also remove the now unused "tested" member and "WAIT_DURATION" constant.
2019-04-26 02:52:57 +02:00
Vadim Zeitlin
4783262238 Simplify the code by using CallAfter()
Use CallAfter() to perform idle-time initialization, this is shorter and
simpler than dealing with the idle events explicitly.

Unfortunately the remaining use of idle events can't be avoided, explain
the reasons for this in a comment.
2019-04-26 02:51:47 +02:00
Vadim Zeitlin
9c956ea962 Remove strange counter-based idle handling code
Just bind the idle events we want to execute dynamically instead.

This is already more clear and robust than the old version, but will be
simplified event further in the next commit.
2019-04-26 02:35:14 +02:00
Vadim Zeitlin
db0d288f60 Use Bind() instead of Connect()
Just another modernization, no real changes.
2019-04-25 02:49:23 +02:00
Vadim Zeitlin
cfb194e55f Use wxVector<> instead of macro-based wxArray
Also remove the never used m_lastEvent member variable.

No real changes.
2019-04-25 02:50:08 +02:00
Vadim Zeitlin
cd8bbcb8df Remove unused variable
FileSystemWatcherTestCase::m_loop was never used, so just remove it.
2019-04-25 02:50:03 +02:00
Vadim Zeitlin
a83ffbe320 Reduce use of raw pointers
Use objects instead of pointers whenever possible and wxScopedPtr
instead of raw pointers when we really need to allocate objects on the
heap.
2019-04-25 02:49:54 +02:00
Vadim Zeitlin
789ba56c77 Rename class used as the test skeleton
Use a better name than the absolutely meaningless EventHandler.

Also add a brief comment describing this class.

No real changes.
2019-04-25 02:49:24 +02:00
Vadim Zeitlin
5488a1438f Globally replace vadim@wxwindows.org with vadim@wxwidgets.org
The old email address is invalid since many years and shouldn't be used
any longer.

No real changes.
2019-04-22 14:12:05 +02:00
Vadim Zeitlin
d662a2223e Add wxColour::GetLuminance()
This method can be used to return the perceived brightness of the
colour.

Closes https://github.com/wxWidgets/wxWidgets/pull/1300
2019-04-21 02:09:42 +02:00
Vadim Zeitlin
b6477e0b9c Merge branch 'stcpopup'
Many usability and appearance improvements for autocompletion popups and
call tips in wxSTC.

See https://github.com/wxWidgets/wxWidgets/pull/1267
2019-04-21 02:03:32 +02:00
Vadim Zeitlin
999d78a3bc Allow using alignment with wxEXPAND and wxSHAPED in wxBoxSizer
Don't assert in wxBoxSizer when both alignment flags and wxEXPAND are
used together if wxSHAPED is also used, as such flag combinations may
make sense and so shouldn't be forbidden.

Add a unit test checking that this is allowed.
2019-03-23 17:18:48 +01:00
Vadim Zeitlin
20db193332 Replace CPPUNIT_ASSERT_EQUAL() with CHECK() in wxBoxSizer test
No real changes, just get rid of the last traces of CppUnit in this
test.
2019-03-23 17:13:06 +01:00
Vadim Zeitlin
8fdb5a7982 Rewrite wxBoxSizer unit test without CppUnit::TestCase
No real changes, just get rid of the old CppUnit-compatible machinery in
this unit test.
2019-03-23 17:10:26 +01:00
Vadim Zeitlin
8042648c73 Don't move wxTextCtrl insertion point if it doesn't really change
Resetting the insertion point position to 0 after calling
wxTextCtrl::SetValue() or ChangeValue() which didn't really change the
control contents was unexpected, as such calls are supposed to be
"optimized away", and this was indeed the case under wxMSW and wxOSX,
but not in wxGTK.

So change wxGTK to follow the other ports, add a unit test checking for
this behaviour and officially document it.

As a side effect, this ensures that the numeric validator classes don't
reset the insertion point position to 0 on every focus loss under wxGTK,
as happened before.
2019-03-21 02:44:45 +01:00
New Pagodi
5f39bb4157 Update other test build files by hand for the new STC test 2019-03-20 17:07:56 -05:00
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
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