Commit Graph

1848 Commits

Author SHA1 Message Date
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
Artur Wieczorek
0fc246176a Add to the test suite a test of setting non-rectangular clipping region
Added a test of creating triangular clipping region (with wxDC::SetDeviceClippingRegion).

See #17609
2016-07-31 23:57:03 +02:00
Artur Wieczorek
ef46f24f37 Add test of scaling wxImage
Upsampling the image with symmetrical contents to check if symmetry is preserved in rescaling.
2016-07-22 23:00:48 +02:00
Artur Wieczorek
097625de52 Fixed rescaling of wxImage
When wxImage is rescaled with wxIMAGE_QUALITY_BILINEAR, wxIMAGE_QUALITY_BICUBIC or wxIMAGE_QUALITY_BOX_AVERAGE algorithm then for proper interpolation there is necessary to uniformly (linearly) map entire pixel range in the new image to the entire pixel range in the current image, i.e. pixels positions (integer values) in range [0..newDim-1] has to be mapped to "virtual" pixel positions (not necessary integer values) exactly in the range [0..oldDim-1].
[0..oldDim-1] range of target mapping is required because for proper interpolation every "virtual" pixel has to be located between two physical pixels in the current image.
Thus scaling ratio used to find corresponding pixels in the current image should be (oldDim-1)/(newDim-1) and not oldDim/newDim (which is used now).
When image is e.g. upsampled oldDim/newDim ratio then some new rightmost/botommost pixels are mapped to old pixels > (oldDim-1) and their values are improperly interpolated (in the current implementation their positions are just truncated to (oldDim-1) to bypass the problem and upsampled image looks like it was shifted left/up). The larger scaling ratio the effect is more visible.

Note:
Because reference images used currently in the unit tests were created with improper scaling there is necessary to upload new reference images created with fixed scaling.

Closes #17594
2016-07-22 23:00:33 +02:00
Artur Wieczorek
874da289ef Modified parameters in clipping box tests.
Some coordinates of clipping regions given in device coordinates has to be slightly modified to avoid rounding errors in conversions from device to logical coordinates.
2016-07-17 18:19:32 +02:00
Vadim Zeitlin
fe2052fb35 Skip the recently added wxString test broken with libc++
This should have been part of 90eaa1bbe3 and
should finally really fix the build with libc++ after the changes of
14ec2691f6.
2016-07-16 01:46:45 +02:00
Artur Wieczorek
9ecea7dc74 Added tests to check setting of clipping region using device coordinates.
Tests of setting clipping region(s) with wxDC::SetDeviceClippingRegion() for transformed wxDC/wxGCDC (with changed device origin, logical origin and scale and with various renderers for wxGCDC) to check if all transformations are taken into account in the clipping box calculations.

See #17596
2016-07-15 20:57:21 +02:00
Vadim Zeitlin
14ec2691f6 Allow swapping wxString iterators in C++11 mode
Specialize std::iter_swap() for wxString::iterator in C++11 mode as the
default implementation of it doesn't work for iterators using "reference" type
different from "value_type&" as is the case for wxString::iterator.

This notably allows the code using std::reverse() with wxString iterators to
compile in C++11 mode, which wasn't the case before.
2016-07-14 16:36:24 +02:00
Artur Wieczorek
2b7aab70ff Added tests to check setting of clipping region for transformed wxDC/wxGCDC.
In these tests clipping region is set for transformed wxDC/wxGCDC (with changed device origin, logical origin and scale) to check if all these transformations are taken into account in the clipping box calculations.
2016-07-09 23:38:33 +02:00
Jouk
d2b3484e60 g_log_set_default_handler not avaliable for gtk1 2016-07-08 15:15:27 +02:00
Artur Wieczorek
2d096311c5 Fixed clipping box tests for Direct2D
Flushing native Direct2D renderer (invoking wxGCDC::Flush() -> wxGraphicsContext::Flush() -> ID2D1RenderTarget::Flush()) is apparently not enough to update underlying DC (with selected in bitmap) and therefore we have to destroy the renderer (which in turn invokes ID2D1RenderTarget::EndDraw()) to do so.
2016-07-05 21:58:48 +02:00
Artur Wieczorek
e953447ae9 Include GDI+ and Direct2D clipping box test cases only for MSW build. 2016-07-03 10:40:02 +02:00
Artur Wieczorek
4d91d6d2ff Enhance clipping box test cases
1. Added checking if actual drawing output is really clipped at the edge of the clipping box.
2. Added tests for wxGCDC with GDI+, Direct2D, Cairo renderers under wxMSW.
3. Added new test to check calculations for bounding box set entirely outside DC area.
2016-07-02 23:14:37 +02:00
Vadim Zeitlin
ffcdcc1617 Make wxTimeSpan::operator-() const
Due to an oversight, it wasn't declared as const, making it impossible to
subtract from a const wxTimeSpan object.

Fix this and add a unit test verifying that this compiles and works as
expected.

Closes #17583.
2016-06-30 19:09:04 +02:00
Artur Wieczorek
9bf97bd607 Use wxMemoryDC with selected wxBitmap to create wxGraphicsContext in the graphics test.
If there is no wxBitmap selected into wxMemoryDC which is passed to wxGraphicsContext then there is raised an assertion warning (harmless in this context but caught and reported by CppUnit). To suppress this message we need to select any bitmap into wxMemoryDC prior to creating a wxGraphicsContext.
2016-06-29 21:01:53 +02:00
Artur Wieczorek
eb7a9f85c5 Added new tests to check clipping box calculations for wxDC and wxGCDC.
See #17013
2016-06-29 21:01:36 +02:00
Vadim Zeitlin
68d235fed3 Output test name before GTK error messages in the test suite
Try to make it possible to understand where exactly do the GTK+ errors
appearing in the buildbot slaves output originate from by installing a custom
Glib log handler and prefixing the normal log messages with the name of the
test running when they're generated.

This required a small refactoring of DetailListener which is now always
installed, in order to always have access to the current test name, but still
needs to be explicitly enabled to produce output.
2016-06-29 18:49:47 +02:00
Vadim Zeitlin
8686ca62e7 Avoid asserts when destroying windows with mouse capture in tests
Destroying a window with mouse capture results in an assert, which is
translated into an exception when running the test suite. As this exception is
thrown from wxWindowBase dtor, it results in an immediate program termination
when using C++11 and can also have the same effect even when using C++98 if
this exception is thrown while already handling another exception due to a
test failure.

Try to avoid this by using a "safe" DeleteTestWindow() function instead of
deleting the window directly. Currently this function ensures that the window
doesn't have mouse capture before deleting it, but it could also be used to
check for other things later. Also, this commit only uses this function for
the two controls which do happen to be destroyed with mouse capture currently
(at least when using wxGTK), but it should probably be generalized to all
controls in the future.
2016-06-29 18:26:11 +02:00
Vadim Zeitlin
a7d82aa776 Turn off optimizations for all gcc versions in hash unit tests
Optimizations were turned off for g++ 4.8 to work around compiler bug
resulting in generating infinite loops for the code in this function in
052e598d09, but apparently other versions of g++
suffer from it as well, so just always turn them off until we can be sure
about the version of the compiler in which this bug was really fixed.
2016-06-29 15:43:01 +02:00
Vadim Zeitlin
68b2e06f70 Improve translated mnemonics unit test
Don't switch locale to Japanese, which might not be supported, but just use
wxTranslations directly because we only need translations, not full locale
support.

Also rename the test method to a more descriptive name.
2016-06-26 18:36:14 +02:00
David Hart
13068d3603 Strip mnemonics from CJK translations of menu items too
Chinese, Japanese etc translations use a special style for the menu mnemonics
and append them to the translated menu label in brackets, e.g. the menu label
could have the form of "<translation-of-file> (&F)".

Check for this style of mnemonics in wxStripMenuCodes() too and strip them as
well.
2016-06-26 18:36:11 +02:00
Lauri Nurmi
e45a9543d6 Fix unit test when char is unsigned by default
Skip test relying on char being signed if it isn't by default, as is the case
with gcc on some ARM platforms, for example.

Closes https://github.com/wxWidgets/wxWidgets/pull/299
2016-06-17 14:49:21 +02:00
Vadim Zeitlin
023ee99ea7 Don't crash in wxTextFile::GetLastLine() if the file is empty
Just return a reference to an empty wxString, as GetFirstLine() already does
(although this is actually questionable -- what if this string is modified?).

See #17283.
2016-06-09 16:48:01 +02:00
Artur Wieczorek
82a0e285d8 Added drawing rounded rectangles to the graphics benchmark.
This test is executed together with standard rectangles benchmark and both benchmarks are enabled with '--rectangles' option.
2016-06-05 23:14:48 +02:00
Vadim Zeitlin
d68eb10e3d Handle strings with embedded NULs in wxDataStream
Read/write the entire string and not just the part until the first NUL in it.

Closes #17556.
2016-06-04 21:47:12 +02:00
Artur Wieczorek
b58d58adc0 Implemented new drawing benchmarks.
Since for some renderers circles and/or ellipses are basic figures so it would be worth to test the performance of drawing them.
Respective tests are enabled with new command line options: "--circles" or "--ellipses".
2016-05-31 21:31:15 +02:00
Artur Wieczorek
573cb961cb Added option to select graphics renderer in the graphics benchmark application
Since there are several graphics renderers available under wxMSW it would be good to have ability to test graphics performance of any of them and not only the performance of default one.
Therefore new feature to run the tests with selected graphics renderer has been implemented in the benchmark application. Renderer can be selected with optional command line option: "/r renderer_name", when `renderer_name` can be either gdiplus, direct2d, cairo.
When no renderer is explicitly selected then default renderer is used.
2016-05-31 21:30:54 +02:00
Dimitri Schoolwerth
fe716b3c8e Fix 'not enough actual parameters for macro' warning
The macro wxGCC_WARNING_RESTORE is being used without a parameter which
MSVC warns about. Fix by passing the same parameter as when using
wxGCC_WARNING_SUPPRESS, namely deprecated-declarations.

Regression since b58c87db28.
2016-04-15 02:35:40 +00:00
Vadim Zeitlin
ba5a0a3878 Fix more typos in comments and wxFAIL messages
Closes https://github.com/wxWidgets/wxWidgets/pull/270
2016-04-14 16:08:28 +02:00
ARATA Mizuki
1809ade5ad Test the conversion of wxString from/to UTF-8 std::string in StdStringTestCase::StdConversion 2016-03-25 16:39:21 +09:00
Vadim Zeitlin
7eee3576cf Update version to 3.1.1
Update misc/scripts/inc_release script: remove non-existent any more files and
update the version in the MSVS 200x project files not generated by bakefile
any more and MSVS 201x project files which were not previously taken into
account.

Run it and rebake.
2016-03-03 23:23:06 +01:00
Vadim Zeitlin
a29928c4a5 Merge several fixes to wxGTK GUI test suite
The test suite now mostly passes for GTK+ 2 and at least doesn't crash (but
still has many failures) with GTK+ 3.

Closes https://github.com/wxWidgets/wxWidgets/pull/235
2016-02-27 18:04:17 +01:00
ARATA Mizuki
a2f0374052 Fix check for string termination in IsValidUtf8String()
The current code incorrectly returned true if the string contained
an invalid UTF-8 sequence after an embedded NUL.

Check the entire string if the length was explicitly given instead of stopping
at the first NUL.

Closes https://github.com/wxWidgets/wxWidgets/pull/236
2016-02-27 16:42:30 +01:00
Vadim Zeitlin
9fee931d6d Work around a crash in wxGTK3 GUI test suite
The tests crashed after running ModalDialogsTestCase::FileDialog() because the
next call to wxYield() resulted in the completion of an async operation
launched by the native file dialog which tried to dereference the already
destroyed dialog.
2016-02-27 02:41:18 +01:00
Vadim Zeitlin
de491dd67f Show wxTestableFrame from its ctor
No real changes, just always show the frame as we need it to be shown for the
tests to run anyhow.

Also update the nonsensical comment about creating a hidden window just before
showing it.
2016-02-27 02:41:18 +01:00
Vadim Zeitlin
e29bfda8d8 Fix wxComboBox unit test under wxGTK after recent changes
wxEVT_COMBOBOX_CLOSEUP is sent during idle time after the changes of
a216806c99, so add wxYield() to make sure that
the unit test gets it.

See #17223.
2016-02-27 02:41:11 +01:00
Vadim Zeitlin
6c2e702357 Add another sleep to make menu unit test pass under wxGTK
At least when using GNOME, the frame containing the menu doesn't appear on
screen in time for wxUIActionSimulator to use it without this.
2016-02-27 01:14:24 +01:00
Vadim Zeitlin
cceddaf3da dd a hack to make wxBitmapComboBox Editable() unit test pass
Sleep for a little while before sending text to this control as the test often
(although not always) fails without it under wxGTK.
2016-02-27 01:14:24 +01:00
Vadim Zeitlin
ea489e1a7d Fix assertion in the HtmlParser unit test case
Use wxHtmlWinParser instead of wxHtmlParser which can't be actually used
without being initialized with the tag handlers (it's not clear whether this
is really intentional...).
2016-02-27 01:14:14 +01:00
Vadim Zeitlin
fde8f93a49 Fix ellipsization unit test when using pixel scaling
When pixel doubling is in use, e.g. when using GTK+ 2 on high DPI displays,
the width of a single TAB can be greater than the hardcoded 50 width in the
test, which resulted in test failures.

Base the widths on the average character width to make sure we can always
ellipsize.
2016-02-26 15:09:39 +01:00
Vadim Zeitlin
b58c87db28 Avoid gcc deprecation warnings for wxNORMAL in the tests
We use wxNORMAL intentionally to test for its support, so we're not interested
in deprecation warnings about it.
2016-02-26 14:36:01 +01:00
Vadim Zeitlin
cb49eb5162 Fix harmless deprecation warning for g_type_init() in drawing test
Same as 3dde6ec2fe.
2016-02-26 14:34:23 +01:00
Catalin
33ad41a745 Removed obsolete symbols from comments. 2016-02-21 20:12:18 +02:00
ARATA Mizuki
5a92181ac1 Fix the length returned by UTF-32 conversion for non-BMP input
Don't optimize the required length as this is a tiny gain resulting in big
problems with the strings containing surrogates for which the actual result is
shorter than the length returned, resulting in extra NUL bytes at the end of
the converted buffer.

This is similar to 3410aa372f (see #16298) but
for UTF-32 and not UTF-16.

Closes #17070.
2016-02-21 14:38:17 +01:00
Vadim Zeitlin
8eac125e86 Revert "Temporarily ensure that the file functions test uses UTF-8"
This reverts commit a44bcb4746 which is not
necessary any more since the fixes to file name conversions in the previous
commit.
2016-02-19 02:52:43 +01:00
Vadim Zeitlin
ed09b7b6c0 Remove symlinks time comparison tests from wxFileName test
These tests don't seem to be sound, it's possible for one second or more to
pass between the two calls to GetTimes() and it's apparently possible for the
access time on the symlink to not change (due to /tmp being mounted with
"noatime" option perhaps?), resulting in Travis CI build failures.
2016-02-13 18:55:53 +01:00
Vadim Zeitlin
54c874d488 Don't duplicate information in detailed test output
No need to output wxGetOsDescription() twice.
2016-02-13 18:34:47 +01:00
Vadim Zeitlin
a44bcb4746 Temporarily ensure that the file functions test uses UTF-8
Work around the bug in the library which prevents Unicode file names from
working under Unix unless we use an UTF-8 locale.

Closes #11404.
2016-02-13 17:21:52 +01:00
Vadim Zeitlin
b08985ac24 Don't use std::auto_ptr<> in the test to avoid warnings
When compiling with g++ or clang in C++11 mode, the use of std::auto_ptr<>
triggers warnings about its deprecation, so replace it with wxScopedPtr<> as
this is simpler than choosing between auto_ptr<> and unique_ptr<>.
2016-02-13 13:36:58 +01:00
Artur Wieczorek
5245afa263 Add test cases to test file operations with Unicode file names
File names containing ASCII or non-ASCII (Unicode) characters are used in the
file function tests.
2016-02-13 04:01:28 +01:00
Vadim Zeitlin
314630945a Fix wxURI::Unescape() to work with Unicode strings
Such strings are not really URIs as they should have been encoded if they were
but we can obtain them from e.g. wxFileSystem::FindFirst(), so handle them
correctly here as it's simpler than checking all the places where Unescape()
is called.

Add a unit test checking that decoding an URI containing both Unicode and
percent-encoded Unicode characters works correctly.
2016-02-13 04:01:27 +01:00
Zane U. Ji
95abaa1f23 Return valie file URLs from wxFileSystem::FileNameToURL()
According to https://tools.ietf.org/html/rfc1738#section-5 the file URLs must
always start with "file://", so ensure that this is indeed the case.

Closes #16209.
2016-02-05 22:43:23 +01:00
Vadim Zeitlin
d480c12477 Add MSVS 2010, 2012, 2013 and 2015 projects for the tests
Provide a way to build the tests from MSVS, maintaining these files manually
is not ideal but it's still better than nothing.
2016-02-05 22:43:23 +01:00
Vadim Zeitlin
5dd5d68e67 Revert "Fix fields initialization in wxCommandEvent copy ctor."
This reverts commit 62763ad541 which seems to
have been completely unnecessary as the fields had been already initialized
and this commit actually broke initialization of the propagation level of the
copied wxCommandEvent objects.

Add a unit test proving that things do work.

Closes #16739.
2016-01-30 05:02:54 +01:00
Vadim Zeitlin
bef874a674 Skip network tests when running under Travis CI
These tests fail sporadically for some reason outside of our control, just
skip them rather than have frequent false positives.
2016-01-26 23:19:51 +01:00
Vadim Zeitlin
cdef013a8a Suppress harmless warnings about string literals in test code
We rely on string literals being of non-const char or wchar_t pointer type for
this code to compile, even if this results in warnings, so we're not
interested in these warnings in the test code itself.
2016-01-24 21:21:25 +01:00
Vadim Zeitlin
10daded3e9 Fix UnbindFromHandler() test compilation with C++98
Can't declare classes inside the function as they must have external linkage
to be usable with Bind().

Fixes the build after 99d9a81e28, see #17229.
2015-12-08 15:22:01 +01:00
Vadim Zeitlin
99d9a81e28 Fix crash when unbinding event handlers from other handlers
Calling Unbind() on another handler from the currently executing handler which
had been bound after (and hence executed before) the handler being unbound
resulted in a crash previously as the iterators used in the loop over all
dynamic event handlers became invalid.

Fix this by storing the dynamic event table entries in a vector instead of a
list (which is also more memory and speed efficient anyhow) and null the
deleted entries instead of removing them to avoid invalidating the iterators
and only really remove them once we finish iterating.

Closes #17229.
2015-12-08 03:02:37 +01:00
Vadim Zeitlin
530276ec6a Fix crash in graphics benchmark
Set the GL context pointer deleted in the frame dtor to NULL to ensure we
don't crash on exit when not using OpenGL.
2015-12-06 17:31:24 +01:00
Artur Wieczorek
7ddb522ec2 Extend benchmarks of drawing bitmaps on wxMemoryDC
Extended tests to determine speed of drawing RGB/ARGB bitmaps on target
bitmaps with different colour depths (RGB/0RGB/ARGB/system default).

See #16766.
2015-12-06 17:24:37 +01:00
Vadim Zeitlin
3fa5d92bc2 Build graphics benchmark too
Added the graphics benchmark to the bakefile, which didn't build it before,
for some reason.
2015-12-06 17:24:35 +01:00
ARATA Mizuki
0c02d70fa5 Add a test checking that conversions involving surrogates work
After the fixes in the previous commits conversions between wchar_t containing
surrogates and UTF-{8,16,32} work correctly, so add a test ensuring that this
is the case.

Notice that other conversions are still broken in presence of surrogates.

See #17070.
2015-11-13 20:32:24 +01:00
Vadim Zeitlin
37dd89a0da Don't rely on wxMBConv::cWC2MB(NULL) returning the exact byte count
UTF-32 conversions use a useful optimization by avoiding the extra scan of the
input wchar_t string in their FromWChar() and cWC2MB() implementation when
they are only asked to compute the required buffer size without actually doing
the conversion. However this means that for an input string containing UTF-16
surrogates (which is possible under MSW where wchar_t is 16 bits) the actual
size of the output string can be smaller than that returned by FromWChar(NULL).

Document that this may happen and avoid relying on the exact equality in the
tests.

See #17070.
2015-11-13 19:36:33 +01:00
Vadim Zeitlin
048ba4b509 Fail to convert wide string with incomplete surrogates to UTF-8
Correctly fail if the wide string being converted is UTF-16 encoded (which can
only happen on platforms using 16 bit wchar_t, i.e. MSW) and ends in the
middle of a surrogate pair.

Notice that other conversions still wrongly encode invalid wchar_t sequences
such as 0xd800 not followed by anything, this will need to be fixed in the
future, but for now at least make it work for the most commonly used
conversion.

See #17070.
2015-11-13 19:36:32 +01:00
Vadim Zeitlin
154ebfd1d9 Rename wxBoxSizer::m_minSize to avoid clash with the base class
wxSizer already has m_minSize field, use m_calculatedMinSize for the field of
the derived wxBoxSizer class to avoid confusion, just as wxFlexGridSizer
already did.

Also add a new unit test checking that GetMinSize() still works after this
change.
2015-10-11 01:00:38 +02:00
Vadim Zeitlin
5cce48186c Link with shlwapi.lib and version.lib under MSW
These libraries are required now that we don't load the functions from them
dynamically (see e78be14ac1)

Closes #17180
2015-10-07 18:56:33 +02:00
Tobias Taschner
a0fb808087 Add wxStandardPaths::GetUserDir() to get Desktop, Download etc
All major supported platforms have well defined per-user directories to store
Downloads, Music, Pictures, Videos and the Desktop files. The new method
wxStandardPaths::GetUserDir() allows for a unified way to access these on MSW,
OS X and Unix (if XDG user dirs specification is implemented for the latter).

See https://github.com/wxWidgets/wxWidgets/pull/89
2015-10-04 01:05:23 +02:00
Tobias Taschner
8282c1be0f Remove Windows CE support
Windows CE doesn't seem to be supported by Microsoft any longer. Last CE
release was in early 2013 and the PocketPC and Smartphone targets supported by
wxWidgets are long gone.

The build files where already removed in an earlier cleanup this commit
removes all files, every #ifdef and all documentation regarding the Windows CE
support.

Closes https://github.com/wxWidgets/wxWidgets/pull/81
2015-09-23 00:52:30 +02:00
Vadim Zeitlin
78d09e2e90 Document and test wxDatePickerCtrl::SetRange() date-clamping behaviour.
Document that the current value of the control is adjusted if it doesn't lie
in the newly set range and add a unit test to check for this, now that it
actually passes under all platforms, after the previous commits.
2015-07-17 17:59:40 +02:00
Vadim Zeitlin
c15ae5e4a3 Add a check for wxSocketServer creation to the unit tests.
This should prevent an assert failure which happens if we call Accept() on an
invalid server below and also confirm if the server creation really failed or
not.
2015-06-23 19:11:31 +02:00
Vadim Zeitlin
853a8ef76f Avoid warnings about narrowing casts in the long long tests.
Recent g++ versions give -Wnarrowing warning when a value outside of the type
range is used to initialize a variable of this type in { }. Avoid it in the
long long tests using explicit casts as we already cast between long long and
unsigned long long values here anyhow.
2015-06-21 15:56:06 +02:00
Vadim Zeitlin
d5fda9d69b Fix g++ version test in the previous commit.
sUse the correct __GNUC_MINOR__ instead of the wrongly autocompleted
__GLIBC_MINOR__.
2015-06-21 02:42:34 +02:00
Vadim Zeitlin
052e598d09 Avoid g++ 4.8.2 bug that resulted in infinite loops in the test suite.
g++ 4.8.2, shipped with Ubuntu 14.04, generates incorrect code for checking
the loop termination condition, resulting in never ending loops in
HashMapTest().

Disable the optimizations for this function for 4.8.[012] as the bug seems to
be fixed in 4.8.4 and several similar (but not really identical) bug reports
in gcc bugzilla have been fixed in 4.8.3.

This should allow the unit tests on Linux buildbots, using 4.8.2, to run to
completion again.
2015-06-21 02:24:50 +02:00
Vadim Zeitlin
04c4e5f177 Avoid reading one char beyond the buffer end in UnicodeTestCase.
Valgrind complains about reading beyond the end of buffer when using glibc
std::string for wxString implementation under amd64 Linux. Don't suppose that
the buffer has one extra null word at its end to avoid this.
2015-06-19 20:22:11 +02:00
Vadim Zeitlin
893102b926 Fix mismatched new[]/delete in a test case.
Use wxDELETEA() as the comment said we did -- except that we didn't.
2015-06-19 16:32:14 +02:00
Vadim Zeitlin
6037ce0e6f Disable unit test sporadically failing in wxGTK buildbot builds.
This failure seems to only happen on buildbot, at least it couldn't be
reproduced after 100 runs of the test locally, so it just doesn't seem
possible to debug it.

Disable it to allow detecting when other tests fail (which would be
unexpected, unlike this one).
2015-06-12 15:57:33 +02:00
Roberto Perpuly
aa5dbad410 Use FSEvents in wxFileSystemWatcher on OS X
The FSEvents API allows for creating watches in entire trees of
directories in an efficient manner.

Closes #16969.
2015-06-06 02:37:35 +04:00
Roberto Perpuly
f0e098fa06 Re-enable running FS watcher test on OS X
Use a workaround to compensate for the differences between a non-GUI and
GUI event loop with wxOSX. This allows the FS watcher tests to pass
(previously it would hang) under OS X without having to move the tests
to the test GUI application (where the tests do pass on OS X already,
without needing this workaround).

See #16969.
2015-06-06 01:29:52 +04:00
Roberto Perpuly
bb14d8e131 Fix re-running aborted FS watcher test
If the test is interrupted and run again an assert is raised because the
temporary fswatcher_test dir has had no chance to be deleted and still
exists. Fix this by removing the dir before each test.
2015-06-06 01:29:52 +04:00
Vadim Zeitlin
ef30f6fe63 Fix recently added wxFileName::MakeRelativeTo() unit test for non-Unix.
Don't hard code the use of slashes as path separators.
2015-05-30 03:38:03 +02:00
Vadim Zeitlin
fda09f917a Fix wxFileName::MakeRelativeTo() for directory relatively to itself.
The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.

Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.

Also add a unit test verifying that this works as expected.

Closes #17010.
2015-05-29 16:23:17 +02:00
Vadim Zeitlin
ee973e1fe7 Add more wxString::Format() positional parameters tests.
Verify that repeating positional parameters does work with wxString::Format()
instead of keeping these tests commented out in wxVsnprintf() tests, which are
not run at all if we're using the compiler-provided vsprintf().

Closes #9367.
2015-05-28 14:12:48 +02:00
Dimitri Schoolwerth
9a517e572e Revert "Disable wxFont::SetStrikethrough() test under wxOSX."
Enable the test again because strike-through support has been available
under wxOSX for some time.

This reverts commit 9b1aeb4c93.
2015-05-22 03:28:07 +04:00
Nick Matthews
d13278ecc3 Add support for DOCTYPE to wxXmlDocument.
Allow retrieving the DOCTYPE specified in an existing document as well as
specifying the DOCTYPE to use when writing a new one.

Closes #13779.
2015-04-26 15:36:48 +02:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
2d3f617b34 Fix crash in BoxSizerTestCase::IncompatibleFlags().
Reset the old window sizer pointer, otherwise it was deleted again in the
window dtor (thanks buildbot for finding this one).
2015-04-23 19:31:15 +02:00
Dimitri Schoolwerth
2d5ce25373 Work around failing file watcher test under XP.
Under only Windows XP the test FileSystemWatcherTestCase::TestTrees fails
during the RmDir(treedir) call (SHFileOperation strangely returns
ERROR_DIR_NOT_EMPTY). To make the test pass remove the treedir first and
only then the singledir. This is merely a workaround while the actual
problem is still to be investigated.
2015-04-19 13:34:39 +04:00
Vadim Zeitlin
7af8598903 Yet another wxStopWatch unit test fix for buildbot.
Relax the check in RestartBug() test too, the time can be slightly smaller
than expected (by ~2ms on disc-xp machine).
2015-04-17 01:43:57 +02:00
Dimitri Schoolwerth
25fcb85590 Fix TreeCtrlTestCase assert failure under Windows.
A '-' keypress doesn't collapse a tree item with the native MSW tree
control. Instead, when not using the generic tree control, simulate a
keypress of WXK_LEFT to collapse the root item . This fixes the assert
checking if the root item is collapsed after the keypress.

Regression since 9d7a7ec556 (which
mistakenly may have had treectrltest.cpp as part of its commit).
2015-04-16 03:13:54 +04:00
Vadim Zeitlin
594dc3396a Relax another check in wxStopWatch unit test.
Increase the upper bound even further to avoid spurious failures in the
buildbot builds.
2015-04-13 15:55:33 +02:00
Vadim Zeitlin
4556179fd1 Disable ItemContainerTestCase::SimSelect() for wxBitmapComboBox on buildbot.
This test inexplicably fails when running on buildbot (but not locally), so
just disable it to get a build without test failures.
2015-04-12 23:18:59 +02:00
Vadim Zeitlin
10a727bf1d Compare scaled images approximately in the unit tests.
Comparing them exactly results in tests failures when using compiler version
different from the one that was used to generate the test fails, see
http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/151149/focus=151154
and other messages in the same thread.
2015-04-12 22:56:24 +02:00
Vadim Zeitlin
ca0c422964 Relax wxStopWatch test to make it less likely to fail on buildbot.
Be prepared for sleeping taking more time than we budget for it on a highly
loaded machine such as a buildbot slave.
2015-04-12 22:47:46 +02:00
Vadim Zeitlin
b7778beeef Give more details in GarbageTestCase unit test.
Try to find out why this test fails in the OS X buildbot builds.

Use macros to ensure that all checks provide information about the bitmap (or
animation) type they fail for, without having to repeat the same code for
doing it many times.
2015-04-12 22:30:52 +02:00
Vadim Zeitlin
2d7875c926 Restore OnRun() in the non-GUI unit test suite.
Commit 3e67b1ef68 broke the test suite in
non-GUI case, we still need to override OnRun() then to run the tests.

Also make it more clear that m_exitcode is only used in the GUI case.
2015-04-12 18:21:47 +02:00
Vadim Zeitlin
3e67b1ef68 Fix the unit test suite exit code in case of failure.
Return the program exit code from the (overridden) OnRun(), not OnExit(),
doing it from the latter didn't work since many years.

The failures in the GUI tests will be detected by buildbot now.
2015-04-12 17:51:30 +02:00
Vadim Zeitlin
e8d969244e Check for "buildbot" user in IsAutomaticTest().
The new buildbot setup runs the code under this user, so adjust the check for
running under buildbot to detect it.
2015-04-12 17:40:10 +02:00
Vadim Zeitlin
31d1644daa Finally do fix use of wxTranslateFromUnicodeFormat() in the unit test.
Don't reference the never defined function in the test any more.

(This does) close #16118.
2015-04-10 17:51:01 +02:00
Vadim Zeitlin
806317dfcc Really really fix use of wxTranslateFromUnicodeFormat() in the unit test.
Don't build this test at all under Unix, where this function doesn't exist.

(Really really) closes #16118.
2015-04-10 17:01:29 +02:00
Vadim Zeitlin
ffcc18580e Really fix use of wxTranslateFromUnicodeFormat() in the unit test.
Update the function declaration in the test too.

(Really) closes #16118.
2015-04-10 16:24:58 +02:00
Dimitri Schoolwerth
adbc9863b2 Handle quotes in wxTranslateFromUnicodeFormat.
When parsing Unicode date formats text inside single quotes should not be
escaped and instead treated as literal text. In addition two single quotes
(either inside or outside quoted text) should be interpreted as a single
quote.

Fixes #16118.
2015-04-09 04:39:35 +04:00
Vadim Zeitlin
58114f22c3 Detect the use of incompatible flags for wxGridSizer too.
Complain if wxEXPAND is combined with both horizontal and vertical alignment
flags, as this doesn't make sense and, moreover, the behaviour has changed
since the last commit: now wxEXPAND is ignored instead of overriding the
alignment flags if they are combined.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
9aaa38c7c8 Make it possible to combine wxEXPAND and alignment in wxGridSizer.
Allow overriding wxEXPAND effect in one of the directions by specifying
wxALIGN_{RIGHT,BOTTOM} or wxALIGN_CENTRE_{HORIZONTAL,VERTICAL} together with
it (unfortunately this doesn't work for wxALIGN_{LEFT,TOP} as their value is 0
and so their presence in flags can't be detected).
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
7e865daa26 Add unit test for wxFlexGridSizer layout logic.
Currently just test that wxEXPAND flag works as expected.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
78b98bf00c Validate wxBoxSizer flags instead of silently ignoring invalid combinations.
Detect using flags corresponding to the major sizer direction (which doesn't
make sense as only the proportion governs the behaviour in this direction) and
also combinations of alignment flags with wxEXPAND.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
7811394694 Add WX_ASSERT_FAILS_WITH_ASSERT_MESSAGE helper.
This is similar to the existing WX_ASSERT_FAILS_WITH_ASSERT, but allows to
specify the message to give if the expected assertion is not triggered.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
636d08323f Assert if incompatible sizer flags are used.
We can't check for all the invalid combinations, but at least check for
wxALIGN_CENTER_HORIZONTAL+wxALIGN_RIGHT and wxALIGN_CENTER_VERTICAL+
wxALIGN_BOTTOM which never make sense and can be detected.
2015-04-08 23:35:18 +02:00
Dimitri Schoolwerth
66cfa40643 Deal with remaining cvs/svn keywords.
A few $Id$ references remained after commit
3f66f6a5b3 or appeared in newly added files.
Remove the lines containing svn keywords except when it concerns
third-party files. In that case keep the line as-is or collapse it to the
keyword if it had been expanded to contain wx commit information (only
occurs with src/zlib/ChangeLog).
2015-04-09 03:32:23 +04:00
Vadim Zeitlin
3ee12b2ca9 Convert all XPM files to Unix EOLs.
Just as the normal sources (*.h, *.cpp), these files should be using LF and
not CR LF.
2015-03-19 21:46:05 +01:00
Bryan Petty
164d5dbb37 Sync EOL normalization settings.
This reflects additions to .gitattributes in last commit.

See #15584
2015-03-17 13:47:20 -06:00
Vadim Zeitlin
0a8ea54125 Fix typo in DateTimeTestCase::TestParseRFC822() method name.
No real changes, just s/Parce/Parse/
2015-02-26 00:17:26 +01:00
Vadim Zeitlin
4c90d08f43 Fix the expected size of the header logo on www.wxwidgets.org.
The image has been updated in the website repository and online, update its
expected size to reflect it and fix the unit test suite.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-04 17:44:57 +00:00
Vadim Zeitlin
51404f8792 Cast size_t value when using it with printf() in a test.
Use %lu with a cast to avoid warnings in both 32 and 64 bit builds.

Closes #16720.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-10 00:14:14 +00:00
Vadim Zeitlin
069415c2a6 Fix wxStringTokenizer copy ctor and assignment operator.
Implement copying of wxStringTokenizer correctly: compiler-generated versions
didn't work as the position of the tokenizer didn't point into the correct
string after making the copy.

Fix this by adjusting the position iterator to use the copy of the string.

Closes #16339.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-20 15:08:09 +00:00
Vadim Zeitlin
0bb7676889 Disable surrogate-related unit test for MSW.
This test can't work when the in-memory representation is UTF-16, as we can't
convert surrogates to anything else in this case.

This fixes the unit tests broken since r76622, see #16298.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-14 19:36:51 +00:00
Vadim Zeitlin
f99ff49e29 Don't end converting prematurely on encountering consecutive NULs.
Don't stop converting subsequent chunks just because the length of one of them
was 0: this can happen if the first character of a string is a NUL or if there
are two (or more) NULs in it later.

Simply remove the check for this and continue as usual even in this case.

Also add a unit test verifying that we do translate NULs in input into NULs in
output.

Closes #16620.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-14 19:36:46 +00:00
Vadim Zeitlin
b9e0e606a8 Add support for 'z' size format specifier.
Assume that non-MSVC compilers support it directly and use 'I' for MSVC.

Closes #16596.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-12 20:48:41 +00:00
Vadim Zeitlin
2f51147732 Fix resource compiler include path for Borland.
Explicitly include $(BCCDIR)/include/windows/sdk directory in the resource
compiler options, as it needs it to find windows.h.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-11 16:30:00 +00:00
Vadim Zeitlin
adf8f9d0cd Handle multiple item insertion and deletion in wxSelectionStore.
Rename the existing but not implemented and never used OnItemAdd() method to
OnItemsInserted() and add OnItemsDeleted(), which is more efficient than
OnItemDelete() when many items are being removed from the control at once.

This is not used yet, but will be used in wxDataViewCtrl soon and maybe in the
other controls later.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-27 20:46:21 +00:00
Vadim Zeitlin
06ab4da3f3 Add wxSelectionStore::IsEmpty() helper.
Just a simple and potentially (although not right now) more efficient
equivalent to GetSelectedCount() == 0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-27 20:46:18 +00:00
Vadim Zeitlin
d058c09e9f Add possibility to iterate over all selected items in wxSelectionStore.
This is necessary for retrieving all the selected items at once: while doing
this is not recommended for a control with a potentially very large number of
items, it must be possible to allow using wxSelectionStore for wxDataViewCtrl
implementation as wxDataViewCtrl must implement its GetSelections() method.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-27 20:46:15 +00:00
Vadim Zeitlin
98c68150ed no changes, add more specific description of these tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:44:45 +00:00
Vadim Zeitlin
fae6a86a49 This statement that will cause segmentation fault before. Now it ok and enable it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:44:30 +00:00
Vadim Zeitlin
42d5c34c64 x11 alrady support GetUnicodeKey() by last commit, remove these check
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:43:41 +00:00
Vadim Zeitlin
ad84d9f97d make wxKeyEvent could get unicode key under x11, add a x11 keysym--unicode char map tab
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:43:37 +00:00
Vadim Zeitlin
813c7a15c1 add wxYield to make sure all event was executed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:43:06 +00:00
Vadim Zeitlin
f6fdfe8ebc about focused window, replace static variables implementation by DoFindFocus
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:58 +00:00
Vadim Zeitlin
adf61108be wxX11 return keycode by GetKeyCode directly, not support GetUnicodeKey yet
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:54 +00:00
Vadim Zeitlin
fdbc16ed8d add wxYield() after SetFocus, make sure the all event will be executed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:51 +00:00
Vadim Zeitlin
e5123cf2f4 disable the unit test under wxUniv too. wxGrid implementation may has bug that work with simulator
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:36 +00:00
Vadim Zeitlin
31f0808ee2 reenable this tests under wxUniv/x11 port. EventPropagationTestCase::MenuEvent cause the problem, not these. MenuEvent will be fixed later
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:29 +00:00
Vadim Zeitlin
d9b0c17412 modify the listbasetest.(10,5) is not a correct position in wxUniv/x11 listbase test. (10, 10) could work both on wxUniv/x11 and other ports(already tested)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:15 +00:00
Vadim Zeitlin
fe733e34c2 add maxline restriction in single line mode textCtrl. let textctrl will fire wxEVT_TEXT_MAXLEN and not recive the chars when the text length beyond the maxlength
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:12 +00:00
Vadim Zeitlin
ba7835e5c6 add wxYield() to make sure the former event will executed done
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:41:21 +00:00
Vadim Zeitlin
9d7a7ec556 after analisys the behaviour of treectrl in GTK and Qt, right arrow should not move down. Expand the current item will be fine
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:41:15 +00:00
Vadim Zeitlin
f83756c2e5 after reset the m_current(focused item) in ClearFocusedItem(), the test could pass under wxUniv. Due to wxGTK and wxOSX use it in same way. So remove the check in test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:41:12 +00:00
Vadim Zeitlin
bc19f463a2 add wxYield() after SetFocus(), set focus event needs to be processed before the control can accept input
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:41:06 +00:00
Vadim Zeitlin
4363f9b578 These test will cause test_gui segmentation fault, disable for now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:40:15 +00:00
Vadim Zeitlin
c40871e8ce Fix the prepocessor directive, from __WXOSX_COCOA__ to __WXOSX__
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:39:50 +00:00
Vadim Zeitlin
2bfd94d59c wxX11 use XColor directly, so wxX11 does not support alpha at all currently
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:39:41 +00:00
Vadim Zeitlin
196227619d Adjust comments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:39:28 +00:00
Vadim Zeitlin
7138937cb1 in wxUniv, non-editable textctrl must be set focus, so that could get input value
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:39:13 +00:00
Vadim Zeitlin
c24ded647e in wxGTK, wxOSX/Cocoa, plus wxUniv, GetNumberOfLines() always returns the number of logical, not physical, lines. See #12366, maybe they did not test wxUniv at that time.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:39:08 +00:00
Vadim Zeitlin
c2e18d75e5 Fix wxCALL_FOR_EACH() to work with more than 2 arguments with MSVC.
Due to a bug in MSVC handling of __VA_ARGS__ (see
https://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement)
wxCALL_FOR_EACH() didn't work correctly as long as more than two arguments
were used with it.

Work around the bug by protecting __VA_ARGS__ from being incorrectly passed as
a single token to the macro being called on every step: this was already done
for wxCALL_FOR_EACH itself with wxCALL_FOR_EACH_, but we need to do it for all
the helper macros too.

Also add a test checking that this does, actually, work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 00:59:53 +00:00
Vadim Zeitlin
1addaeaa75 Add wxUIActionSimulator::Select().
Add a helper to select an item in a wxChoice, wxComboBox, wxListBox or similar.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:01 +00:00
Vadim Zeitlin
c4470b8a48 Fix crash in unit tests after TextEntryTestCase::Editable().
The class TextEventHandler added in r77057 (see #3901) setup an event handler
which wasn't disconnected when the handler was destroyed, which resulted in a
crash later as the window it was connected to continued to exist and generate
wxEVT_TEXT events.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:51:56 +00:00
Vadim Zeitlin
614a0ef481 Don't change a shortcut file name when changing its path.
wxFileName::MakeRelativeTo() is only supposed to change the path of the file,
not its name, but it was doing the latter for the shortcuts as it implicitly
resolved them to the name of their target.

Fix this by ensuring we do not use wxPATH_NORM_SHORTCUT in MakeRelativeTo().

Closes #16239.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 23:22:05 +00:00
Vadim Zeitlin
df13791078 Merge wxQT branch into the trunk.
This merges in the latest sources from GSoC 2014 wxQt project with just a few
minor corrections, mostly undoing wrong changes to common files in that branch
(results of a previous bad merge?) and getting rid of whitespace-only changes.
Also remove debug logging from wxGrid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 01:50:11 +00:00
Vadim Zeitlin
edad9616e7 Return correct string from wxEVT_TEXT wxComboBox events.
wxCommandEvent::GetString() could return empty string for the
programmatically-generated wxEVT_TEXT events from a wxComboBox.

Fix this by extending the on-demand string retrieval in wxCommandEvent to
wxComboBox as well (it was done only for wxTextCtrl).

Also add a unit test checking that the string has the expected value in the
events sent by all wxTextEntry-derived controls.

Closes #3901.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-11 11:53:01 +00:00
Vadim Zeitlin
ab50aed57b Fix wxListCtrl sort callback signature in the test under Win64.
Use wxIntPtr instead of long which is not big enough to hold a pointer in
Win64 builds.

Closes #4309.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-03 15:50:54 +00:00
Vadim Zeitlin
29b68052bb Add support for "%V" and "%G" to wxDateTime::Format().
This is useful for creating ISO 8601 week number based stamps.

Closes #11857.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-03 12:47:36 +00:00
Vadim Zeitlin
db65392b95 Disable a harmless deprecation MSVC warning for wxNORMAL in a test.
Explicitly disable the warning just for the code using wxNORMAL as the use of
this deprecated constant can't be avoided in the code which tests for its
support.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-03 12:47:32 +00:00
Vadim Zeitlin
c3c0ae03fe No changes, just update the file name in the header.
Update the name in the header to match the actual file name.

See #12904.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-26 10:50:38 +00:00
Vadim Zeitlin
2098cafcad Implement bounding box computations for wxGDDC.
Update the bounding box in all the methods drawing something. This wasn't
done before in many of them, resulting in the bounding box remaining empty,
but it is updated now and a new test checking that it is was added.

Closes #12904.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-26 01:34:50 +00:00
Vadim Zeitlin
789f1a7975 Replace anonymous namespace with a named one in the test helpers.
This should avoid clang warnings about the function in anonymous namespace
being unused.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-14 19:17:12 +00:00
Stefan Csomor
cc48521426 forgotten commit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-14 17:15:59 +00:00
Stefan Csomor
c87149d7df attempt at getting rid of unused-function warning
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-14 15:37:21 +00:00
Vadim Zeitlin
45adc64f9f Fix inserting an element of wxArrayString itself back into it.
Do the insertion/addition before deallocating the old memory to allow things
like array.Add(array[0]) to work correctly.

Closes #2290.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-13 14:30:22 +00:00
Vadim Zeitlin
86e587a096 Fix memory leak in ArraysTestCase unit test.
Clear the items in PTR array explicitly, this is not done by the array itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-13 14:30:14 +00:00
Stefan Csomor
52920b4b9b reverting incorrect change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-07 05:16:33 +00:00
Stefan Csomor
37762124df adding padding nuls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-06 19:32:26 +00:00
Stefan Csomor
25d3db36b0 add zero termination for utf16
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-06 07:00:09 +00:00
Vadim Zeitlin
202f62b4c4 Generate 64 bit configurations in MSVC 8/9 projects.
Update bakefile configuration to include x64 configurations into MSVS 2005 and
2008 projects (2003 doesn't support building in 64 bits, 2010 and later are
manually maintained and already have them) and rebake the projects.

Closes #13675.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-24 23:54:08 +00:00
Dimitri Schoolwerth
1c49a2e1ba Fix exception while reinserting menu item.
After removing an item from a menu that item's parent menu is set to NULL
and can't be used any longer to insert the item again. Fix by remembering
the parent menu before removing the item from it.

Regression since r76251 (this commit is a partial revert of that commit).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-23 20:00:42 +00:00
Dimitri Schoolwerth
bab52682bc Fix wxMenuItem::SetBitmap infinite recursion (Vista+).
Calling a menu item's SetBitmap can result in a stack overflow. This
occurs when setting a bitmap after the menu item has already been added to
the menu and while running under Vista (and later). Under those
circumstances [Do]SetBitmap will call GetHBitmapForMenu which itself calls
SetBitmap again.

Fix by adding a simple check for re-entry.

Regression since r76202.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-23 19:58:13 +00:00
Vadim Zeitlin
af77028fcf Add wxDictionaryStringSortAscending comparison function.
Add "dictionary sort" callbacks and document them and the already existing
wxStringSortAscending() and wxStringSortDescending().

See #16330.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-23 12:02:09 +00:00
Vadim Zeitlin
3410aa372f Fix wrong resulting string length in UTF-16 to wchar_t conversion.
Don't optimize the returned length for surrogate-less case, this does save a
pass of the string but at the price of returning a wrong result, which is not
worth it, just compute the really required length exactly.

Closes #16298.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-29 23:48:40 +00:00
Vadim Zeitlin
498f07a5b2 Ensure that wxTestableFrame is shown on the (main) screen.
Undo the accidental commit of local modifications in r74997.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-27 17:27:10 +00:00
Paul Cornett
0b92a2083d Fix setting client data when adding items to a sorted wxListBox, broken in r74317
closes #16290


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-26 07:30:42 +00:00
Vadim Zeitlin
5de9b53902 Disable another wxStopWatch test case in the build bot builds.
We can't rely on the program waking up quickly enough when running on the
(loaded) buildbot machines, better to skip this test than to have spurious
failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76598 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-22 15:13:16 +00:00
Vadim Zeitlin
268b33d8a3 Add simple font tests for the drawing unit test.
Check that DrawText() results in the expected output.

Currently the tests are disabled for non-Windows systems because of the
problem with the reference file paths there.

See #16261.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-17 12:29:21 +00:00
Vadim Zeitlin
4d8ff19a1a Include renderer version into the platform tag in graphics context tests.
This allows to distinguish the results of the same renderer (e.g. GDI+-based
one) on the different OS versions (because GDI+ produces different results
under XP and Windows 8).

Closes #16260.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-17 12:29:08 +00:00
Vadim Zeitlin
898562f7d3 Make assert message in GraphicsContextDrawingTestCase more informative.
Include the paths of the files that we failed to copy.

See #16260.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-17 12:29:02 +00:00
Vadim Zeitlin
e9f4d80887 Remove checks for ancient gcc/MinGW versions.
Don't test for wxUSE_NORLANDER_HEADERS, this is always true since many, many
years.

Remove tests for gcc version < 3.3, notably 2.95: the minimal supported gcc
version is 3.4.

Closes #15727.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 13:01:35 +00:00
Vadim Zeitlin
8c7d31e615 Remove obsolete MSVC version tests.
Don't compare __VISUALC__ with versions 1200 (VC6) and earlier, such tests are
always true or always false now that we don't support VC6 any more, so just
remove them simplifying the code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76548 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 13:01:29 +00:00
Vadim Zeitlin
15f255cebb Remove support for Digital Mars compiler.
This compilers is not being developed any longer since many years, drop
support for it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 13:01:23 +00:00
Vadim Zeitlin
49b8d79c87 Remove (Open)Watcom support.
This compiler is not being developed since several years and almost certainly
can't be used to build the current wxWidgets sources anyhow, so remove all
support for it, including a lot of extremely ugly workarounds for its bugs
with template functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 13:01:06 +00:00
Vadim Zeitlin
ba8d58df6c Don't build drawing test plugin in static builds.
Static wxWidgets library can't be used in dynamically loaded plugin, simply
don't build it in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 10:53:55 +00:00
Vadim Zeitlin
a7a2978fb1 Remove remaining MSVC6 workspace files.
See #15726.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 10:00:30 +00:00
Vadim Zeitlin
9d3921122f Fix drawing test link in static build.
We must use wx_append template which adds the required GUI libraries when
using static versions of wxWidgets libraries and not wx_append_base.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 09:59:10 +00:00
Vadim Zeitlin
0d4ad161d5 Remove support for Win9x from wxMSW.
Most importantly, this allows us to remove all MSLU-related stuff.

Some functions which were previously loaded dynamically can now be just used
directly, too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76535 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 02:33:40 +00:00
Vadim Zeitlin
01f9accd19 Remove wxPM, wxWidgets port to OS/2.
This port is not used and is not being worked on, so remove it to reduce the
amount of the code which needs to be updated for every global change.

Also remove tests for VisualAge compiler which isn't used since ages.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-15 23:56:58 +00:00
Vadim Zeitlin
f4b80e5337 Remove MSVC6 support.
Don't support this compiler any more, this allows to get rid of tons of
MSVC6-specific workarounds, in particular we can now use Bind() and natural
template functions calls in the library code.

Also remove MSVC6 project and solution files and don't generate them when
bakefile_gen is ran any more (removing the remaining occurrences of msvc6prj
from the bakefiles results in weird bake-time errors, so it's simpler to just
leave them there).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-15 22:32:17 +00:00
Vadim Zeitlin
f641dfd78c Disable wxSleep() test case for buildbot builds.
This test keeps failing just because the buildbot machine are too heavily
loaded. This is not really an error, so just avoid running this test there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-10 16:20:13 +00:00
Vadim Zeitlin
86c286354f Enable wxCSConv UTF-7 test under Windows.
Even though it doesn't work with iconv under Unix, we can still enable this
test under Windows.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:39:31 +00:00
Vadim Zeitlin
56375f60c7 Disable TextCtrlTestCase::LongText() for non-MSW platforms.
At least under GTK SetMaxLength(), tested by this test, can't be used with
multiline text controls at all, so running it fails. Keep the test for MSW
only where SetMaxLength() works with controls of all kinds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-13 00:00:37 +00:00
Vadim Zeitlin
72aad0d6ea Use the same wxWeakRef implementation for complete and incomplete classes.
This fixes an ODR violation which could arise if wxWeakRef<T> was seen both
when T was an incomplete (e.g. just forward-defined) class and when it was
complete. As different implementations, with different binary layouts, were
used in these two cases, this resulted in fatal run-time problems.

Fix this by always using the slightly less efficient (because storing an extra
pointer) but simpler and safe "dynamic" wxWeakRef implementation.

Also get rid of checks for the ancient compilers such as VC6 and g++ < 3.3,
they are not supported any longer.

Closes #15884.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-12 00:10:54 +00:00
Vadim Zeitlin
ec7d7f6356 Don't build the drawing test in GUI-less builds.
This test requires GUI parts.

Closes #16145.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-01 22:49:04 +00:00
Stefan Csomor
9354ecbbeb fixing missing wxON_BLOCK_EXIT_OBJ1 error on gtk build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-31 19:42:08 +00:00
Stefan Csomor
5fb4d3044a testing whether this helps getting the drawing testsuite to build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-31 18:28:05 +00:00
Stefan Csomor
3fa022c8b6 adding log for nonprecomp builds, hopefully fixes test compiles on builbot
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-31 12:58:33 +00:00
Vadim Zeitlin
7f48a077ab Remove more unnecessary headers from drawing test.
Don't include GUI headers in non-GUI code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-19 18:01:15 +00:00
Vadim Zeitlin
b9a09f5e87 Fix WX_ASSERT_SAME_AS_FILE() definition in the new drawing test.
This macro should use AreFilesContentsEqual(), not
AreImagesFilesContentsEqual(), used by WX_ASSERT_SAME_AS_IMAGE_FILE().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-19 17:59:32 +00:00
Vadim Zeitlin
3f29a21d3e Don't include apparently unnecessary headers in drawing test.
wx/window.h shouldn't be needed in this non-GUI test.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 20:12:32 +00:00
Vadim Zeitlin
a4568e7c85 Add a new test checking wxGraphicsContext implementation correctness.
This test verifies that the output of wxGraphicsContext on the current system
matches the pregenerated reference output.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 19:31:21 +00:00
Vadim Zeitlin
399371921f Add font colour support to wxFontPickerCtrl.
Currently this is only really implemented under Windows, just as the colour
support in wxFontDialog, but make the API available under all platforms for
consistency.

Closes #11614.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 17:23:13 +00:00
Vadim Zeitlin
2c64172825 Reset the system last error value before checking it in wxLog test.
Explicitly set the last error indicator to 0 before checking that
wxLogSysError() logs it correctly as it wasn't always set to 0 otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-12 22:20:50 +00:00
Vadim Zeitlin
b356d1d3c7 Add wxFont::GetBaseFont().
This can be used to "undo" the result of Bold() ,Underlined() or Italic()
methods and returns an unadorned version of the font.

Closes #11815.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-11 20:48:20 +00:00
Vadim Zeitlin
acd8a61bd8 Do run TextStreamTestCase::TestULongLong() test case.
We ran TestLongLong test case twice because of an accidental typo.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-10 19:05:25 +00:00
Vadim Zeitlin
9151248ee0 Update the URL of the web site images used in the test.
The old images don't exist any more after web site redesign.

Also, the new favicon can't be loaded from an unseekable stream because it
contains multiple icons, so point to the old favicon instead.

Closes #16049.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-06 13:53:14 +00:00
Vadim Zeitlin
e7f2eb8f83 Fix harmless signed/unsigned comparison warning in a test.
Don't compare int with unsigned to avoid warnings that were introduced by the
changes of r75940.

See #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-02 18:06:47 +00:00
Václav Slavík
316fdcbd6d Fix VarArgTestCase::ArgsValidation() after r76027.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-28 16:15:39 +00:00
Vadim Zeitlin
e15d5575a7 Don't build wxFileSystemWatcher test if wxUSE_FSWATCHER==0.
Closes #16031.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-27 15:46:25 +00:00
Vadim Zeitlin
41d5ebc86f Fix wxCmdLineParser::Found(name) for options with values.
Calling Found() without providing the second "value" argument started
generating an assert since introduction of the negated options as it reused
FoundSwitch() which can only be used for switches, i.e. options without
values.

Fix this to revert a regression since 2.8 and also add unit tests for the
different Found() overloads.

Closes #15986, #16001.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:32:47 +00:00
Vadim Zeitlin
81b62354dc Fix wxTextCtrl contents corruption with long strings in wxMSW.
wxMSW automatically extended wxTextCtrl length limit beyond the tiny standard
32KB when it was exceeded, but part of the text being appended into the
control was lost when doing it.

Fix this by retrying insertion after extending the limit.

Closes #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:32:34 +00:00
Václav Slavík
f5d12dab44 Fix failing TextFileTestCase::ReadMixedWithFuzzing().
The test failed with 33% probability because it didn't account for
trailing non-newline character.  Fixed and also changed the test to
repeat itself a hundred times, to increase the probability of catching
problems like this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75823 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 10:15:06 +00:00
Václav Slavík
4cbb78cf7d Add line-endings fuzzing test to TextFileTestCase.
Stress-test wxTextFile's handling of unusual CR,LF characters.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-05 18:29:03 +00:00
Václav Slavík
fe6f8254fb TextFileTestCase: test for \r\r\r\n parsing.
While r75387 fixed parsing of \r\r\n, it still didn't handle triple-\r correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-05 18:28:51 +00:00
Václav Slavík
40eed079ec TextFileTestCase: test for correct parsing of empty Mac lines.
(This is failing both with and without r75387.)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-05 18:28:46 +00:00
Vadim Zeitlin
d94f3f5aba Fix bug with non-NUL-terminaed inputs in wxMBConvUTF8.
We read beyond the provided maximal length as we didn't update the remaining
length while parsing the remaining bytes of an UTF-8-encoded code point.

Fix this and add a test for it.

Closes #15901.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-29 22:25:14 +00:00
Vadim Zeitlin
5cfbf0dc4d Allow iterating over wxCmdLineParser arguments in order.
This allows the meaning of the options to depend on their order relatively to
the other options which wasn't possible before.

See http://review.bakefile.org/r/557/

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-28 13:04:55 +00:00
Vadim Zeitlin
f4c9767b49 Try rounding the values when resizing wxImage instead of truncating.
This would seem to make more sense and might also fix the test failures
resulting from tiny differences in arithmetic operations when compiled with
different compilers/under different architectures.

Regenerate the test files and commit (disabled) change to the unit test
allowing to do it again in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-26 16:24:42 +00:00
Vadim Zeitlin
d14879f2bd Fix benchmarks compilation with WXWIN_COMPATIBILITY_2_8 set to 0.
Include wx/crt.h explicitly to be able to use wxPrintf() and friends.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-07 21:54:48 +00:00
Vadim Zeitlin
419480cf22 Fix several problems with number formatting in wxNumberFormatter.
We shouldn't add thousands separators nor remove trailing zeros for the
numbers in scientific format.

Also avoid "-0" as output.

See #15625.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-05 21:10:52 +00:00
Paul Cornett
967a94c91a remove WXWIN_COMPATIBILITY_2_6, add WXWIN_COMPATIBILITY_3_0
closes #15792

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-04 20:07:33 +00:00
Václav Slavík
e8c5400118 wxTextFile: don't loose data with CRCRLF line endings.
Previously, when reading files with completely nonstandard - but
occurring in the wild thanks to broken Notepad - files with CRCRLF, all
content would be replaced with empty lines.

Fix the code to do what many editors do with such files: treat this as
data line followed by an empty one. This is not ideal, but it is better
than discarding data - and arguably, silently cleaning up the endings
wouldn't be great either (and would add extra complications for what is
an obscure and broken case).

See http://stackoverflow.com/questions/6998506/text-file-with-0d-0d-0a-line-breaks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-12-16 18:54:42 +00:00
Vadim Zeitlin
747a681f61 Try to use /proc/self instead of /dev/core in the unit test.
/dev/core doesn't seem to exist on the machines running Travis CI builds,
check if /proc/self can work there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-12-02 16:50:22 +00:00
Vadim Zeitlin
76845041b7 More version change related changes to the generated files.
Somehow not all files seem to have been regenerated after version.bkl change.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-23 00:34:42 +00:00
Vadim Zeitlin
4de86c0b26 Update version to 3.1.0.
And regenerate everything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-21 13:47:05 +00:00
Vadim Zeitlin
2f67c4ae07 Make windres command used in MinGW build configurable.
This allows to pass extra arguments to windres, which is especially important
when using 64 bit windres for building 32 bit applications as the generated .o
file uses a wrong architecture unless "-F pe-i386" is explicitly specified.

See #15601.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-26 20:29:57 +00:00
Vadim Zeitlin
b845aa636a Fix reading of files with Mac EOLs in wxTextFile.
The last CR-terminated line wasn't handled correctly.

Fix this now and add unit tests to ensure that it stays fixed.

Closes #15583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-15 13:04:23 +00:00
Vadim Zeitlin
910f1a96d2 Add wxOleConvertVariant_ReturnSafeArrays flag for better SAFEARRAY handling.
While we can't change the type of wxVariant to which SAFEARRAYs are converted
by default, it's much more convenient to work with the variant objects of the
correct type, i.e. using wxVariantDataSafeArray, when dealing with SAFEARRAYs,
so add a flag which can be set to tell a wxAutomationObject to behave in this
way.

Closes #14700.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:08:35 +00:00
Vadim Zeitlin
58a37d1c5a Don't leave dangling comboboxes in the GUI unit test suite.
Sort() and ReadOnly() tests created a new combobox without deleting the old
one, and so these comboboxes were left on the screen for the duration of all
the subsequent tests, subtly breaking them. E.g. this was responsible for
spurious breakages in the event propagation test case because sometimes the
context menu event showed the combobox context menu (why this didn't happen
always is another question...).

It would be great to find some way to ensure that nothing is left after a test
terminates but I'm not sure about how to do this with cppunit. So for now just
manually delete the extraneous comboboxes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:08:02 +00:00
Vadim Zeitlin
13a119cca8 Fix wxDataFormat comparison operators for wxDF_HTML under wxMSW.
This format is special as it doesn't have a fixed value and is registered
dynamically instead. So we need to call HtmlFormatFixup(), which checks if the
given custom format is actually wxDF_HTML, before comparing formats to ensure
that the real value assigned to this format compares correctly to the fixed
wxDF_HTML value.

Closes #15280.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:07:57 +00:00
Vadim Zeitlin
6a51bf145f Work around a failure in TreeCtrlTestCase::SelectionChange() unit test.
We were getting an extra event under MSW if the control was initially
unfocused, so do focus it. This is a work around as the extra event shouldn't
occur but I'm too afraid of changing wxMSW code itself so close to 3.0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:07:51 +00:00
Vadim Zeitlin
9d7f0c5f7e Avoid spurious errors when getting wxChoice or wxListBox client data in wxMSW.
Even after the changes of r70415, we could still report an error when the
item client data was set to -1 (== CB_ERR) as checking for GetLastError() was
not enough, we need to also ensure that the last error is reset before trying
to get the client data.

Also apply the same fix to wxListBox and add the tests verifying that this
does work correctly.

Closes #13883.

Also fix wxListBox::GetClientData().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:07:44 +00:00
Vadim Zeitlin
e7bdf0ac8d Change version to 3.0.0.
Keep "RC1" in the version string for now, but otherwise all version numbers
should be updated.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-11 01:46:08 +00:00
Vadim Zeitlin
17d698cca5 Consistently handle DST start time in wxDateTime::Set().
Always move the dates invalid due to DST (i.e. falling into the "missing" hour
on the DST start date) forward, as GNU libc does, even when using a different
CRT implementation, such as MSVC one which moves the invalid dates backwards.

This seems more expected and also fixes an especially bad problem which
happened due to moving the date backwards in Brazilian time zone where DST
starts at midnight as doing this changed the day and totally broke ParseDate()
assumption that setting wxDateTime to 00:00:00 at the given date really did
set it to this date.

Closes #15419.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-08 18:00:58 +00:00
Vadim Zeitlin
66b370d05f Rewrite wxLogXXX() macros to avoid "ambiguous else" warnings.
Use a dummy for loop instead of an if statement to avoid all problems with the
dangling else clauses: both the need for an artificially inversed "if" to make
the code like

	if ( something )
		wxLogError("...");
	else
		something-else;

to work as expected and to avoid warnings given by some versions of g++ and
clang for the code above advising to add explicit braces.

Closes #11829.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-31 17:41:16 +00:00
Vadim Zeitlin
7980868347 Removed a method using wxColour from non-GUI benchmark code.
No idea how could this work before but the presence of this code in the
non-GUI benchmark project prevented it from building. As it's not used anyhow,
just remove it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-31 17:41:13 +00:00
Vadim Zeitlin
69384772ac Fix wxMenu::GetTitle() before the menu is appended to the menu bar.
The mnemonics conversion was not done correctly when the menu title contained
them but the menu hadn't been appended to the menu bar yet.

Closes #15461.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-30 23:32:37 +00:00
Vadim Zeitlin
b736d59eb5 Don't generate any events from wxSpinCtrl and wxSpinCtrlDouble methods.
After the changes of r53758 wxMSW didn't generate any wxEVT_TEXT events but
this was still the case for the generic version (and hence for
wxSpinCtrlDouble under MSW too) and wasn't documented.

Fix all versions to avoid sending events for programmatic actions, add unit
tests checking this behaviour and document it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-06 17:00:00 +00:00
Vadim Zeitlin
36a0190ebd Add test for absence of events from wxSpinCtrlDouble ctor.
Run the same NoEventsInCtor() test as we already had for wxSpinCtrl for
wxSpinCtrlDouble as well.

Unfortunately currently there is no way to reuse the tests between these two
classes, we should refactor these test cases to use a common
SpinCtrlTestCaseBase<T> base class.

See #15375 which fixed the underlying bug.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-06 16:59:54 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
75f9a95448 Use [DOMRange markupString] to get selection source.
This DOMRange method, previously used in GetSelectedText(), seems to provide
exactly what we need so there doesn't seem to be any reason to use JS to get
the selection text, especially as it didn't even work under OS X 10.8 and
returned an empty string in the unit test.

The unit test still needs adjustment to pass because we don't get back exactly
the same HTML as we used originally, but with more relaxed matching it does
pass now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-16 14:10:17 +00:00
Vadim Zeitlin
a3b7db8729 No changes, just get rid of some wxT()s in wxString unit test.
They were unnecessary and cluttered the code too much.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-16 14:10:11 +00:00
Vadim Zeitlin
9b1aeb4c93 Disable wxFont::SetStrikethrough() test under wxOSX.
Strike through support is not available in wxFont under this platform, as
documented.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-15 01:32:00 +00:00
Vadim Zeitlin
2416cd031b Fix totally broken LocaleSetter class in the test suite.
It was based on a completely erroneous assumption that setlocale() returns the
locale that had been previously active when it actually returns the newly set
locale.

This fixes unit test failures in StringTestCase under OS X, as the locale
wasn't correctly restored by DateTimeTestCase that used this class.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-15 01:31:47 +00:00
Vadim Zeitlin
a2ae66251c Fix harmless Clang warning about unused class member in a test.
The m_i field is only used in the currently commented out debugging messages,
suppress a warning about it being unused.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-15 01:31:43 +00:00
Vadim Zeitlin
1ed753dc8d Fix harmless Clang warning about an unused function.
GlobalOnAnotherEvent() is not used in normal testing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-15 01:31:40 +00:00
Vadim Zeitlin
bd0f3ca697 Rebake all the samples and others makefiles too.
The samples makefiles were not regenerated after the recent Scintilla changes
(see r74425), do it now. There are no real changes for most of them (except
stc sample), but it ensures that rerunning bakefile doesn't change anything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-13 02:33:00 +00:00
Vadim Zeitlin
168d1f65c1 Reconcile HAVE_VARIADIC_MACROS and wxHAS_VARIADIC_MACROS definitions.
The main user-visible effect of this change is that giving configure
--disable-vararg-macros argument now really disables the use of variadic
macros whereas it didn't disable them in wx/cpp.h before.

It is, of course, also less confusing to not have two very similar but
different symbols.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-11 22:40:47 +00:00
Vadim Zeitlin
0646084eb2 Allow retrieving the descent and external leading of empty strings.
This used to work before wxTextMeasure changes so make it work again instead
of optimizing the case of empty string away and not returning anything in the
descent and externalLeading output parameters in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-10 01:28:18 +00:00
Vadim Zeitlin
700256bbdb Correctly restore the originally used C locale in wxLocale dtor.
Save the original locale used before we changed it instead of "restoring" the
same locate that this wxLocale object was using.

Add a unit test to verify that this does work as expected.

Closes #14873.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-06 22:48:20 +00:00
Vadim Zeitlin
c80ae45452 Only link with libwxscintilla if using Scintilla is enabled.
Correct the changes of r74408 to avoid using libwxscintilla if we don't build
it at all.

See #13837.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74425 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-06 19:14:59 +00:00
Vadim Zeitlin
2d5efafe74 Disable test for setting the creation time under Unix.
Also document that this doesn't work there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-06 19:14:20 +00:00