This was broken in da973c3caf (Get rid of CppUnit boilerplate in numeric
validator unit tests, 2021-02-21) which replaced DestroyChildren() in
the old CppUnit test case dtor with just "delete m_text", as this didn't
take care of "text2" created in one of the tests.
Using DestroyChildren() still seems overly side, so ensure that "text2"
is destroyed explicitly.
In addition to not accepting "-1" as a valid unsigned value, we also
must not format unsigned values as signed ones, i.e. we need to use
wxNumberFormatter::ToString() overload taking unsigned for them.
Do it in wxIntegerValidatorBase::ToString(), used by TransferToWindow(),
and add more tests for the latter.
Also reorganize the tests in sections and use REQUIRE() for the checks
that should prevent the rest of the section from running if they fail.
Use the actual type of the value, not LongestValueType, for storing
m_min and m_max as this is necessary for the comparisons between the
value and them to work correctly for unsigned types.
Also check for precision loss when converting from the bigger
LongestValueType to the actual type.
Add new unit tests, that failed before, but pass now.
Simplify code and use CHECK() rather than REQUIRE(), which is what
CPPUNIT_ASSERT() is defined as, to continue running the tests even if
some of them fail.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.
If nothing else, this will make an eventual transition to Git simpler.
Closes#14487.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to easily test if we're running on a buildbot slave and disable
some difficult to debug test failures there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This test consistently fails on the MSW build slave machines (see e.g.
http://buildbot.tt-solutions.com/wx/builders/XPSP2 VC9 wxMSW trunk release/builds/2084/steps/test/logs/stdio)
for unknown reason so disable it for them. Notice that it does pass when ran
locally so it looks like another instance of a problem with wxUIActionSimulator
on these machines rather than the problem with the class itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Numeric validator tests rely on wxLocale::GetInfo() returning the decimal
point and calling setlocale() is not enough to ensure this under MSW, we must
use wxLocale for this currently.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure that the tests expecting the results with a point as decimal separator
really are done in C locale.
This should help the tests pass in (French) locale used by the MSW build bot
slaves.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add validators for integer and floating point numbers.
Add an example of their use to the validate sample as well as a new unit test
and documentation for them.
Use the new classes instead of wxTextValidator in wxGrid code.
Closes#12166.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775