Commit Graph

1693 Commits

Author SHA1 Message Date
Vadim Zeitlin
9427a8ba97 No real changes, just rebake MSVC test projects
This will eliminate trivial differences when anything really changes in
test.bkl.
2017-05-15 23:27:00 +02:00
Catalin
c4c7f12941 Do not explicitly tidy up when ending a test case 2017-05-14 22:32:59 +02:00
Catalin
640b7df69b Added a unit test for wxListCtrl::HitTest()
Run `ListBaseTestCase::HitTest()` only under MSW until proven to work with
other platforms too.
2017-05-14 22:32:08 +02:00
Vadim Zeitlin
f6d9d7962e Revert wrong fix for wxDateTime timezone conversion to/from local
This reverts commit aaddf6be7f as it broke
handling of dates when local time zone is BST, whose offset not counting DST
is 0, as for UTC, but which still should be handled as local timezone,
see #17220.

With the current wxDateTime handling of time zones, FromTimezone(Local)
doesn't make much sense anyhow, so abandon attempts to try making it work as
to really do it we need to specify the time zone being converted from too, as
explained in the second point of #10445.

See #16585.
2017-04-19 17:07:44 +02:00
Artur Wieczorek
2e9e3f5c31 Copy reference images required to execute unit test
Reference images necessary to run a test (see ef46f24f37) have to be copied to the target folder.
2017-04-15 00:13:13 +02:00
Artur Wieczorek
f171d48be4 Disable antialiasing in unit test
In order to examine real colors of pixels we need to have unmodified (aliased) edges between regions drawn with different colors.
For for wxDCs backed by wxGraphicsContext (e.g. under wxGTK3) antialiasing is enabled by default and to prevent falsifying pixel colors we have to disable it prior to drawing operations.

See #17666.
2017-04-14 09:15:04 +02:00
Artur Wieczorek
34e19a7449 Prevent unit test from crashing under wxGTK3
Under wxGTK3 default color depth for wxBitmap is 24 bpp and therefore wxAlphaPixelData cannot be used to get access to wxBitmap's internal data in this case.

See #17666.
2017-04-14 09:13:36 +02:00
Dimitri Schoolwerth
5a7570bf7d Fix failing unit test in MarkupTestCase
One of the wxMarkupParser tests expects "&" to map to "&&" however
this, purposefully, is not the case any longer since
60bd6842e4. Fix by changing the expected
result to contain a single ampersand instead of double.
2017-04-13 00:27:41 +04:00
Artur Wieczorek
ee4ab34686 Fix building tests with wxUSE_GRAPHICS_CONTEXT==0
Don't execute code which depends on graphics context functions if wxUSE_GRAPHICS_CONTEXT==0.
2017-04-09 21:29:14 +02:00
Dimitri Schoolwerth
3ae438b9ac Fix wrong variable name
The typo resulted in, depending on compiler used, an error ("undeclared
identifier") or warning. Fix by using the intended name.

Regression since 5552351393.
2017-04-08 11:44:02 +04:00
Vadim Zeitlin
e9ce55e000 Fix wxRmdir() with non-ASCII paths
Don't apply at best unnecessary, and actually harmful, as it uses a wrong
conversion, fn_str() when calling wxRmDir() which takes wxString.

Update unit tests to check that wxRmdir() now works with non-ASCII filenames
too.

Closes #17644.
2017-04-01 19:12:27 +02:00
Vadim Zeitlin
d145ef7205 Get rid of ugly "pUnitMsg" in the file functions unit test
No real changes, just simplify the code passing the message shown when a test
fails to CppUnit a bit.
2017-04-01 19:07:26 +02:00
jprotopopov
5552351393 Add unit tests for more file-related functions
Test wxDirExists(), wxIsAbsolutePath(), wxMkdir() and wxRmdir() too.

Closes #17830.
2017-04-01 18:47:16 +02:00
jprotopopov
9b1afaa7a6 Don't crash in wxFFile::Eof() and Error() if file is closed
Assert and return false instead, this is more developer-friendly.

Add unit tests to check that these functions really work as expected when
called on a closed file.

Closes #17828.
2017-04-01 18:43:13 +02:00
Kelvin Lee
c4f6cf21dc Use canonical format for MSVS project/solution files
Use the same format as is used by MSVS itself to avoid spurious changes when
modifying the files. Notably:

- Use DOS end of line format (0D 0A).
- Add UTF-8 BOM (EF BB BF) to the beginning of the files.
- Do not put CR LF at the end of the last line in the file.

Closes https://github.com/wxWidgets/wxWidgets/pull/440
2017-03-18 15:14:26 +01:00
Cătălin Răceanu
67e61df2a5 Add MSVS 2017 solution file for the tests
Allow (re)building the tests easily with the latest MSVS version too.
2017-03-11 17:55:08 +01:00
Vadim Zeitlin
1821a4043b Fix compilation error in a recent commit
Add semicolon missing from 7a2df9534c.
2017-03-11 03:48:06 +01:00
Vadim Zeitlin
9910013c23 Don't use gcc 4.8 workaround in the hash test with clang
This is unnecessary and just results in a warning about an unknown attribute
when building with clang.
2017-03-11 03:37:07 +01:00
Vadim Zeitlin
7a2df9534c Recognize Travis CI environment in the tests
Avoid running time-sensitive tests such as StopWatchTestCase under Travis as
they can result in spurious failures if the machine running the test is under
too much load.
2017-03-11 03:35:11 +01:00
Vadim Zeitlin
13da4f5253 No changes, just fix a typo in a comment
Spell "buildbot" correctly.
2017-03-11 03:32:07 +01:00
Cătălin Răceanu
e8207c8c59 Fix building tests with wxUSE_UNSAFE_WXSTRING_CONV==0
Avoid relying on implicit conversions to std::string in the tests code.
2017-02-24 15:37:37 +01:00
Artur Wieczorek
c6e4507c07 Add unit tests for wxHexToDec()
See #12814.
2017-02-23 20:50:18 +01:00
Artur Wieczorek
2ecd4a07ba Add unit tests for wxDecToHex() 2017-02-23 20:48:28 +01:00
Vadim Zeitlin
d15bbcacd2 Merge branch 'rmv_symbols_3' of https://github.com/catalinr/wxWidgets
Remove obsolete mentions of Windows 9x, Windows CE and OS/2.
2017-02-20 17:46:45 +01:00
Tobias Taschner
3206df50c4 Add Microsoft Visual Studio 2017 solution file for building wxMSW
Allow building with VS15 out of the box.

Closes https://github.com/wxWidgets/wxWidgets/pull/353
2017-01-16 17:02:10 +01:00
Vadim Zeitlin
59bd1178f1 Fix build with RTTI turned off using MSVC makefiles
Rebake these makefiles using fixed version of bakefile (pre-0.3.0).

See https://github.com/vslavik/bakefile/pull/85

Closes #17767.
2017-01-04 12:01:14 +01:00
Vadim Zeitlin
395d453c94 Link with oleacc.lib when using MSW gcc makefiles
This library is now required when wxUSE_ACCESSIBILITY==1, but was only linked,
using a compiler-specific pragma, when using MSVC resulting in link errors
with gcc.

Fix this by adding the library to the bakefile for non-MSVC compilers and
rebaking.
2017-01-04 11:50:18 +01:00
Vadim Zeitlin
092e772848 Use wxAlphaPixelData for default native bitmaps in the unit test
The unit test added in 607b800444 didn't work on
the systems using 32 bpp screens, i.e. almost all of them, because it tried to
use 24 bpp wxNativePixelData with them.

Fix this by using wxAlphaPixelData, which won't work on non 32 bpp systems,
and so is still not ideal, but at least makes the test work on most systems by
default.

See #17666.
2017-01-03 02:51:55 +01:00
Vadim Zeitlin
e3c245c226 Select the bitmap out of wxDC before using it in the unit test
The unit test added in 607b800444 had a bug as
it tried to use the bitmap directly while it was still selected into a
wxMemoryDC, which wasn't guaranteed to work and resulted in an assert.

Fix this by destroying wxMemoryDC earlier.

See #17666.
2017-01-03 02:50:26 +01:00
Vadim Zeitlin
4b4c572d5f Make wxTextCtrl Lines() unit test more robust
Verify that the last logical line was wrapped at least once, not exactly once,
as it could be wrapped more times depending on the font size.
2017-01-03 02:39:57 +01:00
Vadim Zeitlin
7122288416 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.
2016-12-09 17:44:04 +01:00
VZ
5551932c25 Allow using Bind() with non-public inheritance in C++11 code
Using Bind() with a method of the class deriving from wxEvtHandler
non-publicly used to result in a compile-time error, but at least with C++11
we can detect this case and allow the code to compile.

Closes #17623.
2016-11-29 19:32:40 +01:00
VZ
4212202a9a Add support for cache directory to wxStandardPaths::GetUserDir()
This has direct equivalent under macOS and when using XDG.

See #17727.
2016-11-29 19:32:14 +01:00
Vadim Zeitlin
d0c57dbef0 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).

Closes #17679.
2016-09-25 01:20:41 +02:00
Vadim Zeitlin
461d0b2005 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.
2016-09-25 01:19:53 +02:00
Tim Roberts
607b800444 Fix wxMemoryDC::Blit() with itself as source in wxMSW
Don't use StretchDIBits() native function as it doesn't seem to handle the
case when its source and destination are the same correctly.

Closes #17666.
2016-09-21 23:00:03 +02:00
Artur Wieczorek
c916845aaa Add new test of affine transformation matrix
Add test of concatenating two wxAffineMatrix2D.
2016-09-18 23:10:26 +02:00
Artur Wieczorek
fb9cbc0879 Add test suite to check wxGraphicsMatrix operations
Implemented tests of some basic operations like Invert() and Concat().

See #17670.
2016-09-18 23:09:44 +02:00
arata, mizuki
c225774d94 Remove obsolete MSVC project files for the tests
The files built with these project files seem to be included in
tests/benchmark/bench_vc[789]_bench.vcproj and these files themselves
are out of date.
2016-09-18 13:39:08 +02:00
Artur Wieczorek
ecaeceb878 Add few tests of retrieving bounding box
New tests of retrieving bounding box coordinates after two consecutive drawing operations, for the case when wxDC coordinates have been changed between the operations and for resetting the bounding box.

See #17667.
2016-09-16 22:29:34 +02:00
ARATA Mizuki
8cfc74491a Replace wxEXPLICIT with the 'explicit' keyword
See #17655.
2016-09-14 18:45:12 +09:00
Artur Wieczorek
83527e93d1 Extend affine transformation matrix tests
Add tests of affine transformation matrix for wxGCDC with various renderers.
2016-09-08 19:34:44 +02:00
Vadim Zeitlin
9cb762dbd2 Rebake to get rid of whitespace-only changes in generated files
This just commits insignificant changes after rebaking everything to make sure
they don't get mixed up with significant ones at some later time.
2016-09-08 00:48:06 +02:00
Artur Wieczorek
a37ed9a2b5 Add tests of setting clipping region and retrieving clipping box
These new tests are about setting clipping region and retrieving clipping box for wxDC and wxGCDC with applied transformations.

See #17646
2016-09-01 20:35:09 +02:00
Artur Wieczorek
d66ff48fb4 Add new tests to check clipping region with rotated wxDC/wxGCDC
See #17636.
2016-08-21 21:23:01 +02:00
Artur Wieczorek
6ca5c894cd Add tests of setting clipping regions with wxGraphicsContext
The scope of tests corresponds to the scope of existing wxDC/wxGCDC tests. Additionally, newly introduced wxGraphicsContext::GetClipBox() function is tested too.
2016-08-21 21:00:13 +02:00
Artur Wieczorek
c9a8dbedc8 Add a test of storing/restoring clipping regions with wxGraphicsContext.
See #17626.
2016-08-12 23:22:34 +02:00
Artur Wieczorek
e3be67a756 Add test of setting clipping region for transformed (rotated) wxGraphicsContext
See #17622
2016-08-09 20:49:58 +02:00
Artur Wieczorek
0f31e05cb8 Adopt clipping box tests for GTK+ 3 environment
1. Under GTK+ 3 wxDC is implemented as wxGCDC (with underlying Cairo renderer) and hence there is no need to test wxDC individually.
2. wxRegion is implemented under GTK+ 2 using GdkRegion but under GTK+ 3 it is implemented using cairo_region_t so some region attributes can be slightly different in some circumstances for both ports. This happens e.g. for non-rectangular regions which can have slightly different clip extents for GTK+ 2 and 3. We have to take this into account in the tests of non-rectangular clipping region and accept that actual clipping box position can differ of few pixels from expected position (so comparing clipping box positions shouldn't be exact but with some error tolerance).
2016-08-09 20:48:43 +02:00
Vadim Zeitlin
985ff1e26e Check for self-assignment in wxArrayString
Assigning array to itself destroyed its contents -- check for this now.

Closes #17619.
2016-08-09 01:07:59 +02:00