Commit Graph

1216 Commits

Author SHA1 Message Date
Vadim Zeitlin
556a836e0f Don't cache incorrect length in wxString::assign(char*, size_t).
The length of the string here is specified in bytes and is not the same as the
string length for non-ASCII UTF-8 strings, so don't cache it as the string
length.

Just invalidate the cached length instead as we simply don't know what the
real length of the string is going to be.

See #14130.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-23 15:13:13 +00:00
Vadim Zeitlin
bd42a07c7a Fix caching wrong length in wxString(str, len) ctor in UTF-8 build.
A length greater than that of the source string could be passed to this ctor.
This worked correctly, i.e. created a string which was a copy of the source
one but cached a wrong length for it.

Avoid this by explicitly checking the length before caching it in
wxString::assign(str, len).

See #14130.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-23 15:13:08 +00:00
Steve Lamerton
1e0b0d7c55 Add new WX_ASSERT_EVENT_OCCURS macro to improve behaviour of testing asynchronous events. Use it in the wxWebView tests and re-enable previously failing tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-12 14:57:44 +00:00
Steve Lamerton
e7aa703d4b Delete buttons when we are finished so they do not overlap later controls and cause test failures.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-11 15:27:40 +00:00
Steve Lamerton
744d91d41f Move getting the unit test event count from wxTestableFrame to the EventCounter class. This reduces the need to have wxTestableFrame pointers all over the unit testing code and should reduce bugs caused by counting the wrong events.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-11 14:32:24 +00:00
Vadim Zeitlin
1f29ecb357 Check for iterator validity when parsing "%%" in wxDateTime::Format() too.
This is similar to the previous commit and adds another missed check for the
iterator not being at the end of string.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-09 01:09:25 +00:00
Vadim Zeitlin
649148f93e Check for end of string when parsing "%z" in wxDateTime::Format().
We could dereference an invalid iterator when parsing "%z", check for this in
the code and add a unit test for this case.

Closes #14075.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-09 01:09:20 +00:00
Vadim Zeitlin
bb5a951418 Use __WINDOWS__ for OS checks and __WXMSW__ for GUI checks (round 2).
This is continuation of r70796 and serves the same purpose.

Closes #14065, #14066.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 20:31:42 +00:00
Vadim Zeitlin
e18a74e240 Take disabled windows into account in wxFindWindowAtPoint() in wxMSW.
Use ChildWindowFromPointEx(CWP_SKIPINVISIBLE) to ensure that we find the
disabled children (by not using CWP_SKIPDISABLED).

Add a unit test to check for the correct behaviour in all cases and document
it.

Closes #2942.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 00:29:17 +00:00
Vadim Zeitlin
7cd60fb938 No changes, just cleanup TopLevelWindowTestCase unit test a little.
Remove the unnecessary overrides of setUp() and tearDown().

Also get rid of trailing whitespace.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 00:29:14 +00:00
Paul Cornett
f8497215c1 Fixes to allow running with 64-bit wxGTK
- use correct printf format specifiers
- don't perform operations requiring a window until the window has been created


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-01 07:09:43 +00:00
Vadim Zeitlin
2a408a4bf2 Add wxGCDC benchmarks to graphics benchmark for comparison with wxDC.
Also benchmark rectangles and bitmaps in addition to lines drawing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-01 01:05:28 +00:00
Vadim Zeitlin
b02dd12239 Use /bin/echo for creation of Mac OS X PkgInfo files.
The built-in of /bin/sh doesn't handle "-n" option that we use (at least not
under OS X 10.6), so we were getting "-n APPL????" in the generated files.
Fix this by using /bin/echo which does support this option.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-28 22:48:39 +00:00
Vadim Zeitlin
7c9b6c9111 Compare file inodes if possible in wxFileName::SameAs().
This allows to correctly return when the two files with different names
actually refer to the same file system object.

Closes #910.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-25 23:49:35 +00:00
Vadim Zeitlin
41fec01fa9 Remove temporary files created by wxFileName unit test case.
Don't leave temporary files created by wxFileName::CreateTempFileName() lying
around.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-25 23:49:32 +00:00
Michael Wetherell
8bda419d02 Remove testing against zip in a pipeline as it no longer supports it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-21 20:11:16 +00:00
Vadim Zeitlin
9362d82351 Fix unit test French locate checks for glibc >= 2.8.
Until 2.7 glibc wrongly used periods instead of slashes as separators for the
French date format and the test accounted for this, breaking it with recent
glibc versions in which this bug was fixed.

Fix this by limiting the workaround to the old glibc versions only.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-20 10:59:37 +00:00
Vadim Zeitlin
996d3fe3f8 Added wxFileName::Exists().
This function checks for existence of anything with the given name, not
necessarily just a file or a directory.

Extend the unit test to verify that it returns true for /dev/null on Unix
systems.

Closes #953.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-15 15:39:46 +00:00
Vadim Zeitlin
901504c383 Refactor wxFileName existence checking code.
Merge FileExists() and DirExists() together in a single
wxFileSystemObjectExists() helper in preparation for adding a function
checking for the existence of any kind of file system object.

There should be no changes for MSW/Unix but OS/2 file detection was changed
slightly to always use DosQueryPathInfo() instead of using it only for the
directories and stat() for files. Not sure if this is the right thing to do
there but it seems like the code should work.

Also add a simple unit test for these functions.

See #953.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-15 15:39:41 +00:00
Vadim Zeitlin
49a63afbad Avoid CRT deprecation warnings for MSVC build using makefiles too.
Define _CRT_SECURE_NO_DEPRECATE, _CRT_NON_CONFORMING_SWPRINTFS and
_SCL_SECURE_NO_WARNINGS when using makefiles to build the library too for
consistency with the project files.

These defines are only needed for VC8 and later but should do no harm for the
previous versions.

See #11009.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-07 21:38:31 +00:00
Vadim Zeitlin
ba7512e14d Rebake all project files to reflect MSVC deprecation warnings defines.
Rebake all the projects after the changes of r70182, even if they're only
really needed for the library itself, the other project files should
correspond to the bakefiles contents too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-07 21:38:09 +00:00
Vadim Zeitlin
75717cb121 Fix handling of positional parameters in wxPrintf() and related.
Handle positional parameter specifications in wxFormatConverter to ensure that
e.g. "%N$s" are correctly transformed to "%N$S" if needed. This fixes the use
of positional parameters under OS X.

Closes #10965.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-06 13:28:34 +00:00
Vadim Zeitlin
cec8d6774a Add unit test verifying compilation of various wxFont ctors.
Check that various invocations of wxFont ctor at least compile to avoid
problems like the ones fixed by r70450.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-23 14:42:56 +00:00
Vadim Zeitlin
5c7fe47762 Fix wxAffineMatrix2D::Translate() to multiply on the left.
The affine transform was previously multiplied by the translation matrix on
the right but this was incompatible with both the MSW version of the same
method and all the other methods of the generic version.

So multiply the transform by the translation on the left, as everywhere else.

Closes #13875.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-23 11:28:16 +00:00
Vadim Zeitlin
f7f7b59ab2 Added a simple benchmark of wxLogDebug() and wxLogTrace().
Measure time taken by these calls when the debug/trace messages are not
enabled.

See #11829.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-22 00:58:09 +00:00
Vadim Zeitlin
71f44b1bc4 Update the message catalog charset expected by the unit test.
The charset of the message catalog files changed to UTF-8 in r70411 but the
unit test still expected ISO-8859-1. Update the unit test too to make it pass
again.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-20 23:18:29 +00:00
Vadim Zeitlin
f2c6e60762 Ensure wxCharTypeBuffer data is NUL-terminated after extend() call.
As wxCharTypeBuffer ctor taking the length NUL-terminates the buffer, it may
be expected that extend() does the same but it did not. Do add the NUL at the
end for consistency, even though it's not really needed for the existing code
using extend() in wxWidgets itself.

Closes #13885.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-20 22:11:51 +00:00
Dimitri Schoolwerth
2d143b6689 Removed ellipsis from "About..." occurrences.
MS and Apple guidelines mention ellipses should generally be used when a command needs additional information from the user before the operation can execute. This is not the case for showing an about dialog so the ellipses have been removed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-20 16:51:09 +00:00
Dimitri Schoolwerth
ecc8721a0a Changed .po files to use UTF-8 charset.
Changing the localisation files to be in UTF-8 allows them to be committed by the pre-commit hook script.

Also regenerated relevant .mo files.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-20 16:33:41 +00:00
Vadim Zeitlin
e4a23857ec Implement wxMenuBar::EnableTop() for wxMSW and wxGTK.
This method was only available in wxUniv before and just always returned true
in the other ports. Implement it for wxMSW and wxGTK too now and document it.
Also add a unit test.

Closes #795.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-15 13:41:17 +00:00
Vadim Zeitlin
2db3b9a6a4 Fix unit test build with wxUSE_ZIPSTREAM or wxUSE_TARSTREAM == 0.
Disable the tests using wxZipEntry when it's unavailable. Also do the same for
wxTarEntry.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-15 12:28:57 +00:00
Vadim Zeitlin
be74a2a21a Fix the size of the font returned from wxTextCtrl::GetStyle() in wxMSW.
Due to a typo the size was expressed in 1/10th of a point and not in points.
Fix this and add a unit test checking that GetStyle() returns the same font as
was set by SetStyle().

Closes #2120.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-14 17:57:11 +00:00
Vadim Zeitlin
86d19346c5 Fix wxDateTime unit test compilation without PCH.
Include wx/time.h to get wxGetTimeZone() declaration.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-05 10:21:46 +00:00
Vadim Zeitlin
444bc2b24d Implement support for "%z" in wxDateTime::Format() and Parse().
"%z" specifier can now be used when printing the dates out to specify the time
zone and is also recognized when parsing dates.

Closes #1215.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-05 00:47:10 +00:00
Vadim Zeitlin
e4aadc2f1d Update wxGrid unit tests after r70177.
The row/column selection is not stored in the block arrays, see #12638.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-29 23:39:27 +00:00
Steve Lamerton
d296f9a114 Disable final failing wxWebView test. It fails on the buildbot but not locally.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-28 10:01:05 +00:00
Vadim Zeitlin
d130167576 Increase the tolerance in wxStopWatch unit test.
Sleeping can take more time than expected when running on the build slaves,
probably because the machine is heavily loaded. Increase the tolerance to
prevent this from resulting in test failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-26 12:57:49 +00:00
Vadim Zeitlin
51ec29ea5d Always link with expat in monolithic build.
Fix linking errors when using wxXML in sttaic monolithic build: in this case
we must link with expat but it was listed too early, before wxWidgets
libraries using it, in the bakefile-generated makefiles.

Now add it to the end of the linker command line too by including -lexpat in
EXTRALIBS_FOR_BASE which are appended to the linker arguments.

Notice that now -lexpat is linked twice because it is still added by
<wx-lib>xml</wx-lib> in bakefiles, even in monolithic build, but I don't know
how to avoid it and it is harmless anyhow.

Closes #12573.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-25 13:28:01 +00:00
Vadim Zeitlin
4a04898fe0 Really fix the use of deprecated methods in wxGrid test.
The changes of r70111 were wrong, the unit test for wxGrid really did intend
to test the deprecated methods so restore them -- but only in
WXWIN_COMPATIBILITY_2_8 case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-24 18:30:52 +00:00
Vadim Zeitlin
b73da1a41b Don't use deprecated methods in wxGrid test.
Don't use the methods defined only when building 2.8-compatible mode to let
the tests compile even with WXWIN_COMPATIBILITY_2_8 off. This only worked
before because of the wrong tests in grid.h but broke after the fixes of
r70098.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-24 17:58:32 +00:00
Steve Lamerton
8a31648287 Disable some wxWebView tests that fail on the buildbot but not locally.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-24 10:08:37 +00:00
Steve Lamerton
ed1c9160bf Add some extra yields to wxWebView unit tests to hopefully fix some of the failing buildbot runs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-23 19:16:47 +00:00
Vadim Zeitlin
921e411cc1 Ignore extra modify events after rename in wxFileSystemWatcher.
Document that such extra events may occur and generally improve the event
types documentation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-21 00:26:06 +00:00
Vadim Zeitlin
08670ea85a Update version to 2.9.4 in version.bkl too and rebake everything.
Change the version for Unix shared libraries too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-18 14:35:50 +00:00
Steve Lamerton
7f98bdd6a5 Ensure wxWebViewIE::SetPage clears the existing content before writing the new output. Also add a basic unit test to verify correctness in the future.
Fixes #13770

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-18 11:51:52 +00:00
Vadim Zeitlin
69b554dccc Try to get more information about wxFileSystemWatcher unit test failures.
Log the original and new paths of the rename event to help debugging the extra
modification events detected during the buildbot builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-16 21:11:19 +00:00
Vadim Zeitlin
bfbd873bfe Don't use wxTE_DONTWRAP style in Lines() wxTextCtrl unit case.
The last check in this test couldn't pass under MSW as it relied on the (long)
line of text being wrapped but the style used for the control prevented this
from happening. Not sure how could it have ever worked before but in any case
removing wxTE_DONTWRAP does make the test pass.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-16 19:57:17 +00:00
Vadim Zeitlin
b281a92305 Keep the item being updated selected in wxMSW wxChoice::SetString().
Changing the text of the selected wxChoice (or wxComboBox, as it derives from
it in wxMSW) item made it unselected. Fix this by explicitly restoring the
selection to the item if needed.

Closes #13769.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-16 19:47:58 +00:00
Vadim Zeitlin
17d72a48ff Fix bug with wxStopWatch::Start() not resuming paused stopwatch any more.
Since r69835 the stop watch remained paused even when Start() was called. Do
resume it when restarting it both for backwards compatibility and because it
makes more sense and also document this behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-03 00:34:00 +00:00
Paul Cornett
612633432a add test for bug fixed in r69878
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-01 08:08:24 +00:00