Commit Graph

1482 Commits

Author SHA1 Message Date
Vadim Zeitlin
28aea07674 Fix wxString::From[C]Double() unit test for MSVC 14 and later
Since MSVC 14, VC CRT uses standard-conforming 2 digits for the exponent
instead of the non-standard 3 used previously.

(cherry picked from commit 7122288416)
2016-12-09 17:45:46 +01:00
Vadim Zeitlin
d77661c73b Fix string iteration logic in wxFTP::Pwd()
wxString iterators can't be dereferenced once they reach the end of the
string, so compare them with end rather than checking if the value they point
to is non-NUL.

This makes wxFTP::Pwd() actually work, which was apparently broken since quite
some time (perhaps ever since c9f7896861 9+
years ago).

See #17679.

(cherry picked from commit d0c57dbef0)
2016-09-25 01:27:37 +02:00
Vadim Zeitlin
7f6d9166a2 Connect to the FTP server in a single place in wxFTP unit test
As all tests need a valid connection, just do it once in the test set up
instead of duplicating the call to Connect() in all tests.

No real changes.

(cherry picked from commit 461d0b2005)
2016-09-25 01:25:43 +02:00
Bryan Petty
4a23f03ede Normalize all the line endings. 2015-11-15 21:47:15 -07:00
Vadim Zeitlin
821450a20c Reset the system last error value before checking it in wxLog test.
Explicitly set the last error indicator to 0 before checking that
wxLogSysError() logs it correctly as it wasn't always set to 0 otherwise.

(this is a backport of 2c64172825 from master)
2015-10-17 18:26:55 +02:00
Vadim Zeitlin
918d46e2cc Add a check for wxSocketServer creation to the unit tests.
This should prevent an assert failure which happens if we call Accept() on an
invalid server below and also confirm if the server creation really failed or
not.
2015-06-24 01:24:47 +02:00
Vadim Zeitlin
01f62c0295 Avoid warnings about narrowing casts in the long long tests.
Recent g++ versions give -Wnarrowing warning when a value outside of the type
range is used to initialize a variable of this type in { }. Avoid it in the
long long tests using explicit casts as we already cast between long long and
unsigned long long values here anyhow.
2015-06-21 16:00:55 +02:00
Vadim Zeitlin
ec434c918a Avoid g++ 4.8.2 bug that resulted in infinite loops in the test suite.
g++ 4.8.2, shipped with Ubuntu 14.04, generates incorrect code for checking
the loop termination condition, resulting in never ending loops in
HashMapTest().

Disable the optimizations for this function for 4.8.[012] as the bug seems to
be fixed in 4.8.4 and several similar (but not really identical) bug reports
in gcc bugzilla have been fixed in 4.8.3.

This should allow the unit tests on Linux buildbots, using 4.8.2, to run to
completion again.
2015-06-21 02:44:56 +02:00
Vadim Zeitlin
0e0809b5f5 Avoid reading one char beyond the buffer end in UnicodeTestCase.
Valgrind complains about reading beyond the end of buffer when using glibc
std::string for wxString implementation under amd64 Linux. Don't suppose that
the buffer has one extra null word at its end to avoid this.
2015-06-21 02:44:33 +02:00
Vadim Zeitlin
8b4dbf8ebf Fix mismatched new[]/delete in a test case.
Use wxDELETEA() as the comment said we did -- except that we didn't.
2015-06-19 19:59:51 +02:00
Vadim Zeitlin
264f01824b Don't end converting prematurely on encountering consecutive NULs.
Don't stop converting subsequent chunks just because the length of one of them
was 0: this can happen if the first character of a string is a NUL or if there
are two (or more) NULs in it later.

Simply remove the check for this and continue as usual even in this case.

Also add a unit test verifying that we do translate NULs in input into NULs in
output.

Closes #16620.

(this is a backport of f99ff49 from master)
2015-06-08 14:06:23 +04:00
Vadim Zeitlin
4b073ab140 Fix recently added wxFileName::MakeRelativeTo() unit test for non-Unix.
Don't hard code the use of slashes as path separators.

(cherry picked from commit ef30f6fe63)
2015-05-31 03:51:06 +04:00
Vadim Zeitlin
de891ddb03 Fix wxFileName::MakeRelativeTo() for directory relatively to itself.
The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.

Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.

Also add a unit test verifying that this works as expected.

Closes #17010.
2015-05-29 16:25:45 +02:00
Dimitri Schoolwerth
52975d72fd Work around failing file watcher test under XP.
Under only Windows XP the test FileSystemWatcherTestCase::TestTrees fails
during the RmDir(treedir) call (SHFileOperation strangely returns
ERROR_DIR_NOT_EMPTY). To make the test pass remove the treedir first and
only then the singledir. This is merely a workaround while the actual
problem is still to be investigated.

This is the backport of 2d5ce25373 from
master.
2015-04-23 00:39:41 +04:00
Vadim Zeitlin
03adb6fd2e Ensure that wxTestableFrame is shown on the (main) screen.
Undo the accidental commit of local modifications in
13a119cca8 .

This is the backport of 498f07a5b2 from
master.
2015-04-22 17:05:35 +04:00
Vadim Zeitlin
35a3ca5a1e Disable wxSleep() test case for buildbot builds.
This test keeps failing just because the buildbot machine are too heavily
loaded. This is not really an error, so just avoid running this test there.

This is the backport of f641dfd7 from master.
2015-04-22 14:27:06 +02:00
Vadim Zeitlin
52c8a3684c Disable surrogate-related unit test for MSW.
This test can't work when the in-memory representation is UTF-16, as we can't
convert surrogates to anything else in this case.

This fixes the unit tests broken since r76622, see #16298.

This is the backport of 0bb7676889 from master.
2015-04-19 01:45:20 +02:00
Vadim Zeitlin
ce62dc893a Yet another wxStopWatch unit test fix for buildbot.
Relax the check in RestartBug() test too, the time can be slightly smaller
than expected (by ~2ms on disc-xp machine).

This is the backport of 7af8598903 from master.
2015-04-17 13:33:18 +02:00
Vadim Zeitlin
669c5cd64c Replace anonymous namespace with a named one in the test helpers.
This should avoid clang warnings about the function in anonymous namespace
being unused.

This is the backport of r76928 from master.
2015-04-17 13:26:20 +02:00
Vadim Zeitlin
4ed9b1e244 Relax another check in wxStopWatch unit test.
Increase the upper bound even further to avoid spurious failures in the
buildbot builds.
2015-04-13 15:56:46 +02:00
Vadim Zeitlin
a19e20d36e Give more details in GarbageTestCase unit test.
Try to find out why this test fails in the OS X buildbot builds.

Use macros to ensure that all checks provide information about the bitmap (or
animation) type they fail for, without having to repeat the same code for
doing it many times.
2015-04-13 00:13:28 +02:00
Vadim Zeitlin
597ec59a0b Compare scaled images approximately in the unit tests.
Comparing them exactly results in tests failures when using compiler version
different from the one that was used to generate the test fails, see
http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/151149/focus=151154
and other messages in the same thread.
2015-04-13 00:05:41 +02:00
Vadim Zeitlin
02f7f0dd32 Relax wxStopWatch test to make it less likely to fail on buildbot.
Be prepared for sleeping taking more time than we budget for it on a highly
loaded machine such as a buildbot slave.
2015-04-12 22:46:46 +02:00
Vadim Zeitlin
0f17babfd9 Disable TextCtrlTestCase::LongText() for non-MSW platforms.
At least under GTK SetMaxLength(), tested by this test, can't be used with
multiline text controls at all, so running it fails. Keep the test for MSW
only where SetMaxLength() works with controls of all kinds.
2015-04-12 19:41:41 +02:00
Vadim Zeitlin
114223fbbb Restore OnRun() in the non-GUI unit test suite.
Commit 3e67b1ef68 broke the test suite in
non-GUI case, we still need to override OnRun() then to run the tests.

Also make it more clear that m_exitcode is only used in the GUI case.
2015-04-12 18:50:21 +02:00
Vadim Zeitlin
c9a2a685cf Fix the unit test suite exit code in case of failure.
Return the program exit code from the (overridden) OnRun(), not OnExit(),
doing it from the latter didn't work since many years.

The failures in the GUI tests will be detected by buildbot now.
2015-04-12 17:52:34 +02:00
Vadim Zeitlin
fc2eab62aa Check for "buildbot" user in IsAutomaticTest().
The new buildbot setup runs the code under this user, so adjust the check for
running under buildbot to detect it.
2015-04-12 17:52:33 +02:00
Vadim Zeitlin
6dba08aead Disable another wxStopWatch test case in the build bot builds.
We can't rely on the program waking up quickly enough when running on the
(loaded) buildbot machines, better to skip this test than to have spurious
failures.

This is a backport of 5de9b53902 from trunk.
2015-04-10 19:49:46 +02:00
Vadim Zeitlin
b46b5a2a06 Fix the expected size of the header logo on www.wxwidgets.org.
The image has been updated in the website repository and online, update its
expected size to reflect it and fix the unit test suite.
2015-04-03 16:42:31 +02:00
Vadim Zeitlin
7ffa1c4d3a Fix typo in DateTimeTestCase::TestParseRFC822() method name.
No real changes, just s/Parce/Parse/
2015-02-26 00:54:59 +01:00
Vadim Zeitlin
b8e42da6b2 Fix resource compiler include path for Borland.
Explicitly include $(BCCDIR)/include/windows/sdk directory in the resource
compiler options, as it needs it to find windows.h.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-11 15:48:22 +00:00
Vadim Zeitlin
7f1e03a22a Rebake and rerun autoconf after 3.0.3 version update.
Don't forget to update configure, this time.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-06 17:33:15 +00:00
Vadim Zeitlin
4dae66dffc Fix several problems with number formatting in wxNumberFormatter.
We shouldn't add thousands separators nor remove trailing zeros for the
numbers in scientific format.

Also avoid "-0" as output.

See #15625.

[This is the backport of r75560 from trunk.]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-06 12:35:19 +00:00
Vadim Zeitlin
04519a46d7 Don't change a shortcut file name when changing its path.
wxFileName::MakeRelativeTo() is only supposed to change the path of the file,
not its name, but it was doing the latter for the shortcuts as it implicitly
resolved them to the name of their target.

Fix this by ensuring we do not use wxPATH_NORM_SHORTCUT in MakeRelativeTo().

Closes #16239.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 23:22:45 +00:00
Vadim Zeitlin
dbf432f126 Fix wxListCtrl sort callback signature in the test under Win64.
Use wxIntPtr instead of long which is not big enough to hold a pointer in
Win64 builds.

Closes #4309.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-03 15:50:43 +00:00
Vadim Zeitlin
d1471a66b3 Add support for "%V" and "%G" to wxDateTime::Format().
This is useful for creating ISO 8601 week number based stamps.

Closes #11857.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-27 23:04:30 +00:00
Vadim Zeitlin
0cfd00335d No changes, just update the file name in the header.
Update the name in the header to match the actual file name.

See #12904.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-26 10:50:29 +00:00
Vadim Zeitlin
c93368ea3c Implement bounding box computations for wxGDDC.
Update the bounding box in all the methods drawing something. This wasn't
done before in many of them, resulting in the bounding box remaining empty,
but it is updated now and a new test checking that it is was added.

Closes #12904.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-26 01:41:30 +00:00
Vadim Zeitlin
0de26e62a7 Fix inserting an element of wxArrayString itself back into it.
Do the insertion/addition before deallocating the old memory to allow things
like array.Add(array[0]) to work correctly.

Closes #2290.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-13 14:27:29 +00:00
Vadim Zeitlin
7da4930b12 Fix memory leak in ArraysTestCase unit test.
Clear the items in PTR array explicitly, this is not done by the array itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-13 14:27:23 +00:00
Stefan Csomor
cf6844b735 reverting incorrect fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-07 05:15:33 +00:00
Stefan Csomor
db50ad17bc adding padding nuls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-06 19:39:47 +00:00
Vadim Zeitlin
4af9d1aace Generate 64 bit configurations in MSVC 8/9 projects.
Update bakefile configuration to include x64 configurations into MSVS 2005 and
2008 projects (2003 doesn't support building in 64 bits, 2010 and later are
manually maintained and already have them) and rebake the projects.

See #13675.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-24 23:52:39 +00:00
Vadim Zeitlin
52b452881f Update the version to 3.0.2 and rebake everything.
This is the result of running misc/scripts/inc_release and bakefile_gen.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-16 17:50:58 +00:00
Vadim Zeitlin
fa2838c120 Fix wrong resulting string length in UTF-16 to wchar_t conversion.
Don't optimize the returned length for surrogate-less case, this does save a
pass of the string but at the price of returning a wrong result, which is not
worth it, just compute the really required length exactly.

Closes #16298.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-28 19:33:47 +00:00
Vadim Zeitlin
9286390af2 Update the URL of the web site images used in the test.
The old images don't exist any more after web site redesign.

Also, the new favicon can't be loaded from an unseekable stream because it
contains multiple icons, so point to the old favicon instead.

Closes #16049.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-06 13:49:47 +00:00
Vadim Zeitlin
1e1a0b9d75 Fix harmless signed/unsigned comparison warning in a test.
Don't compare int with unsigned to avoid warnings that were introduced by the
changes of r75936.

See #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-02 18:07:46 +00:00
Václav Slavík
4ffdda9961 Fix VarArgTestCase::ArgsValidation() after r76026.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-28 16:16:13 +00:00
Vadim Zeitlin
12231256e4 Fix wxCmdLineParser::Found(name) for options with values.
Calling Found() without providing the second "value" argument started
generating an assert since introduction of the negated options as it reused
FoundSwitch() which can only be used for switches, i.e. options without
values.

Fix this to revert a regression since 2.8 and also add unit tests for the
different Found() overloads.

Closes #15986, #16001.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:31:49 +00:00
Vadim Zeitlin
4c711c8002 Fix wxTextCtrl contents corruption with long strings in wxMSW.
wxMSW automatically extended wxTextCtrl length limit beyond the tiny standard
32KB when it was exceeded, but part of the text being appended into the
control was lost when doing it.

Fix this by retrying insertion after extending the limit.

Closes #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:31:35 +00:00