These tests fail in S/390 Travis CI build, so just don't run them at all
there, as we already did for a couple of tests using /proc that also
failed in other LXC-based builds.
We already did it just before processing the state change event, but
this was too late, as the object could have been already deleted by then
and this actually happened with the example from wxWebRequest
documentation.
Do it earlier now, as soon as the request becomes active, which normally
happens when Start() is called, and keep the reference until the event
is processed after the request reaches one of the final states
(completed, failed or cancelled).
Add a unit test checking that deleting the wxWebRequest object doesn't
prevent the request from running to the completion any more.
Make the code in this function work even with wxFileSystemHandlers that
don't implement FindFirst() at all: we can, and should, still try
loading the passed in path with them, rather than not doing anything at
all.
This makes Load() works with HTTP URLs again, as it apparently used to
do a long time ago, but didn't do any more.
Add a unit test, even if only a semi-manual one, to try to help with
this not getting broken again (ideal would be to launch our own HTTP
server inside the test, but this is a bit more complicated).
Closes#19109.
These tests were also broken by transition to CATCH and didn't run any
longer.
Fix this by replacing CppUnit test suite objects with CATCH test cases
and using a simple helper CheckRE() function instead of creating
complicated test objects hierarchies.
These tests didn't run at all since the changes of e70fc11ef1 (Replace
CppUnit with Catch for unit tests, 2017-11-01) that removed CppUnit:
while they still compiled, the required suite functions were not called
automatically any longer and so nothing happened during run-time.
Finish really removing CppUnit stuff now and just use simple functions
for the checks: this might not be as elegant, but is much simpler and
more transparent.
Serialize them to strings in wxFileConfig, just as we always did for
long, but use wxRegKey support for storing them directly to the registry
in wxRegConfig.
Don't repeat exactly the same code for 3 different types, just use a
template function instead.
Change the existing TryGetValue() helpers to take all output parameters
consistently by pointer, rather than taking only long by pointer and the
other by reference. This allows to isolate the inconsistency of the type
of wxRegKey::QueryValue() parameter in a single place here, hiding it
from the rest of wxRegConfig code.
Add an extra unit test for writing/reading longs to/from wxRegConfig.
This internal function will be useful to check if the modules are
already initialized, i.e. if the library is in the "steady state"
between the end of the initialization and the beginning of the cleanup
phases.
This adds a yet another conversion function, which is not ideal, but
still better than having to write ToStdString(wxConvUTF8) every time for
losslessly converting wxString to std::string: not only this is too
long, but it's also too easy to forget to specify wxConvUTF8, resulting
in data loss when using non-UTF-8 locale.
The simple test added in 59a8f26b01 (Add a unit test for wxWebRequest
query using URL parameters, 2021-03-06) worked when using httpbin.org,
but not when running httpbin locally, as it doesn't pretty-print JSON by
default.
Skip optional whitespace to make it work in both cases.
Check if the path is at least two characters long before accessing its
second character.
Add test cases for wxIsAbsolutePath() on MS Windows.
Closes https://github.com/wxWidgets/wxWidgets/pull/2262
This could be further improved by defining array matchers instead of
using the macros, but for now just get rid of the last traces of CppUnit
in this file.
No real changes.
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.
This somehow succeeds when using gcc 4.8 under Ubuntu 14.04 or MinGW
5.3, so don't fail the tests in this case, but still warn about it
because it seems quite unexpected.
Just replace CHECK(!condition) with CHECK_FALSE(condition), this should
result in slightly more clear error messages.
Also make tests for long and long long more consistent.
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.
This is necessary in order to deal with the numbers greater than
wxINT64_MAX that can't be represented in just long long.
It also allows to implement the intuitive handling of minus sign for the
unsigned numbers, i.e. not to accept it in FromString(), unlike the
standard functions which do (and parse -1 as 0xffff...fff).
Also extend the tests to check for more boundary cases.
Changes of d245dc9e1f (Fix drawing of dotted lines with wxDC in wxMSW,
2020-03-27) improved the appearance of dotted and dashed lines in wxMSW
but at the expense of significant (up to a factor of 300) slowdown.
Allow the applications for which the drawing performance is important to
explicitly request the old behaviour, with uglier, but faster, pens by
choosing to use low quality pens.
Update the graphics benchmark to allow specifying the pen quality and
verify that the performance when using it is the same as before 3.1.4.
See https://github.com/wxWidgets/wxWidgets/pull/2218
See #7097.
Closes#18875.
Define a couple of helper functions to avoid over long lines or having
to break them and also align the tests vertically to allow scanning them
more easily.
No real changes.