Add a test exercising the IPC-over-sockets implementation from a single
thread and from multiple threads concurrently (Execute, Request, Poke,
Advise, combined Advise+Request, and concurrent main-thread and
worker-thread Request()s).
Each test starts its own server by re-executing the test program with
WX_IPC_TEST_SERVER set and shuts it down again in the fixture teardown, so
no server process outlives a test (or disturbs the unrelated GUI tests in
test_gui). The client runs in the main Catch2 process and queries the server
for state to verify it (Catch2 macros cannot run in the server process). The
wait loops are wall-clock bounded so they behave under a GUI event loop, and
a per-fixture watchdog aborts with a diagnostic if a test ever hangs rather
than letting CI time out.
The test runs in both the console "test" and the GUI "test_gui" programs. It
is excluded from one configuration: wxQt, whose event loop does not reliably
process a cross-thread CallAfter() (a wxQt bug fixed separately).
Due to a regression introduced in 3e32a9abe1 (Don't bother resetting
wxStaticBitmap image when destroying it, 2025-06-12), which was part
of #25518, the handle of wxBitmap passed to wxStaticBitmap::SetBitmap()
was destroyed when another bitmap was passed to SetBitmap() later.
Fix this by ensuring that we don't overwrite the value of the current
handle (to be deleted) prematurely in DoUpdateImage().
Add a simple unit test for wxStaticBitmap checking that the problem is
really fixed and, under MSW, also that it doesn't leak bitmap handles.
Closes#26106.
Update the functions dealing with buttons to take into account the extra
sizer added in cd07eabd54 (Add support for "Do not show this again"
checkbox to wxInfoBar, 2025-05-12) which broke the existing logic.
See #25394, #25461.
Closes#25489.
Closes#25493.
The existing code behaved completely wrongly whenever a word longer than
the maximal width was present as it just gave up and didn't wrap
anything at all after it -- when it should have just let this word
overflow but still wrap the rest.
Fix this and add a unit test checking that this works correctly now
(several of the tests would have failed before).
Closes#23339.
Detected by undefined behavior sanitizer, on a file with 16 bpp and a color
component of more than 8 bits. Fix by using a different, and more accurate,
method to scale color components to 8 bits.
Based on the behavior of WIN32 LoadFile(), and the gdk-pixbuf BMP loader source
code, the alpha values are ignored unless the compression method is BI_BITFIELDS.
See #10915, #24219
Explicitly test that wxTranslations will use a language it doesn't
recognize if the OS asks for it and it is available.
See 44c24f12ee (Fix GetPreferredUILanguage() on macOS, 2024-09-09) and
the discussion in #24804.
Closes#24818.
Add a unit test case checking that we don't crash any longer and still
read the image meta data correctly, even if not the image itself.
Also add another check for EOF and possibly invalid "bits" value in
another place where we were not checking for it when reading from the
stream.
Closes#23409.
Co-authored-by: PB <PBfordev@gmail.com>
This fixes several minor bugs in the loading of `BI_BITFIELDS` bitmaps,
related to handling different header sizes and the colour and alpha
masks.
Closes#23601.
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.
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.
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.
This makes the code much more clear: LoadDib() now reads all the header
data while LoadBMPData() reads bitmap data only and doesn't read any
header values any more, unlike before.
It also allows not to have to pass neither bmpOffset nor IsBmp
parameters to LoadBMPData(), making its argument list much more
reasonable.
Finally, and, most importantly, it fixes loading bitmaps using
BI_BITFIELDS that was broken back in cccda9ef6b (Fix loading colour
palette from BMP file, 2019-12-28).
This commit also adds a unit test checking that this doesn't get broken
again without anyone noticing.
See #18634.
Closes#22499.
Fix the bug introduced in ec0734f96f (Install DLLs in bindir, not
libdir, when using MSW toolchains, 2021-01-09): the directory where the
DLLs were installed wasn't created any more, resulting in errors if it
didn't exist.
Update to latest bakefile version adding the missing mkdir command to
fix this and also use a released bakefile version for the wx makefiles.
Regenerate configure to match the new version.
See #14601.
No real changes, just use a more clear and longer (which will be
important for the next commit) name for a test file.
Remove the non-existing samples/console/testdata.gc from make_dist.mk
(there are other non-existing files still referenced there).
This file was listed in test.bkl but wasn't actually copied because the
value of <files> was overwritten by another <files> just below ever
since the changes of 21fe35aff7 (add wxImage test units to test loading
from both seekable and non-seekable streams, 2009-06-01).
Fix this by splitting this wx-data into 2 different ones, to avoid this
conflict.