Commit graph

558 commits

Author SHA1 Message Date
ali kettab
aa4a19cb1d Fix or skip other failures in the tests under wxQt 2023-11-01 00:39:19 +01:00
ali kettab
7469f0f5c4 Fix failures in TreeCtrlTestCase tests under wxQt 2023-10-31 22:58:21 +01:00
ali kettab
0e325e6262 Fix failures in ListBoxTestCase tests under wxQt 2023-10-31 22:56:30 +01:00
ali kettab
53c2b7d65b Fix failures in wxGrid tests under wxQt 2023-10-31 22:53:59 +01:00
ali kettab
b5dad92007 Make sure the window is active after SetFocus() under wxQt
Calling wxYield() after SetFocus() ensures that the window is active
and the tests will pass. Otherwise, they would fail.
2023-10-31 22:42:27 +01:00
ali kettab
3a71aeed5e Enable some more tests under wxQt 2023-10-31 22:28:34 +01:00
ali kettab
b7cf27f2ce Enable HitTestSingleLine test case under wxQt 2023-10-23 21:16:31 +01:00
Vadim Zeitlin
c601bf4279 Merge branch 'qt-fixes'
Fix bugs preventing GUI tests from working with wxQt and provide native
implementations of wx{Date,Time}Ctrl in this port.

See #23925.
2023-10-22 01:18:50 +02:00
Vadim Zeitlin
99febcf9c1 Wait for events in Grid::LabelClick and RangeSelect tests too
Not sure if it really helps, but try to wait for the events in these
tests as well if only for consistency with what was done in 3d07de66b1
(Add a wait to wxGrid UI unit tests too, 2023-10-03).
2023-10-22 01:06:38 +02:00
ali kettab
09c22b080e Fix listboxtest test failing under wxQt
Qt uses QString::localeAwareCompare() for comparison and this is what their
documentation says: "On other Unix-like systems without ICU, the comparison
falls back to the system library's strcoll()". Under MSW, Qt uses CompareStringEx()
IOW, Qt always compares strings by locale-specific sorting criteria and BTW
this is what wxGTK was like before this commit 625ed74 (Make sorting of wxListBox,
wxChoice and wxComboBox identical to the MSW sorting)
2023-10-15 00:10:02 +01:00
ali kettab
155b24daea Fix gridtest test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
942b3bccf4 Fix windowtest test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
ae0d707166 Fix wxListCtrl test failing under wxQt
The wxListCtrl would assert with this message: '../src/qt/listctrl.cpp(452):
assert "col < columnCount()" failed in SetItem(): Invalid col'

Because under wxQt: no columns means no items, and no items means
no selection can be made at all.
2023-10-15 00:10:02 +01:00
ali kettab
f7e7c037c2 Fix wxTextCtrl::GetBestSize test case failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
d0bf5fdb8f Use cursor type guaranteed to be supported on all platforms.
The wxCURSOR_CHAR cursor type is not supported under wxQt and using it
causes the test to fail there.
2023-10-15 00:10:02 +01:00
ali kettab
7e360dcf1e Fix testing wxSpinCtrl[Double] unsupported features under wxQt
Backwards ranges are not supported under wxQt and setting empty string
in the control automatically displays minVal.
2023-10-15 00:10:02 +01:00
ali kettab
ff4995ec01 Enable formerly skipped tests under wxQt 2023-10-14 17:58:53 +01:00
Vadim Zeitlin
3d07de66b1 Add a wait to wxGrid UI unit tests too
Wait for a bit before checking for the expected event as a single
wxYield() call might apparently not be enough under load, as this test
sporadically fails in AppVeyor CI builds even though it passes locally.
2023-10-03 16:05:31 +02:00
Vadim Zeitlin
fa5964c100 Use WaitFor() and new YieldForAWhile() helpers in the tests
Reuse the existing function (and another new one, which is even simpler)
instead of duplicating its code in many places in the tests.

No real changes.
2023-10-02 15:10:36 +02:00
Vadim Zeitlin
1237322404 Add WaitFor() helper and use it in Button::Click unit test
This test also sporadically happens under AppVeyor, check if it happens
because we need to wait for some time before the event is processed.
2023-10-01 21:30:00 +02:00
Vadim Zeitlin
55e074f5bc Rename tests/waitforpaint.h into just waitfor.h
No changes yet, just prepare for adding more "waiting" helpers.
2023-10-01 21:25:46 +02:00
Vadim Zeitlin
3f2b7f6bdb Try changing BitmapToggleButtonTestCase to avoid wxMSW failures
This test sporadically fails under AppVeyor, perhaps due to a hard-coded
sleep in it which may somehow misbehave there -- try changing it not to
rely on this sleep.

This has a nice side effect of making the test run faster, too.
2023-10-01 21:14:00 +02:00
Vadim Zeitlin
7d362c3fca Enable wxStyledTextCtrl unit test in static builds too
It should link there too now after the previous commits.
2023-07-29 16:01:33 +02:00
Martin Corino
4d76a87015 Make wxSearchCtrl inherit from wxTextEntry in all ports
Previously it only inherited from wxTextEntryBase in the generic
implementation (used e.g. in wxMSW).

Update the code, documentation and add new unit tests checking that
wxSearchCtrl member functions inherited from wxTextEntry behave
correctly.

Closes #23686.

Closes #23697.
2023-07-20 14:46:41 +02:00
Brian Nixon
381c39a051 Clear grid attribute cache when loading new table
Clear the cached attributes when replacing the table they were used
with.

Add unit test checking that the attributes are not used any longer.

Closes #23607.
2023-06-05 15:22:49 +02:00
Vadim Zeitlin
c41969eff2 Disable wxHyperlinkCtrl colours test under Wine
This doesn't work due to LM_GETITEM not returning the expected result
after changing the state using LM_SETITEM under Wine.

It could be worked around by remembering whether we changed the colours
in our own variable, or maybe just reverted later if Wine fixes this,
but for now disable the test.
2023-05-15 21:50:31 +01:00
Vadim Zeitlin
cd28031b4d Document that wxMSW wxHyperlinkCtrl hover colour can't be changed
This isn't supported by the native control, and it doesn't seem worth to
make an extra effort to support it, so just document it and stop
checking that it works in the unit test.
2023-05-15 21:39:13 +01:00
Vadim Zeitlin
d1fedc1415 Get rid of CppUnit boilerplate in wxHyperlinkCtrl unit test
No real changes, just avoid using compatibility macros in this test.
2023-05-15 21:39:13 +01:00
Vadim Zeitlin
54a8a6ac16 Fix wxTreeCtrl::ScrollTo() with hidden root item in wxMSW
Scroll to the topmost item, as the generic version does, instead of
crashing.

Closes #23534.
2023-05-10 19:08:00 +01:00
Vadim Zeitlin
50dcf06bff Revert to using wxBaseObjectArray for wxAuiToolBarItemArray
This partially undoes the changes of bc23b1f4f0 (Use wxBaseArray instead
of object array for wxAuiToolBarItemArray, 2023-04-11) as they broke the
existing code using wxAuiToolBar because the pointers to the tools were
not stable any more.

At least avoid the use of the ugly -WX_DECLARE_USER_EXPORTED_OBJARRAY()
macro by just using wxBaseObjectArray<> directly, which is simpler now,
after the change in the parent commit.

Add a trivial test checking that pointers to wxAuiToolBar tools remain
stable when more tools are added.

Closes #23514.
2023-05-07 00:52:07 +01:00
Vadim Zeitlin
8d8f94da64 Merge branch 'webkit2_fixes' of https://github.com/swt2c/wxWidgets
Miscellaneous fixes for WebKit2 wxWebView backend.

See #23497.
2023-04-28 16:39:49 +02:00
Vadim Zeitlin
fd0a52250d Remove redundant wxUSE_STD_IOSTREAM test
It's not necessary to check for it as wxHAS_TEXT_WINDOW_STREAM is only
set to 1 if standard streams are used.
2023-04-28 15:26:46 +02:00
Scott Talbert
9688ccc087 WebView tests: Fix Selection test with WebKit 2.40+
For some reason, calling HasSelection() immediately after SelectAll()
causes the web extension to get stuck under WebKit 2.40.  Instead of
sleeping, call wxYield() a few times to let the event loop run a bit.
2023-04-26 10:26:16 -04:00
Vadim Zeitlin
363f0988cf Replace wxScopedPtr with std::unique_ptr in the tests
Just use the standard class instead of the wx one, as they can be used
in exactly the same way.
2023-03-06 23:34:44 +01:00
Vadim Zeitlin
c6a18264e1 Fix signed/unsigned comparison warnings in wxPropertyGrid tests
Use size_t for a variable being compared with a size_t expression.
2023-02-19 23:47:08 +01:00
Artur Wieczorek
5b1911523c Add more unit tests of wxPGVIterator 2023-02-19 22:36:40 +01:00
Artur Wieczorek
f1273ce152 Use class enums to implement bitmask types
To improve type safety of flags.
2023-02-19 22:36:21 +01:00
Artur Wieczorek
ec25a5c83c Execute automated tests for wxPropertyGrid
Move existing manually executed tests in propgrid sample to the test
suite executed automatically.
2023-01-30 17:28:17 +01:00
Vadim Zeitlin
208142c14a Merge branch 'msw-dark-mode'
Add experimental support for dark mode for wxMSW.

See #23028.
2022-12-27 22:20:34 +01:00
Vadim Zeitlin
78839714a5 Use theme-appropriate default colour in wxFontPickerCtrl
Don't hardcode black as the default font colour, as this can be
unreadable in dark mode.

Also update the unit test to not always expect the initial colour to be
black.
2022-12-25 19:45:53 +00:00
Gerhard Gruber
c6ef438c10 Fix wxNotebook::HitTest() for horizontal orientation in wxMSW
Native control doesn't seem to implement TCM_HITTEST correctly for the
tabs on the left or right side, so provide our own implementation of
HitTest() in this case.

Also add a unit test checking that HitTest() does something reasonable.

Closes #4775.

Closes #23023.
2022-12-18 02:12:23 +01:00
ali kettab
54413ff188 Really test edit events generation in ListCtrlTestCase::EditLabel() 2022-12-06 09:58:38 +01:00
ali kettab
6e48cd2212 Enhance ListBaseTestCase::Visible() to test IsVisible() function too
Also, make sure wxListCtrl has at least one item inserted. if not,
GetCountPerPage() will always return zero under wxQt
2022-12-05 22:21:28 +01:00
Vadim Zeitlin
886dba9527 Enable wxTextCtrl::InitialCanUndo() test for Wine 7.13+
The functionality used by this test is supposed to be implemented
starting from this Wine version.
2022-12-04 00:44:09 +01:00
Vadim Zeitlin
7ccd305c84 Tighten checks in NotebookTestCase::GetTabRect() unit test
Check we get the expected values instead of just "something non zero".

Also still perform the checks that are supposed to work under Wine when
running there too, instead of just skipping the test entirely.
2022-12-04 00:44:09 +01:00
ali kettab
2e37f7c9df Rewrite wxTextCtrl::InitialCanUndo test case to cover multiline control 2022-11-16 16:15:11 +01:00
Gerhard Gruber
065ff2d2d8 Add wxNotebook::GetTabRect() to retrieve the tab position
This function is currently only implemented in wxMSW and wxUniv and just
asserts under the other platforms.

Also add a helper GetTabOrientation().

Update the documentation and add a minimal test case for the new
function.

Closes #22941.
2022-11-10 16:43:43 +01:00
ali kettab
05f8deaac4 Add test checking that wxWindow::Refresh() works as documented
Verify that refreshing the parent window also refreshes its children, as
it's supposed to.

Closes #22922.
2022-10-28 01:41:09 +02:00
Vadim Zeitlin
a3331c87d0 Stop using Catch::toString()
This function doesn't exist in Catch2 any longer, so prepare for the
upgrade by stopping to use it and converting things to string more
explicitly.

No real changes yet.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin
4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00