Commit Graph

1710 Commits

Author SHA1 Message Date
Paul Cornett
3a9fc640e4 Don't crash on trailing '%' in wxDateTime::Format(). See #17931 2017-08-01 08:35:58 -07:00
Artur Wieczorek
8d94d4d9d3 Pass arguments of the same type to CPPUNIT_ASSERT_EQUAL
This is to avoid potential implicit conversions.
2017-07-30 09:56:43 +02:00
Artur Wieczorek
497f275e1b Add PositionToXY() and XYToPosition() to wxTextCtrl unit test
Added tests of PositionToXY() and XYToPosition() for multi- and single-line wxTextCtrl.
2017-07-30 09:56:27 +02:00
Bryan Petty
ed173ed91e Use HTTPS with Trac links. 2017-07-04 13:15:14 -06:00
Dimitri Schoolwerth
9b9f8ac468 Extend limits of allowed time zone offsets 2017-06-23 02:02:19 +04:00
Dimitri Schoolwerth
af309e6d96 Add minus sign (U+2212) as a time zone offset indicator 2017-06-23 02:02:19 +04:00
Dimitri Schoolwerth
1a5163a882 Add time zone parsing support for only specifying HH 2017-06-23 02:02:19 +04:00
Dimitri Schoolwerth
101433190f Add time zone parsing support for HH:MM 2017-06-23 02:02:19 +04:00
Dimitri Schoolwerth
a3a4e7c638 Add time zone parsing support for 'Z' (UTC indicator) 2017-06-23 02:02:19 +04:00
Dimitri Schoolwerth
51cfb64ecb Add test for wxDateTime time zone parsing 2017-06-23 02:02:19 +04:00
Dimitri Schoolwerth
3e945a0a5d Fix wxMSW test build in UTF-8 and ANSI build
Use wxString::t_str() with a function taking LPCTSTR (which is either
LPCWSTR or LPCSTR). And wxStrg::wc_str() for LPCOLESTR which,
ordinarily, is a wide string.
2017-06-22 02:04:50 +04:00
Vadim Zeitlin
bb306b7ed0 Merge fixes for handling Unicode characters outside of BMP
Closes https://github.com/wxWidgets/wxWidgets/pull/467
2017-06-21 19:10:12 +02:00
Dimitri Schoolwerth
a0d1a6fa83 MSW tests build fix: forgotten part of a previous commit
Add missing function declaration. This should have been part of a963edc.
2017-05-27 03:48:38 +04:00
Jose Lorenzo
b6f2973c41 Return true from wxDialog::IsModal() in wxEVT_INIT_DIALOG handler
Ensure that checking for dialog modality in wxEVT_INIT_DIALOG handler returns
true when the dialog is being shown modally in MSW and GTK.

Add a unit test checking that this is the case.

Closes #10385.
2017-05-22 01:21:43 +02:00
VZ
aebd8c728b Merge pull request #476 from discnl/fix-registry-delete-key
Fix deletion of registry keys from alternate registry view.

This didn't work due to a bug in code dynamically loading RegDeleteKeyEx().
2017-05-22 00:14:20 +02:00
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
Dimitri Schoolwerth
a963edca41 Add a registry key deletion test that fails with WoW64 2017-05-05 19:28:15 +04:00
ARATA Mizuki
ad47857072 Add a test case for constructing wxString with supplementary wxUniChar values
See #11827
2017-05-01 18:18:47 +09: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