Commit Graph

1311 Commits

Author SHA1 Message Date
Vadim Zeitlin
5adf2ecd9e Fix printf format specifier in graphics benchmark.
Use "%ld" for long arguments to fix asserts under 64 bit architectures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:47:12 +00:00
Vadim Zeitlin
54d25f9d8a Added possibility to use OpenGL for bitmap drawing to graphics benchmark.
Draw the bitmap using OpenGL textures. Even without using PBO this results in
much greater performance than using wxImage or raw bitmap access.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:47:10 +00:00
Vadim Zeitlin
6e6f4d3572 Use a non-uniform bitmap for image tests in the graphics benchmark.
This makes it easier to estimate the speed of the display update visually.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:47:07 +00:00
Vadim Zeitlin
ce0cdeb0b7 No changes, just rename command line option in graphics benchmark test.
It's not used for lines only, so call it "number of iterations" and not
"number of lines" and use "N" instead of "L" option for it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:47:05 +00:00
Vadim Zeitlin
e45606e991 Add benchmarks for wxImage and raw bitmap access to the graphics test.
Compare the speed of drawing the bitmaps by synthesizing wxImage and
converting it to wxBitmap and directly modifying wxBitmap bits using raw
bitmap access.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:47:02 +00:00
Vadim Zeitlin
8c14cbc98c Allow selecting the kinds of DC to test in the graphics benchmark too.
Still run all the tests by default but allow specifying --dc or --gc as well
as --paint, --client or --memory to test just the specified kinds of DCs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:47:00 +00:00
Vadim Zeitlin
c80e612faa No real changes, just flush output in the graphics benchmark.
Show the output messages sooner instead of showing them all only when the test
ends.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:46:57 +00:00
Vadim Zeitlin
b9fb3b0671 Run wxClientDC and wxMemoryDC tests too in the graphics benchmark.
These tests were not run because OnPaint() handler was called before OnCreate()
and exited the main loop before the create event could be dispatched. Fix this
by just running everything from OnPaint(), like this we're sure to do it.

Also refactor the code a little to avoid duplicating the tests.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:46:55 +00:00
Vadim Zeitlin
51f64663bf Allow running only some graphics benchmarks to save time.
Running all the benchmarks is relatively long, so allow running individual
ones only.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-05 20:46:53 +00:00
Steve Lamerton
236cff7334 Rename all WEB_VIEW* style identifiers to WEBVIEW*.
This makes wxWebView consistent with the rest of the toolkit. 

Closes #15013

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-01 09:38:53 +00:00
Vadim Zeitlin
22a3b6e4b2 Don't include wxUniversal configurations in MSVC project files.
wxUniversal is practically not used under MSW and just confuses people.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-21 16:37:01 +00:00
Vadim Zeitlin
ae72623b64 Add wxCheckListBox::GetCheckedItems() helper.
This method is similar to wxListBox::GetSelections() and allows to retrieve
all checked items at once.

Closes #14969.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-21 11:18:55 +00:00
Steve Lamerton
39a18da1a8 Pass wxWANTS_CHARS to the wxRichTextCtrl constructor in the unit tests.
Fixes test failures caused by the return key being used for dialog navigation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 19:28:20 +00:00
Vadim Zeitlin
90e95e6117 Rename WXTHREAD_XXX_PRIORITY yo wxPRIORITY_XXX.
This will allow to reuse the same constants for the process priorities in an
upcoming commit.

See #14931.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:10:07 +00:00
Vadim Zeitlin
12ce0a7402 Fix wxDateTime::GetWeekOfYear() for the days in the last week of the year.
The code took into account the possibility that the days in the beginning of
the year might belong to the last week of the previous year but not that the
days at the end of the year could belong to the first week of the next year.

Closes #14973.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:48 +00:00
Vadim Zeitlin
09ca8913fa Fix wxSearchCtrl::HasFocus() in the generic version.
Override GetMainWindowOfCompositeControl() in the windows composing the
generic wxSearchCtrl to ensure that HasFocus() correctly returns true for the
entire control when any of them has focus.

Add a trivial unit test to check that this really works and facilitate adding
more tests for this class later.

Closes #14970.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:44 +00:00
Vadim Zeitlin
fe218f1e4b Fix setting initial wxSpinCtrl value outside 0..100 range in wxMSW.
Set the range before setting the initial value when creating wxSpinCtrl, as
otherwise the value was wrongly limited to the default 0..100 range instead of
the one really specified.

Closes #14894.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:14 +00:00
Vadim Zeitlin
7582edfbf9 Fix wxLocale::GetInfo() in C locale under Windows.
Don't use LOCALE_USER_DEFAULT when the locale hadn't been changed because the
user default locale often (and maybe even always) is different from "C" locale
used by the CRT resulting in mismatch between the conventions used by
wxDateTime::Format(), which uses the CRT locale, and wxDateTime::Parse(),
which uses Windows format. Instead use the hard-coded values corresponding to
the "C" locale to ensure we use the same values as the CRT in this case.

This also reverts r73244 which was applies to make the unit tests pass before
this fix as it's not necessary any longer.

Closes #14918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-29 21:53:13 +00:00
Vadim Zeitlin
9de31412ed Add a temporary workaround to make the tests pass.
Call SetCLocale() on tests startup to avoid problems with wxDateTime parsing
that happen when the user locale is different from "C" one under Windows.

See #14918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-22 02:35:07 +00:00
Vadim Zeitlin
f31f9900e4 Add wxFSW_EVENT_ATTRIB wxFileSystemWatcher flag.
This flag allows to monitor changes to the file attributes, such as file
modification time.

This patch adds the flag, support for it under Linux and the corresponding
modifications to the sample and the test suite.

Closes #14833.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-17 23:56:00 +00:00
Vadim Zeitlin
b77bb705dd Support monitoring only some events in wxGTK wxFileSystemWatcher.
Call inotify() with the appropriate flags instead of always using IN_ALL_EVENTS.

Closes #14832.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-15 22:24:22 +00:00
Vadim Zeitlin
c7619cf139 Replace a template function with template class to fix VC6 build.
VC6 doesn't like template methods, so use a helper template class instead,
hopefully this will finally allow it to compile the test suite again.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-12 15:50:13 +00:00
Vadim Zeitlin
75b2220eba Fix crashes after using "wildcard" wxEvtHandler::Disconnect().
When not specifying the function to disconnect, the associated event sink was
destroyed too early resulting in crashes later. Fix this and add unit tests
verifying that things work as expected and at least don't crash.

Closes #14563.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-10 12:22:32 +00:00
Vadim Zeitlin
4677003143 No changes, just fix a harmless warning in FileSystemWatcherTestCase.
Fix an unused parameter warning under non-Unix platforms.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-10 12:22:09 +00:00
Vadim Zeitlin
9ff99cb543 Fix filename test compilation with VC6.
Just disable tests resulting in an internal compiler error.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-10 12:21:46 +00:00
Jouk Jansen
67b09eacea Fix for specific filename syntax of OpenVMS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-07 09:00:25 +00:00
Václav Slavík
a96de8a36a Tests for wxTEST_DIALOG and wx/testing.h.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-01 16:45:14 +00:00
Václav Slavík
643e9cf9f6 Add wxTEST_DIALOG for testing of modal dialogs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-01 16:45:11 +00:00
Vadim Zeitlin
1bce253a23 Allow wxTextMeasure to work with non-native wxDC objects too.
Just forward back to wxDC itself in this case instead of using the
platform-specific code in wxTextMeasure that only works with native DCs.

See #14781.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-27 12:27:56 +00:00
Vadim Zeitlin
58263bb4c3 Make wxFILE_EXISTS_SYMLINK work on its own, without wxFILE_EXISTS_NO_FOLLOW.
Include the wxFILE_EXISTS_NO_FOLLOW bit in wxFILE_EXISTS_SYMLINK definition to
allow using just wxFileName::Exists(wxFILE_EXISTS_SYMLINK) which used to never
work because the link was followed.

Closes #14777.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-25 22:30:43 +00:00
Vadim Zeitlin
f94a952846 PCH-less build fix for DynamicLibraryTestCase.
Include wx/log.h needed by wxLogWarning().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-24 23:41:04 +00:00
Vadim Zeitlin
c66bfe457c Show some information about the environment in the unit tests.
For now just show the system description and the locale, this should already
be helpful for diagnosing some test failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-24 23:14:01 +00:00
Vadim Zeitlin
e282b73a5b Test for the shared library existence in DynamicLibraryTestCase.
Trying to understand why does the test fail in some build slaves builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-24 23:13:38 +00:00
Vadim Zeitlin
0fccda2ced Respect wxFileName::DontFollowLink() in wxFileSystemWatcher.
Watch the link itself and not its target if DontFollowLink() had been called.

Closes #14543.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-24 18:21:31 +00:00
Vadim Zeitlin
073d9e0f26 Don't use Shift-TAB in keyboard test.
This key combination seems to be intercepted by GTK now for keyboard
navigation purposes and we never get key up events for it. Just use a
different key.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-24 00:25:09 +00:00
Vadim Zeitlin
25db2c25bc Don't follow symlinks in wxFileName::Rmdir(wxPATH_RMDIR_RECURSIVE).
Following symlinks, possibly leading outside of the directory being removed,
is at best surprising and at worst dangerous, so don't do it and just mimic
the behaviour of "rm -rf", i.e. remove everything inside this directory,
including the symlinks themselves, but don't follow them.

Closes #14649.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-23 23:58:17 +00:00
Vadim Zeitlin
1ea95c73f8 Add a simple unit test for wxRegion::Intersect().
Check that Intersect() returns true, yet the intersection is empty.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-23 12:03:09 +00:00
Vadim Zeitlin
988f7eec77 Revert accidental incompatible change to wxFileName::DirExists().
The non-static version tests for the existence of the directory part of the
object only as is explicitly mentioned in the documentation, so do the test on
GetPath() and not GetFullPath() as we did since r72707.

Also add a unit test for this behaviour.

Closes #14771.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-22 15:51:26 +00:00
Vadim Zeitlin
a5f013566f Check the return value of system() and pipe() in the test suite.
This is mainly to avoid -Wunused-result warnings under recent Linux systems
but also could give valuable information if the call does fail.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-20 14:49:13 +00:00
Vadim Zeitlin
4213fd51cc Fix tests compilation in STL build after r72707.
Add an explicit call to wxString::c_str() as there is no implicit conversion
in STL build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-20 14:48:50 +00:00
Vadim Zeitlin
c50db84779 Allow testing for existence of specific file types in wxFileName.
Add "flags" parameter to wxFileName::Exists() to allow testing for the
existing of files of specific type: not only regular or directory but also
symlink, device, FIFO or socket.

And also to pass wxFILE_EXISTS_NO_FOLLOW flag inhibiting following the
symlinks without using DontFollowLink().

Closes #14542.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-19 22:02:15 +00:00
Vadim Zeitlin
bb996f2895 Fix crash in wxDC::GetMultiLineTextExtent() after last commit.
Don't call wxTextMeasure::DoGetTextExtent() with NULL width pointer, it now
supposes that both width and height pointers are non-NULL.

Add at least a trivial unit test for GetMultiLineTextExtent().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-17 23:06:07 +00:00
Vadim Zeitlin
8cd79b7af0 Factor out text measurement from wxDC and wxWindow into wxTextMeasure.
Add a new private wxTextMeasure class implementing methods for measuring text
and move the often duplicated (but not always identically) code for doing the
same from wxDC and wxWindow into it.

Currently this class is only really implemented in wxMSW and wxGTK.

Also extend the test for text measuring functions and rename it to
MeasuringTextTestCase from MeasuringContextTestCase as it's not wxGC-specific
any more.

Closes #14705.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-17 22:35:49 +00:00
Vadim Zeitlin
28dc9371d1 Remove unused code from MeasuringContextTestCase.
m_win variable was never used and setUp() and tearDown() were simply not
needed here.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-17 22:35:21 +00:00
Vadim Zeitlin
6eef5763a8 Check for filespec when generating events in wxFileSystemWatcher.
Instead of setting watches on individual files when a non-empty filespec is
given, always watch all the files but just ignore the events from the ones not
matching the filespec. This makes the code simpler and fixes several bugs.

See #14544.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-15 01:09:25 +00:00
Vadim Zeitlin
c063adebba Add support for symlinks to wxFileName.
Allow to work with the symlinks themselves and not the file they reference by
calling the new wxFileName::DontFollowLink().

Update Unix wxDir implementation to not treat symlinks to directories as
directories, this ensures that we don't recurse into the directories outside
of the original parent accidentally.

Closes #14542.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-15 01:09:01 +00:00
Vadim Zeitlin
76cfd1bf95 Make wxFileSystemWatcher watch entries reference-counted.
This helps to avoid problems that arise from watching the same physical file
system path multiple times, which could happen when adding a watch for a path
already watched because of a recursive watch on a parent directory, for
example.

Closes #14490.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-15 01:08:37 +00:00
Vadim Zeitlin
227dee95e0 Improve handling of file spec in wxFileSystemWatcher::AddTree().
Fix watching too many files (i.e. even those not matching the provided spec)
and asserts when removing a recursive watch with a file spec in wxMSW.

Closes #14488.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-15 01:08:13 +00:00
Vadim Zeitlin
f4370376b6 Fix bugs in the recently added wxDateTime::DiffAsDateSpan().
Correct the test for negative spans less than a month and use the correct
month for computing the number of days in it.

Also add unit tests for problematic cases.

Closes #14704.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-04 22:48:30 +00:00
Vadim Zeitlin
06a086e8d2 Fix fatal bug in the recently added wxFile::ReadAll().
Make sure we exit the loop when reading the file in chunks in
wxFile::ReadAll() and add a unit test for it to ensure that it's really
correct.

Closes #14725.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-04 22:47:44 +00:00