Commit Graph

965 Commits

Author SHA1 Message Date
Vadim Zeitlin
8859c7293e Use "C" locale for locale-dependent part of TextCtrlTestCase.
As we expect to get decimal points in the text control when we stream floating
point numbers into it, we must do it in a locale which uses decimal point,
e.g. "C" one. Otherwise the test failed when ran in e.g. French locale.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-22 23:46:02 +00:00
Vadim Zeitlin
232fdc630c Merge the new GUI tests from SOC2010_GUI_TEST branch.
Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-22 22:16:05 +00:00
Vadim Zeitlin
686d0cc0a6 Don't report spurious errors from wxSocket in "no wait" mode.
In wxSOCKET_NOWAIT mode wxSOCKET_WOULDBLOCK is not a real error as it's
expected and should be just discarded. Failing to do this could result in the
following scenario:

1. Try to read a big buffer with wxSOCKET_NOWAIT (setting wxSocket error to
   wxSOCKET_WOULDBLOCK).
2. Process small part of it.
3. Read more data from wxSocket -- which now goes to the data containing
   already cached data without going to the socket itself and this without
   resetting the error.
4. Check wxSocket::Error() which turns out to be (still) true.

And this was exactly what happened in mysteriously failing unit test case
reading wxImage contents from a socket: the failure was difficult to reproduce
because it depended on how much data exactly did we read from the socket in
one go.

Fix this by resetting the error properly and reenable the unit test which was
previously disabled for the build bot, it should pass now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-21 23:33:40 +00:00
Václav Slavík
926649a996 Fix attributes escaping when writing XML.
wxXmlDocument didn't correctly escape some characters that the spec says
must be escaped. Behaves correctly now.

Fixes #12275.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-04 14:57:30 +00:00
Francesco Montorsi
89a76d5d2c make POSIX and Windows implementation of wxThread::Run() coherently assert when trying to Run() a thread twice; add a test for it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-25 13:55:36 +00:00
Vadim Zeitlin
1cf9a80cc1 Don't run printf("%n") tests when _FORTIFY_SOURCE >= 2.
This prevents the test from aborting on Linux distributions which ship with
"fortified" version of gcc, such as recent Ubuntu, Fedora and Gentoo.

Closes #12240.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-18 11:52:58 +00:00
Vadim Zeitlin
b0f73b6701 Really set svn:eol-style property.
The last commit used incorrect property name, remove the erroneous property
and set the correct svn:eol-style one.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-17 14:55:45 +00:00
Vadim Zeitlin
0fbd8b9bbb Really fix interactive output test compilation in ANSI build.
Use a temporary wxString to make sure the code compiles in both ANSI and STL
versions too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-13 14:13:12 +00:00
Vadim Zeitlin
526954c596 Globally use "wxWindows licence" consistently.
Use "wxWindows licence" and not "wxWidgets licence" (the latter doesn't
exist) and consistently spell "licence" using British spelling.

See #12165.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-13 13:29:13 +00:00
Vadim Zeitlin
486b9734e8 Compilation fix for wxAnyTestCase in ANSI-only build.
Comparison of wxAny with wide strings is not available in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-12 22:50:47 +00:00
Vadim Zeitlin
da569065d8 Compilation fix for "interactive" test in wxUSE_STL=1 build.
wxString is not convertible (even explicitly) to char* in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-12 22:50:41 +00:00
Vadim Zeitlin
71e33c7524 Blind VC6 compilation fix for VarArgTestCase.
VC6 tries to use inaccessible copy ctor of the variable passed to
wxString::Format() for some reason.

Just disable the test for it, it's not worth trying to understand this
compiler, and our code gets tested with other ones anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-12 22:50:37 +00:00
Vadim Zeitlin
013078210b Disable test of format string with "%n" for MSVC 8+.
MSVC 8 and later disables support for "%n" in printf() by default. And
although it provides a function to re-enable support for it, it doesn't seem
to work for the functions we use.

Just disable the test which results in CRT assert when using this compiler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-12 22:50:32 +00:00
Václav Slavík
b113edcdd7 Fix format strings parsing to understand C99 %zu etc.
The parser used to understand only 'Z' specifier for size_t/ptrdiff_t,
which is non-standard libc5 extension. C99 defines 'z' for this purpose,
so use that. Compatibility with 'Z' is preserved.

Also support Visual C++'s non-standard 'I' modifier with the same
meaning.

Fixes #12192.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-03 14:24:23 +00:00
Václav Slavík
3b12da351c Fix vararg type checking to accept ints for %c.
It's perfectly legitimate to format int values as %c, so don't assert in
this case.

Fixes #12192.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-03 14:24:12 +00:00
Václav Slavík
df67b58b5b Fix another bad format string in the testsuite.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-24 11:25:54 +00:00
Václav Slavík
ad6e5c47de Add tests for printf arguments validation code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-24 10:34:36 +00:00
Václav Slavík
38914d5a51 Format strings fixes in test suite.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-24 10:34:23 +00:00
Václav Slavík
72e7920f2d Corrected formatting of archiver command in the tests.
wxString::Format() was used even when the first argument didn't contain
any %s, yet a string argument was always passed to it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-24 10:33:36 +00:00
Stefan Csomor
155362949b paint events cannot be constructed outside a native redraw in OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-22 13:48:17 +00:00
Stefan Csomor
f009da6ed5 paint events cannot be constructed outside a native redraw in OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-22 12:46:20 +00:00
Stefan Csomor
a2c8b98460 trying to get it building at least
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-22 11:49:09 +00:00
Francesco Montorsi
ddd4f327f7 blind buildbot fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 23:32:34 +00:00
Francesco Montorsi
995202d020 small warning+PCH fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 21:46:29 +00:00
Francesco Montorsi
81ec0e15af move console sample's interactive tests to two different CppUnit testsuites: InteractiveInputTestCase which requires user input and InteractiveOutputTestCase which outputs stuff to be checked from the user.
Leave in the console sample only a barebone console application (i.e. a real example).

Closes #11960

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 21:03:47 +00:00
Francesco Montorsi
10dee2ae3f better DirTestCase::DirExists test;
fix test cases /usr//bin and /usr///bin: they succeed because wxDir::Exists does not care about redundant path separator (and this holds also for non-Unix platforms);
add some more test case

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 19:47:14 +00:00
Francesco Montorsi
d6609db5a7 minor change: use a "positive" logic: use shouldSucceed instead of shouldFail and use more descriptive names for non-existing folders; add a few test cases
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 19:44:27 +00:00
Vadim Zeitlin
c14ae7f5b3 Correct the expected result of directory existence check.
As /.. is the same as /, a directory with any number of ".." in it will always
exist.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 12:19:14 +00:00
Stefan Csomor
6eb1e122cb using proper dylib for darwin
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-20 15:24:01 +00:00
Jaakko Salli
7c2257892c VC6 Fix: Use wxANY_AS() instead of wxAny::As<>()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-20 07:08:13 +00:00
Francesco Montorsi
e7747eb2e0 Move dir tests from the console sample to DirTestCase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-19 12:32:57 +00:00
Jaakko Salli
8561534085 Added (sanity) checks for the inplace allocation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-19 11:01:22 +00:00
Jaakko Salli
f1156cbb0d Added wxAny::HasSameType()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-18 13:30:47 +00:00
Jaakko Salli
109e2ca434 Added wxIsPod<>. Use it in wxAny instead of wxIsMovable<>.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-14 15:12:37 +00:00
Francesco Montorsi
69fc85873d moved non-interactive tests for wxDynamicLibrary, wxGet/SetEnv, wxTempFile, wxCopyFile to appropriate CppUnit test suites;
removed wxFile and wxTextFile tests (complete testsuites already exist for them)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-13 14:30:55 +00:00
Francesco Montorsi
701aa4d804 revert previous revision about localization of decimal points in GetHumanReadableSize() test strings: using CLocaleSetter is a better solution.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 18:52:28 +00:00
Francesco Montorsi
8e73dcda17 fix building without PCH
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64513 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 15:44:32 +00:00
Francesco Montorsi
1fe1aecb87 Move a couple of wxFileName tests from the console sample to the existing FileNameTestCase.
Fix FileNameTestCase::TestGetHumanReadable to check the result against expected strings using the correct decimal point for the locale used on the test machine.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 15:41:09 +00:00
Francesco Montorsi
49e323a5b5 remove some tests from the console sample:
- wxLog already has a better cppunit test class
- wxLocale test in the console sample didn't work on Windows and wasn't very useful

move some tests from the console sample to CppUnit tests:
- wxPathList => PathListTestCase
- wxModule => ModuleTestCase

remove some tests about removed functions of wxMimeTypesManager

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 14:21:27 +00:00
Francesco Montorsi
ffcd6cc61e fix StringTestCase::FromDouble: newer MSVC versions use three digits for the exponent width
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:56:58 +00:00
Francesco Montorsi
3634064463 Move some wxPrintf() tests (taken from glibc) to VsnprintfTestCase. Other tests are more difficult to convert in CppUnit style and not worth the effort (since now we don't use wx's own vsnprintf implementation anymore typically).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:42:26 +00:00
Francesco Montorsi
7b8ccf3321 Move wxRegConfig tests from console sample to a new wxRegConfigTestCase class.
Remove wxRegKey tests from console sample: on newer Windows they only work when run with admin privileges; also we can expect wx[Reg]ConfigTestCase to already check a good number of wxRegKey features.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:12:07 +00:00
Vadim Zeitlin
bbdee10d5f Fix recently broken forwarding of events between event handlers.
After the recent changes to the event processing logic, forwarding an event
from one event handler to another one stopped working correctly because the
per-event "process here only" flag prevented it from following the event
handler chain after forwarding. This notably broke keyboard navigation in
wxComboCtrl under MSW in wx itself and probably quite a few of other things in
user code.

Fix this by replacing the boolean flag with a pointer to the handler to which
the processing of this event should be restricted. This allows the full
processing to still take place if an event is forwarded to another handler.
So wxEvent::ShouldProcessHereOnly() is now called ShouldProcessOnlyIn() and
takes a wxEvtHandler parameter.

This made appear a problem in wxScrollHelperEvtHandler code that was hidden by
the bug above: the events were still processed multiple times in it. To fix
this, also add wxEvent::DidntHonourProcessOnlyIn() and take it into account in
the base class code. Did I mention that wxScrollHelperEvtHandler must die?

Add another unit test checking that forwarding works correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:31 +00:00
Francesco Montorsi
20ba398d1a disable FTPTestCase by default.
Add a warning for the user when running --list without arguments: not all tests are listed, only those enabled by default (e.g. FTPTestCase doesn't appear there)!


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 10:49:44 +00:00
Vadim Zeitlin
951201d81c Add wxString::FromDouble() and FromCDouble().
wxString::FromCDouble() is needed inside wxWidgets itself to format numbers
independently of the current locale. FromDouble() was added for symmetry with
ToDouble/ToCDouble() functions.

Use std::locale for the implementation if available and manual wxLocale-based
fallback otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:48 +00:00
Vadim Zeitlin
1a39b0131f No real changes, just avoid an unnecessary heap allocation in a test.
We don't need to allocate the locale object in StringTestCase::ToDouble() on
the heap (and then delete it -- or not, if an assertion fails before the
function end), it's enough and simpler to just create it as a local variable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:37 +00:00
Vadim Zeitlin
384859f8c6 Add wxConfig::Read(float *) overload.
This uses Read(double *) but casts the result to float after checking that it
is in the correct range.

Closes #12100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-29 10:35:38 +00:00
Francesco Montorsi
ec0e093913 move all non-interactive FTP tests from the console sample to a new CppUnit FTPTestCase test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-29 07:56:08 +00:00
Vadim Zeitlin
6889fa2c0b Remove non-working or semi-working tests added from console.cpp.
Remove tests added in r64324, there is no need to have commented out code
here and UTF-8 test was pretty strange as well (it's far from clear what
should the result of converting "utf8Invalid" be).

This also suppresses a warning that these changes introduced.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-23 10:53:17 +00:00
Vadim Zeitlin
f27d62bf2f Modify wxBoxSizer minimal size calculations to respect the proportions.
Make wxBoxSizer minimal size big enough to not only give each item enough
space to satisfy its minimal size but also to respect the proportions among
the items by default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-22 14:57:34 +00:00