Commit graph

3015 commits

Author SHA1 Message Date
Vadim Zeitlin
29a97bb52d Don't needlessly use wxScopedPtr in wxConfig unit test
Just use objects directly instead of pointers.
2023-03-06 23:22:05 +01:00
Vadim Zeitlin
7bad8b1060 Fix more -Wshorten-64-to-32 occurrences and test for them
Add more static casts to avoid harmless warnings about long and/or
size_t to unsigned int conversions and enable -Wshorten-64-to-32 in the
allheaders test to ensure they don't get introduced again in the future.
2023-02-27 13:47:57 +01:00
Vadim Zeitlin
7ae9e9b974 Add test really checking wxGridSizer::Layout()
The existing test with this name only checked wxFlexGridSizer::Layout()
and the base class uses a different implementation, which merits its own
unit test.
2023-02-23 15:37:32 +00:00
Vadim Zeitlin
3ed5e42441 Merge branch 'scintilla-5.0' of https://github.com/MaartenBent/wxWidgets
Update Scintilla to 5.0.

See #23117.
2023-02-20 18:25:35 +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
Maarten Bent
b0385e498c
Rebake after bakefile changes 2023-02-14 22:52:26 +01:00
Vadim Zeitlin
6bfabd7afe Fix wxFLEX_GROWMODE_ALL in wxFlexGridSizer with proportions
Setting wxFLEX_GROWMODE_ALL for the non-flexible direction broke
handling of proportions in the flexible direction which were
unexpectedly not taken into account at all any more due to not passing
them to DoAdjustForGrowables().

Fix this by still respecting the proportions in this case and add a test
case to ensure this doesn't get broken again.

Closes #23251.

See #23253.
2023-02-14 00:43:57 +01:00
Vadim Zeitlin
c4b71b3694 Merge branch 'default-locale-improve'
Improvements for handling default locale under macOS and Unix.

See #23119, #23147, #23226.

Closes #23114.
2023-02-08 17:33:19 +01:00
Vadim Zeitlin
b6a42b4ef4 Remove Mac workaround from wxFont unit test not needed any more
After #23144 was fixed, calling DumpFont() doesn't modify the font under
Mac any longer, so we don't need to avoid calling it there.
2023-02-07 10:59:54 +01:00
Vadim Zeitlin
2ca76449bf Fail if environment variables define unknown locale under Unix
Don't always "succeed" in wxUILocale::UseDefault() and, consequently, in
wxLocale::Init(wxLANGUAGE_DEFAULT), under Unix systems, even if the
locale couldn't actually be set, as it can happen if the environment
variables contain a locale which is not supported on the current system,
e.g. a "mixed" locale such as "en_FR", or even a completely invalid
string such as "bloordyblop", which still used to succeed.

For now only fix it for reasonably modern systems with locale_t support,
it could be done even for the ancient ones without it later too if
anybody still cares about them.

Closes #23218.
2023-02-06 00:11:31 +01:00
Vadim Zeitlin
14714856b3 Add wxUILocale::GetSystemLocaleId()
This function replaces the existing GetSystemLocale() as it can
represent the locales that don't have any corresponding wxLanguage
values and for which GetSystemLocale() has no choice but to return
wxLANGUAGE_UNKNOWN.
2023-02-05 16:45:14 +01:00
Vadim Zeitlin
c13b3645a8 Fix wxUILocale::FindLanguageInfo() to work for mixed locales
When looking for the language information, we must recognize the
language independently of the region it is followed by, so en_FR is
still English and fr_DE is still French, even if the full locale is
unknown, but this wasn't the case before.

Fix this by comparing the language part of wxLanguageInfo with just the
language of wxLocaleIdent we're trying to match, instead of comparing it
with its full BCP47 tag, which is never going to match.
2023-02-05 15:51:33 +01:00
Vadim Zeitlin
d6c041e69b Don't assume that wxLocale::Init(wxLANGUAGE_DEFAULT) succeeds
At least under macOS it fails when the system locale is something like
en_DE, for example, as setlocale() doesn't support such locales.

Use wxUILocale::GetSystemLanguage() instead of wxLANGUAGE_DEFAULT.
2023-02-05 15:51:33 +01:00
Vadim Zeitlin
4c23721743 Add a pseudo test to show system locale and language
This can be useful to compare the results of calling
wxUILocale::GetSystemLanguage() and the function with the same name in
wxLocale (which actually corresponds to wxUILocale::GetSystemLocale()).
2023-02-05 15:51:33 +01:00
Pavel Tyunin
de59024f53
Better move constructor test
Previous version didn't actually call the move constructor.
2023-02-05 13:09:08 +02:00
Pavel Tyunin
1a46836e88
Remove unused test variables 2023-02-05 13:09:07 +02:00
Pavel Tyunin
e04a8de87a
Remove duplicated assign() tests and move remaining ones from AssignOp 2023-02-05 13:09:06 +02:00
Pavel Tyunin
62f83858a0
Add tests for wxString assignment operator 2023-02-03 22:09:52 +02:00
Pavel Tyunin
974feb4c39
Add tests for wxString move constructors 2023-02-03 22:09:52 +02:00
Pavel Tyunin
5b951caa79
Add string arrays benchmarks 2023-02-03 22:09:51 +02:00
Vadim Zeitlin
255876075a Merge branch 'xrc-feature'
Add XRC "feature" attribute.

See #23184.
2023-02-03 15:09:55 +01:00
Artur Wieczorek
6674ce7fe6 Apply workaround to fix drawing glitches caused by
wxGraphicsContext::ResetClip (wxOSX)

Using native CGContextResetClip() to reset the clip causes some
drawing glitches - especially with drawing text with CT - see
https://github.com/wxWidgets/wxWidgets/issues/22629#issuecomment-1399554002
For the time being we have to revert to the previous code
with emulated resetting based on restoring the graphics context state.
We also have to disable a unit tests that fails with emulated
resetting the clip.

See #22629.
2023-01-31 22:32:41 +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
3fdebc96cd Add support for XRC "feature" attribute
This is a generalization of the existing "platform" attribute and allows
to only include some XRC elements if and only if an arbitrary "feature"
is enabled by the application before loading the XRC document.
2023-01-29 00:54:42 +00:00
Vadim Zeitlin
7b542ed141 Remove "xrc" tag from XRC test disabled by default
This test is only supposed to be executed by giving its name on the
command line, specifying "[xrc]" shouldn't enable it.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
6b0c220914 Avoid calling wxFont::GetPixelSize() under wxOSX, it's buggy
Work around a bug in wxOSX which breaks the test if we call DumpFont()
because this function calls wxFont::GetPixelSize() which actually
changes the size of the font if it was specified in pixels.

This should be reverted once the bug is fixed.

See #23144.
2023-01-14 17:26:22 +01:00
Vadim Zeitlin
e9b4b9f7e1 Limit comparison of pixel sizes to the height only
In wxMSW wxFont::GetPixelSize() returns the size that the font was
originally created from while in the other ports it returns the actual
size being used.

wxMSW behaviour is probably wrong and should be changed, but for now
just restrict the comparison to the vertical component to avoid the test
failures.
2023-01-14 15:22:01 +00:00
Vadim Zeitlin
85079ee9da Show font properties if any checks fail
This will make it simpler to debug any failures in the test, especially
in the CI builds where debugger can't be used.
2023-01-14 15:20:52 +00:00
Vadim Zeitlin
e5d5abad0a Avoid duplication in the test by using SECTIONs
No real changes.
2023-01-14 15:19:45 +00:00
Vadim Zeitlin
f337e234c4 Fix fractional point size comparison in the test 2023-01-14 14:01:24 +00:00
PB
87b80995a4 Fix wxFontList::FindOrCreateFont() for pixel and fractional point sizes
wxFontList::FindOrCreateFont() worked properly only for integral point sizes.

Make it work also when a pixel size or fractional point size is used.
2023-01-13 21:41:55 +01:00
Vadim Zeitlin
20489626e8 Remove code restoring errno in StringTestCase::Format()
There doesn't seem to be any need to do this, so don't.
2023-01-07 16:50:28 +01:00
Lauri Nurmi
ed897d9641 Restore value of errno after wxString::ToInt()/Long()/etc.
Such functions modifying errno is undocumented, and may come
as a surprise to the caller. Consequently also a call to
wxString::Format() would modify errno.
2023-01-06 18:04:53 +02:00
Vadim Zeitlin
e89f05faba Remove memory debugging/tracing support and all related options
Drop disabled by default and pretty useless memory tracing code and all
the overlapping and poorly documented build options related to it.

Remove memory.cpp entirely and update all the make/project files, but
preserve the now completely trivial wx/memory.h for compatibility and
also keep including wx/string.h from wx/object.h as it seems like a lot
of existing code actually depends on this, even if it should not.

Replace the options in the propgrid sample with a couple of other
debug-related options that were not used before to avoid leaving the
"Debugging Section" completely empty.
2023-01-05 21:41:38 +01:00
Artur Wieczorek
0e2fee1755 Enable wxPaintDC-related tests under wxOSX
With delay after refreshing testing window added in 808bbe8341 ("Fix
executing wxPaintDC-related tests under wxGTK", 2023-01-04) wxPaintDC
tests work also under wxOSX.
2023-01-04 21:59:10 +01:00
Artur Wieczorek
808bbe8341 Fix executing wxPaintDC-related tests under wxGTK
First child window has fixed size so we need to create a second window
and use it for wxPaintDC tests.
2023-01-04 19:59:32 +01:00
Vadim Zeitlin
b7f24a65d8 Rebake after the copyright year update
This should have been part of f5daf28932 (Update copyright years to
2023, 2023-01-03).
2023-01-03 18:39:06 +01:00
Vadim Zeitlin
7bbee79ca9 Give more information if wxLocale::Default unit test fails
Show the system language in this case.
2022-12-31 20:32:47 +01:00
Vadim Zeitlin
2b5bb6217d Disable test for loading images using wxURL
This requires an image accessible via HTTP (and not HTTPS) but we don't
have any such working URLs any longer since the recent change on
www.wxwidgets.org.

Still make it possible to test this manually by predefining an
environment variable containing the URL.
2022-12-31 19:21:33 +01:00
Vadim Zeitlin
b5d7112583 Switch to using detectportal.firefox.com for wxURL HTTP test
http://www.wxwidgets.org/ now redirects even image assets to HTTPS all
of a sudden.
2022-12-31 17:47:47 +01:00
Artur Wieczorek
09521f81e9 Test whether wxDC attributes are unchanged by clipping operations 2022-12-29 12:39:27 +01:00
Artur Wieczorek
227cd581f8 Add tests of wxDCClipper 2022-12-29 12:39:27 +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
Vadim Zeitlin
ff7fc88c01 Merge branch 'tiff-fixes' into master
Fix writing out corrupted TIFF files due to misusing TIFFSetField().

See #23056.
2022-12-23 20:07:55 +01:00
Artur Wieczorek
41a390317c Enable wxPaintDC test under wxGTK3
Test should pass now.
2022-12-22 18:42:57 +01:00
Vadim Zeitlin
c9efe22763 Improve TIFF saving test code
Give more details in case of failure by using INFO() and use simple
CHECK()s instead of ugly WX_ASSERT_EQUAL_MESSAGE as they will show the
failing test anyhow.

No real changes.
2022-12-20 00:23:45 +01:00
Vadim Zeitlin
2ed4e6bee4 Improve wxImage::ChangeColours test code
Use a helper function to both make it shorter and provide more
information in case of a check failure: now the output will include the
name of the file, comparing with which failed, allowing to immediately
see which test failed.
2022-12-19 01:19:06 +01:00