Commit graph

538 commits

Author SHA1 Message Date
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
Vadim Zeitlin
fb4f0b590c Remove wxGTK1 port and GPE support
Remove the port files and references to it from the common headers and
elsewhere.

Also remove GPE (GNOME PDA Environment) support as libgpewidget is
unmaintained since 2006 or so and has never been really used.

Use __WXGTK__ to test for any version of wxGTK now. Still define
__WXGTK20__ for compatibility, but always define it now and don't test
for it in the library code.
2022-10-16 22:01:02 +02:00
PB
88d526660f Replace wxOVERRIDE and wxNOEXCEPT with override and noexcept
Don't use deprecated macros in wxWidgets itself.
2022-10-15 18:10:45 +02:00
Vadim Zeitlin
6bbfdb157e Check that C++11 is available and remove tests for it
Don't bother checking for various C++11 features that are available in
all C++11 compilers.

Also assume that std::exception_ptr is available in all still supported
MinGW versions and remove checks for it too (see #16634).

Further simplifications remain possible, this is just the first step.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
73869d37fd Always use variadic macros and remove wxNO_VARIADIC_MACROS
Variadic macros are always available in C++11, which will be required
very soon, so don't bother testing for them and just always use them.
2022-10-11 00:02:29 +02:00
ali kettab
e48c5d0fa7 Disable test not working under GitHub CI using ASan 2022-09-21 11:16:15 +01:00
ali kettab
1853d46c02 Don't disable automated tests which work under GTK 3
Those tests are supposed to be skipped under GTK 2 only
2022-09-15 11:29:24 +01:00
ali kettab
15cf59a418 Skip test known to fail under GTK2 in automatic mode
Grid::RangeSelect, Grid::Size, Grid::ResizeScrolledHeader and Grid::ColumnMinWidth
are known to fail under GTK2 in automatic mode for unknown reason
2022-09-13 19:14:00 +01:00
ali kettab
6fbc7ea6ca Fix testing range-selection
The previous commit reveals a bug in the grid test where the
wxEVT_GRID_RANGE_SELECTED detected is not really comming from
range selection action, but from the grid cursor changing its position

For unknown reasons, range selection in the test doesn't really starts off
unless we move the mouse first while still inside the first selected cell
2022-09-12 21:51:46 +01:00
Vadim Zeitlin
b0c417db36 Fix crash when using a wxRadioBox without items in wxOSX
wxRadioBox::m_radioButtonCycle is never null -- except when it is, when
there are no items at all in the radio box. Handle this case without
crashing too by checking for the pointer being valid before using it.

Also add a unit test checking that this works correctly.

See #22751.
2022-08-29 19:06:43 +02:00
Vadim Zeitlin
5a6f2796d5 Use CATCH macros instead of CPPUNIT_ASSERT() in wxRadioBox test
No real changes, just get rid of the last vestiges of CppUnit in this
file.
2022-08-29 18:34:16 +02:00
Vadim Zeitlin
7c2031620d Remove CppUnit boilerplate from wxRadioBox unit test
Define a simple fixture instead of inheriting from CppUnit::TestCase.

No real changes, just make the code shorter, less redundant and make it
simpler to run individual tests.
2022-08-29 18:32:52 +02:00
Lauri Nurmi
66916c74a3 Fix double negatives used with 'neither' in docs and comments
In many cases it should be 'either', and 'nor' should be 'or'
accordingly.

No changes to actual code.

Closes #22723.
2022-08-19 16:22:21 +02:00
Artur Wieczorek
5e2da5a106 Get rid of v2.8 code 2022-08-02 08:26:29 +02:00
Tim Stahlhut
c69ee439d9 Stop using wxWidgets 1.xx wxString compatibility functions
Replace them with std::string-like equivalents when possible (i.e.
replace Length() with length(), IsNull() with empty()) or, at least,
with wx 2 functions if not (e.g. Remove() with Truncate(), First() with
Find(), LowerCase() with MakeLower() etc).

Closes #22638.
2022-07-24 16:25:29 +02:00
Vadim Zeitlin
dbd211dbc2 Don't require overriding wxDataViewModel::GetColumn{Count,Type}()
Neither of these methods was actually ever used after the changes of the
last two commits (and they hadn't been used when not using wxGTK even
before), so don't force the user-defined model classes to override them.

Also stop using them, as the stub versions don't return correct values
any longer.

Still keep the virtual functions in the base class for compatibility
however as it doesn't cost us much and avoids breaking the existing code
using "override".
2022-06-18 19:19:16 +02:00
Vadim Zeitlin
9547cbc6a4 Extend wxListCtrl::GetColumnCount() tests to all modes
Check that it consistently returns 0 in the wxLC_ICON and
wxLC_SMALL_ICON modes under all platforms.

Document the behaviour of this function in all modes.
2022-06-08 13:52:53 +01:00
Vadim Zeitlin
8b1bab9c71 Simplify the code in just added ListCtrlTestCase::ColumnCount()
Don't call tearDown() explicitly, we'll get rid of this function sooner
or later, hopefully, so don't add extra calls to it and just delete the
window directly, nothing else should be needed here.

No real changes.
2022-06-08 13:40:43 +01:00
Kvaz1r
1a545fe428 Add tests for wxListCtrl ColumnCount 2022-06-07 22:15:11 +03:00
Frode Roxrud Gill
f646e8b11c Allow cloning client data stored in wxGrid attributes etc
Add wxSharedClientDataContainer class storing ref-counted client data
and use it instead of plain wxClientDataContainer in wxGridCellAttr,
wxGridCellEditor and wxGridCellRenderer classes.

This allows to keep the same client data associated with many grid cells
without having to make many copies of it.
2022-04-28 00:28:58 +02:00
Vadim Zeitlin
bf3b653492 Merge branch 'auibook-help'
Fix infinite recursion when processing wxEVT_HELP for wxAuiNotebook
pages.

See #22323.

Closes #22309.
2022-04-19 00:38:39 +02:00