This is more than a cosmetic change: adding "GTK" prefix in wxComboBox and not
doing it in wxChoice in r64436 broke the event generation for wxComboBox as it
didn't override wxChoice methods any longer but defined its own (useless) ones.
Using the same name for the methods in both classes notably fixes unexpected
event generation from wxComboBox::SetSelection().
Closes#12568.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If the in-place text control was still alive when wxGenericListCtrl was
destroyed, it resulted in asserts from wxWindow dtor about child windows still
being alive, so explicitly destroy it from wxListMainWindow dtor.
As this required a slightly different behaviour from wxListTextCtrlWrapper::
EndEdit(), replace its bool argument with an enum one which can take more than
2 values. Not using bool values when calling it also made the code more clear.
Finally, added a unit test verifying that the in-place control is indeed
destroyed correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This test crashes for unknown reasons on wxGTK ANSI build slave and prevents
the rest of the test suite from running, so disable it for now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't throw when already handling an exception as it would result in a call to
terminate() and no useful information about the test failure would be given.
Abort ourselves instead to at least give the message about the assert failure.
This should help debug the mysterious ListCtrlTestCase failures in buildbot
wxGTK builds.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxStopWatch::Time() returns a long value so use %ld, not %d.
This fixes assert failure when using "-t" option with the test suite under 64
bit Unix architectures.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unit test suite didn't compile in wxX11 build because it doesn't support
tooltips, just disable the relevant test then.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Move USING_VC_CRT into testprec.h to allow its reuse in other files and rename
it to wxUSING_VC_CRT_IO as it only checks whether we're using MSVC STDIO
implementation and could be false even when we are otherwise using MSVC CRT.
Use this symbol for the tests whose result depends on the concrete version of
the CRT we use.
This fixes StringTestCase::FromDouble() failure under MinGW.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
"C:" drive doesn't need to exist under Windows, rely on HOMEDRIVE environment
variable defined in all recent Windows versions to get a valid drive letter
(still fall back to "C:" if the variable is not defined -- we could have use
wxFSVolume to find it then but this seems like an overkill).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This test fails for MinGW, probably because its CRT doesn't use the same
locale names as MSVC CRT. Just disable it for now, as it was already disabled
for non-MSW platforms.
Also use LocaleSetter class (extracted from CLocaleSetter) to change the
locale for this test duration only to avoid affecting any tests running after
it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Remove unnecessary casts and initialize the variable with its contents
directly instead of using strange looking wxWCharBuffer ctor from size_t (even
if it did work, it was unnecessary).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The value of the last error seems to change somewhere between our code and
::GetLastError() call, probably in MinGW CRT, so exclude the tests relying on
it being preserved.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We didn't handle the case when the length of the input buffer was not
specified correctly and wxConvAuto::DetectBOM() could read beyond the end of
input. Moreover, the unit test actually relied on this as it didn't pass the
correct length for the literal strings with embedded NULs. This somehow worked
with MSVC but failed with MinGW (see #10713).
Correct the code to handle wxNO_LEN case correctly and fix the unit test to
pass the correct lengths.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
MinGW now uses its own printf() implementation which handles %p differently
from the VC CRT one and uses %8x instead of %8X for it. Compare the results of
wxPrintf("%p") case-insensitively to let the test pass in any case.
Also introduce a USING_VC_CRT macro instead of testing for
__USE_MINGW_ANSI_STDIO in two different places.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The entire VsnprintfTestCase is only used when using our own
wxUSE_WXVSNPRINTF so remove the redundant tests for it inside the enclosing #if.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to create wxFileTypeInfo objects in a more readable even if more
verbose way.
This should also incidentally fix the unit tests compilation with VC6 which
seems to have some existential troubles with the vararg ctor in debug DLL
build (only). Using the non-vararg ctor should hopefully make it happy and let
the unit tests pass with this compiler.
Also document wxFileTypeInfo class which wasn't documented at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not all ports define wxBitmapToggleButton class currently, so add a special
symbol which is defined only if this class is indeed available and test for it
in the unit test for this class.
This fixes the tests compilation under wxX11.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This test just doesn't want to work on MSW buildbot slaves even though it
works perfectly locally. No idea why but disable it when running on a build
bot slave for now to let the entire test suite pass.
Also add a comment explaining why the test is disabled for wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This test fails on MSW buildbot slaves for unknown reasons so disable it to
make the test suite pass. The failure is irreproducible locally so no idea how
to debug this unfortunately.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The call to wxPrintf() should provoke an assert if there are too many
parameters, so update the test to expect it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Somehow the expected assert is not generated by wxString::Format("%d", ptr)
with VC6. Disable this test to make the test suite pass for VC6 for now to at
least be able to monitor the appearance of the new errors in it.
Of course, this one should ideally be debugged (by someone who is interested
in VC6 support) as well...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For some reason the test fails with a single item in the control when running
on the buildbot slave, check if this is still the case if we add another item
to the control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While the native CompareString() is much more efficient than MSVC CRT version
of _wcsicmp(), it gives unexpected results for non-letter characters, so don't
use it but use the slow but correct wxStricmp() instead.
At least don't use char-by-char comparison (in non-UTF-8 case) as it's the
slowest possible implementation of this function, the new one using
wxStricmp() is 3 times faster (by comparison, using CompareString() is 16
times faster still -- but wrong).
Closes#10375.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65572 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Benchmark the abstraction overhead of wxString methods compared to plain
functions and also benchmark native functions for string comparison under MSW.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This purely cosmetic change simply allows to see the output of the benchmarks
sooner which is more user-friendly when running several long benchmarks.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add missing svn:eol-style property to all .cpp files. Also set svn:keywords for .cpp files which don't have that property yet to Id, including src/osx/core/glgrab.cpp for consistency (it doesn't make use of the property).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Resolve the discrepancy between modifier flags of the key events corresponding
to the modifier key itself between wxMSW and wxGTK by changing the latter to
follow wxMSW behaviour.
Clearly document the now officially correct behaviour of the modifiers for the
key events corresponding to the modifiers keys themselves in the manual.
This fix also makes it unnecessary to work around this bug in the keyboard
unit test so remove it from there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGTK generated wxEVT_KEY_XXX with key codes corresponding to the unshifted
state of the key (except for the letters) but Unicode key codes corresponding
to the current shift state. This was inconsistent with wxMSW and also with the
idea that key events, unlike char ones, don't depend on the modifiers states.
Change wxGTK to behave as wxMSW and use unshifted values for Unicode key codes
as well.
Remove the now unnecessary workaround for different key event Unicode codes
from test.
Also try to explain the difference between normal and Unicode keys and key and
char events even better and mention that the Unicode key codes for the key
events are also untranslated in the documentation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Check that the events generated by wxUIActionSimulator result in the same
wxKeyEvents being generated under all platforms. This is not the same as
checking the event generation for the actual keys pressed by the user as there
are some small differences between the two but better than nothing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This macro can be used to easily register a test following a standard naming
convention in both the global test suite and the test suite with the same name
as this test instead of having to use 2 different cppunit macros to do the
same thing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As we expect to get decimal points in the text control when we stream floating
point numbers into it, we must do it in a locale which uses decimal point,
e.g. "C" one. Otherwise the test failed when ran in e.g. French locale.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add a lot of tests for many wx GUI classes.
Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.
Refactor the test suite to make organizing the existing tests and adding the
new ones easier.
Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In wxSOCKET_NOWAIT mode wxSOCKET_WOULDBLOCK is not a real error as it's
expected and should be just discarded. Failing to do this could result in the
following scenario:
1. Try to read a big buffer with wxSOCKET_NOWAIT (setting wxSocket error to
wxSOCKET_WOULDBLOCK).
2. Process small part of it.
3. Read more data from wxSocket -- which now goes to the data containing
already cached data without going to the socket itself and this without
resetting the error.
4. Check wxSocket::Error() which turns out to be (still) true.
And this was exactly what happened in mysteriously failing unit test case
reading wxImage contents from a socket: the failure was difficult to reproduce
because it depended on how much data exactly did we read from the socket in
one go.
Fix this by resetting the error properly and reenable the unit test which was
previously disabled for the build bot, it should pass now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This prevents the test from aborting on Linux distributions which ship with
"fortified" version of gcc, such as recent Ubuntu, Fedora and Gentoo.
Closes#12240.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The last commit used incorrect property name, remove the erroneous property
and set the correct svn:eol-style one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775