Try to make it possible to understand where exactly do the GTK+ errors
appearing in the buildbot slaves output originate from by installing a custom
Glib log handler and prefixing the normal log messages with the name of the
test running when they're generated.
This required a small refactoring of DetailListener which is now always
installed, in order to always have access to the current test name, but still
needs to be explicitly enabled to produce output.
Destroying a window with mouse capture results in an assert, which is
translated into an exception when running the test suite. As this exception is
thrown from wxWindowBase dtor, it results in an immediate program termination
when using C++11 and can also have the same effect even when using C++98 if
this exception is thrown while already handling another exception due to a
test failure.
Try to avoid this by using a "safe" DeleteTestWindow() function instead of
deleting the window directly. Currently this function ensures that the window
doesn't have mouse capture before deleting it, but it could also be used to
check for other things later. Also, this commit only uses this function for
the two controls which do happen to be destroyed with mouse capture currently
(at least when using wxGTK), but it should probably be generalized to all
controls in the future.
Optimizations were turned off for g++ 4.8 to work around compiler bug
resulting in generating infinite loops for the code in this function in
052e598d09, but apparently other versions of g++
suffer from it as well, so just always turn them off until we can be sure
about the version of the compiler in which this bug was really fixed.
Don't switch locale to Japanese, which might not be supported, but just use
wxTranslations directly because we only need translations, not full locale
support.
Also rename the test method to a more descriptive name.
Chinese, Japanese etc translations use a special style for the menu mnemonics
and append them to the translated menu label in brackets, e.g. the menu label
could have the form of "<translation-of-file> (&F)".
Check for this style of mnemonics in wxStripMenuCodes() too and strip them as
well.
Just return a reference to an empty wxString, as GetFirstLine() already does
(although this is actually questionable -- what if this string is modified?).
See #17283.
Since for some renderers circles and/or ellipses are basic figures so it would be worth to test the performance of drawing them.
Respective tests are enabled with new command line options: "--circles" or "--ellipses".
Since there are several graphics renderers available under wxMSW it would be good to have ability to test graphics performance of any of them and not only the performance of default one.
Therefore new feature to run the tests with selected graphics renderer has been implemented in the benchmark application. Renderer can be selected with optional command line option: "/r renderer_name", when `renderer_name` can be either gdiplus, direct2d, cairo.
When no renderer is explicitly selected then default renderer is used.
The macro wxGCC_WARNING_RESTORE is being used without a parameter which
MSVC warns about. Fix by passing the same parameter as when using
wxGCC_WARNING_SUPPRESS, namely deprecated-declarations.
Regression since b58c87db28.
Update misc/scripts/inc_release script: remove non-existent any more files and
update the version in the MSVS 200x project files not generated by bakefile
any more and MSVS 201x project files which were not previously taken into
account.
Run it and rebake.
The current code incorrectly returned true if the string contained
an invalid UTF-8 sequence after an embedded NUL.
Check the entire string if the length was explicitly given instead of stopping
at the first NUL.
Closes https://github.com/wxWidgets/wxWidgets/pull/236
The tests crashed after running ModalDialogsTestCase::FileDialog() because the
next call to wxYield() resulted in the completion of an async operation
launched by the native file dialog which tried to dereference the already
destroyed dialog.
No real changes, just always show the frame as we need it to be shown for the
tests to run anyhow.
Also update the nonsensical comment about creating a hidden window just before
showing it.
Use wxHtmlWinParser instead of wxHtmlParser which can't be actually used
without being initialized with the tag handlers (it's not clear whether this
is really intentional...).
When pixel doubling is in use, e.g. when using GTK+ 2 on high DPI displays,
the width of a single TAB can be greater than the hardcoded 50 width in the
test, which resulted in test failures.
Base the widths on the average character width to make sure we can always
ellipsize.
Don't optimize the required length as this is a tiny gain resulting in big
problems with the strings containing surrogates for which the actual result is
shorter than the length returned, resulting in extra NUL bytes at the end of
the converted buffer.
This is similar to 3410aa372f (see #16298) but
for UTF-32 and not UTF-16.
Closes#17070.
These tests don't seem to be sound, it's possible for one second or more to
pass between the two calls to GetTimes() and it's apparently possible for the
access time on the symlink to not change (due to /tmp being mounted with
"noatime" option perhaps?), resulting in Travis CI build failures.
When compiling with g++ or clang in C++11 mode, the use of std::auto_ptr<>
triggers warnings about its deprecation, so replace it with wxScopedPtr<> as
this is simpler than choosing between auto_ptr<> and unique_ptr<>.
Such strings are not really URIs as they should have been encoded if they were
but we can obtain them from e.g. wxFileSystem::FindFirst(), so handle them
correctly here as it's simpler than checking all the places where Unescape()
is called.
Add a unit test checking that decoding an URI containing both Unicode and
percent-encoded Unicode characters works correctly.
This reverts commit 62763ad541 which seems to
have been completely unnecessary as the fields had been already initialized
and this commit actually broke initialization of the propagation level of the
copied wxCommandEvent objects.
Add a unit test proving that things do work.
Closes#16739.
We rely on string literals being of non-const char or wchar_t pointer type for
this code to compile, even if this results in warnings, so we're not
interested in these warnings in the test code itself.
Calling Unbind() on another handler from the currently executing handler which
had been bound after (and hence executed before) the handler being unbound
resulted in a crash previously as the iterators used in the loop over all
dynamic event handlers became invalid.
Fix this by storing the dynamic event table entries in a vector instead of a
list (which is also more memory and speed efficient anyhow) and null the
deleted entries instead of removing them to avoid invalidating the iterators
and only really remove them once we finish iterating.
Closes#17229.
Extended tests to determine speed of drawing RGB/ARGB bitmaps on target
bitmaps with different colour depths (RGB/0RGB/ARGB/system default).
See #16766.
After the fixes in the previous commits conversions between wchar_t containing
surrogates and UTF-{8,16,32} work correctly, so add a test ensuring that this
is the case.
Notice that other conversions are still broken in presence of surrogates.
See #17070.
UTF-32 conversions use a useful optimization by avoiding the extra scan of the
input wchar_t string in their FromWChar() and cWC2MB() implementation when
they are only asked to compute the required buffer size without actually doing
the conversion. However this means that for an input string containing UTF-16
surrogates (which is possible under MSW where wchar_t is 16 bits) the actual
size of the output string can be smaller than that returned by FromWChar(NULL).
Document that this may happen and avoid relying on the exact equality in the
tests.
See #17070.
Correctly fail if the wide string being converted is UTF-16 encoded (which can
only happen on platforms using 16 bit wchar_t, i.e. MSW) and ends in the
middle of a surrogate pair.
Notice that other conversions still wrongly encode invalid wchar_t sequences
such as 0xd800 not followed by anything, this will need to be fixed in the
future, but for now at least make it work for the most commonly used
conversion.
See #17070.
wxSizer already has m_minSize field, use m_calculatedMinSize for the field of
the derived wxBoxSizer class to avoid confusion, just as wxFlexGridSizer
already did.
Also add a new unit test checking that GetMinSize() still works after this
change.
All major supported platforms have well defined per-user directories to store
Downloads, Music, Pictures, Videos and the Desktop files. The new method
wxStandardPaths::GetUserDir() allows for a unified way to access these on MSW,
OS X and Unix (if XDG user dirs specification is implemented for the latter).
See https://github.com/wxWidgets/wxWidgets/pull/89