Commit graph

2944 commits

Author SHA1 Message Date
Artur Wieczorek
c3eb9cbaa5 Try to ensure that testing window is shown
wxClientDC tests are reliable only if testing window is visible.
2022-12-01 19:29:52 +01:00
Blake-Madden
fc9e188116 Handle 'T' separator in wxDateTime::ParseDateTime()
ParseDateTime() currently fails if there is a 'T' separator in front of
time component. FormatISOCombined() uses this separator as the default,
so wxDateTime can't parse its own formatted results by default.

This commit fixes that issue by allowing an optional 'T' between the
date and time parts.

Closes #22999.
2022-11-30 02:23:37 +01:00
Artur Wieczorek
1baecca49a Add tests to check clipping for wxGCDC
Tests to check clipping when origin of the parent wxDC is shifted
and has negative coordinates.
2022-11-29 18:39:42 +01:00
Vadim Zeitlin
5c6bce627b Check wxImageList validity in all of its methods
Some of wxImageList methods asserted when called on an invalid image
list while others just failed silently.

Assert in all of them now for consistency and to help detecting problems
in the code using invalid wxImageList objects.

Extend the documentation and the tests.
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
d458af3ca7 Merge branch 'qt-menu-fixes' of https://github.com/AliKet/wxWidgets
Make accelerators and radio items work in wxQt menus.

See #22985.
2022-11-26 16:57:00 +01:00
Vadim Zeitlin
5b5ac7cae0 Improve implementation of WX_ASSERT_FAILS_WITH_ASSERT_MESSAGE
Use SUCCEED() in it so passing tests are actually counted (before
running a test using this macro resulted in misleading output saying
that 0 asserts passed) and also use FAIL_CHECK(), instead of FAIL(), to
which CPPUNIT_FAIL() expanded before, to allow the rest of the test to
run even if this check fails, as missing assertions shouldn't be fatal.

Also remove a very old and outdated comment mentioning CppUnit.

Closes #22984.
2022-11-26 16:55:09 +01:00
Vadim Zeitlin
d0af75e88d Merge branch 'use-template-for-vararg-funcs'
Use variadic templates for implementing the vararg functions.

See #22981.
2022-11-26 16:53:41 +01:00
Artur Wieczorek
f67077a66d Add tests to check clipping for wxGraphicsContext
More tests to check clipping when origin of the parent wxDC is shifted
and has negative coordinates.

See #22990.
2022-11-24 22:45:45 +01:00
ali kettab
c717ed51a7 Enable radio check test for wxQt 2022-11-24 14:15:02 +01:00
Vadim Zeitlin
21549149f0 Check that missing format string arguments are detected
We now assert if not enough arguments are given to a vararg function, as
we can actually do it when checking it all at once, unlike before when
we only checked for the matching format specifier for each argument, so
add a test verifying that this works as expected.
2022-11-23 19:21:36 +01:00
Vadim Zeitlin
84229199c7 Make wxFileTypeInfo ctor a variadic template function
Stop using vararg macros in wxFileTypeInfo and make ctor a template
function instead, this is simpler and more clear.

Add a unit test checking that the ctor still behaves as expected.
2022-11-23 02:44:50 +01:00
Vadim Zeitlin
a0c71642fa Merge branch 'qt-undo-redo'
Add missing clipboard and undo-related functionality to wxQt wxTextCtrl.

See #22973.
2022-11-20 23:01:26 +01:00
Vadim Zeitlin
be7860c766 Remove wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY
Assume they are always 1 now, there is no good reason to ever set them
to 0 any more.

Note that we still keep wxUSE_STD_IOSTREAM for now, but we can drop
wxUSE_STD_DEFAULT as it's not worth having it just for this single
option (previously it was used as the default value for 3 of them).
2022-11-17 00:40:50 +01:00
Vadim Zeitlin
2c0c727f49 Remove wx own wxStringImpl implementation
Always use std::basic_string<> as wxStringImpl.

Closes #22883.
2022-11-17 00:40:50 +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
Vadim Zeitlin
b4b23ac423 Merge branch 'always-use-thread-local'
Always use thread_local as we can rely on compiler TLS support working
under Windows 7 and later.

There are some known problems in MinGW thread local variable support,
but they only affect (obsolete) 32-bit builds and will hopefully be
fixed in this compiler soon.

See #22917.
2022-11-10 16:32:42 +01:00
Vadim Zeitlin
fec8c06a53 Merge branch 'drop-ansi'
Remove support for "ANSI" build not using Unicode.

See #22920.
2022-10-29 18:09:00 +02:00
Vadim Zeitlin
3bc0d1ed92 Deprecate unused wxMBConv parameters in wxString functions
Some wxString functions using wide strings still took wxMBConv just for
consistency with the same functions taking narrow strings in ANSI build,
but this doesn't really make sense any longer because the same code
can't be compiled with different values of wxChar -- it is always the
same thing as wchar_t now, and so we shouldn't pass unused conversion
objects to these functions any more.

So give deprecation warning when these functions are used (but without
formally deprecating them, as it doesn't cost much to keep them) and
avoid using them in the library code.
2022-10-28 21:16:10 +01:00
Artur Wieczorek
3981139f3b Enable all tests of destroying clipping region for wxGTK 2022-10-28 11:37:58 +02: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
c78b0d652b Remove UNICODE build option, hardcode its value as 1
Also hardcode "u" suffix for the library names -- it doesn't make sense
any longer, but we need to keep it for compatibility.
2022-10-27 19:43:59 +02:00
Vadim Zeitlin
6e8290a9ce Stop defining _UNICODE in makefiles
This shouldn't be necessary any longer, so don't do it.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
4519d8e08a Remove wxUSE_UNICODE checks as they're always true now
Also remove all code guarded by "#if !wxUSE_UNICODE".
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
5c49448c75 Remove bakefile UNICODE_DEFINE variable, always define _UNICODE
It might be unnecessary to define it on command line at all, as it's
done in wx/setup.h, but keep doing it for now.

However stop using a variable for this, as setting wxUSE_UNICODE to 0 is
not supported any longer.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
ed748bd5a8 Remove wxTLS_XXX() macros from wx itself
Still use wxTHREAD_SPECIFIC_DECL as it is defined as nothing when
wxUSE_THREADS==0, but get rid of wxTLS_VALUE and friends.

Also enable wxUSE_STRING_POS_CACHE when wxUSE_UNICODE_UTF8 because the
issues described in the (now also removed) comment shouldn't occur with
the compiler implementation of the thread-specific variables.
2022-10-26 03:31:54 +02:00
Artur Wieczorek
ed6c25beed Skip tests known not to work under wxGTK 2022-10-25 11:24:07 +02:00
Artur Wieczorek
7d3f776ec3 Extend tests to check clipping on wxGCDC when origin of its parent wxDC is shifted
See #22914.
See #22480.
2022-10-25 10:44:09 +02:00
Artur Wieczorek
9a2d594d9d Use logical 'and' operator in logical expressions 2022-10-25 10:42:47 +02:00
Artur Wieczorek
3c8ca52f0d Enclose test case tags in square brackets 2022-10-25 10:42:17 +02:00
Vadim Zeitlin
f2cfcd3d2f Avoid another warning triggered by the last warning workaround
Initialize a variable to avoid -Wmaybe-uninitialized triggered by using
wxUnusedVar() with it now.
2022-10-18 21:40:48 +02:00
Vadim Zeitlin
895dd8424c Avoid harmless -Wunused-variable in unit tests
This warning used to be suppressed in Catch headers, but this is not the
case any longer, so work around it in the tests themselves now.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin
b2050fcb6f Update to Catch v2
Use Catch2 public header instead of using internal Catch v1 headers: we
can do this now because Catch2 supports (albeit in a rather ugly way)
being used with PCH.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin
d5a29e1743 Fix harmless signed/unsigned comparison warning in wxFile test
This warning didn't happen with Catch 1.x, but is given with 2.x, so
avoid it by casting to the correct type.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin
3cff415ba9 Don't compare wide strings with narrow ones in the tests
This works with Catch 1.x, but not with Catch2, which seems to behave
more closely to the "real" comparisons.
2022-10-18 18:39:13 +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
23b0c7f9d2 Enable -Wzero-as-null-pointer-constant in wx headers
This warning shouldn't need to be disabled any longer now that we use
nullptr instead of NULL.
2022-10-18 01:25:25 +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
Vadim Zeitlin
0ef1cdcc21 Remove support for wxMotif
This port hasn't been updated for ages and is not used by anybody any
longer, so remove its code to facilitate maintenance.

Also remove references to this port from the documentation and most of
the other places (VMS-specific descrip.vms files still check for it
because it's not clear how to update them all), including configure.

Regenerate the latter and rebake all makefiles.

Finally document that this port is not available any longer.
2022-10-16 16:39:56 +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
7ae3cf206c Remove wxVector unit test
Testing this class doesn't make much sense any more as it's just a
typedef for std::vector and we can presumably rely on the standard class
working as expected.
2022-10-11 00:48:00 +02:00
Vadim Zeitlin
a0ae0cd316 Use <type_traits> unconditionally
Don't use or even mention tr1/type_traits any more.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
0a387693c6 Use std::wstring unconditionally
Don't test for its existence in configure and CMake and don't use
wxStdWideString in the code.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
eb97bf90e4 Remove custom wxVector implementation
Always use std::vector<>, we don't support platforms not providing the
standard library classes any longer.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
1cf49f9909 Remove MSVS 2005 and 2008 project files
These compilers are not supported any longer.

Also disable their regeneration in Bakefiles.bkgen.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
924db833f4 Require MSVS 2015+ and remove checks for earlier versions
Simplify the code checking for _MSC_VER or __VISUALC__ or using
wxCHECK_VISUALC_VERSION() macro (which is not very useful any longer,
but keep it in case we need it again in the future).
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
67b8ca5ef1 Remove WXARC_MEMBER_TEMPLATES and always use member templates
Member template functions are supported by all current compilers as they
are already used in other places without any problems, so there is no
need to test for this.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
23a57b981f Remove checks for gcc <= 4.8 and always assume it's 4.8+
Previous versions don't provide C++11 support which is required now
anyhow and so can't be used any longer.
2022-10-11 00:02:29 +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