private field 'm_dwCookie' is not used
'return' will never be executed
result of comparison of unsigned enum expression < 0 is always false
'FlushDC' overrides a member function but is not marked 'override'
potentially uninitialized local variable 'bound' used
Simplify the test by using a single function instead of all the
machinery inherited from CppUnit.
Also provide more information in case of test failure.
Drop the legacy CppUnit testing framework used for the unit tests.
Replacing it with Catch has the advantage of not requiring CppUnit
libraries to be installed on the system in order to be able to run
tests (Catch is header-only and a copy of it is now included in the
main repository itself) and, in the future, of being able to write
the tests in a much more natural way.
For now, however, avoid changing the existing tests code as much as
[reasonably] possible to avoid introducing bugs in them and provide
the CppUnit compatibility macros in the new wx/catch_cppunit.h header
which allow to preserve the 99% of the existing code unchanged. Some
of the required changes are:
- Decompose asserts using "a && b" conditions into multiple asserts
checking "a" and "b" independently. This would have been better
even with CppUnit (to know which part of condition exactly failed)
and is required with Catch.
- Use extra parentheses around such conditions when they can't be
easily decomposed in the arrays test, due to the use of macros.
This is not ideal from the point of view of messages given when
the tests fail but will do for now.
- Rewrite asserts using "a || b" as a combination of condition
checks and assert macros. Again, this is better anyhow, and is
required with Catch. Incidentally, this allowed to fix a bug in
the "exec" unit test which didn't leave enough time for the new
process to be launched before trying to kill it.
- Remove multiple CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() macros,
our emulation of this macro can be used only once.
- Provide string conversions using Catch-specific StringMaker for
a couple of types.
- Replace custom wxImage comparison with a Catch-specific matcher
class.
- Remove most of test running logic from test.cpp, in particular don't
parse command line ourselves any longer but use Catch built-in
command line parser. This is a source of a minor regression:
previously, both "Foo" and "FooTestCase" could be used as the name of
the test to run, but now only the latter is accepted.
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.
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).
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
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
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
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
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
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
We need to ensure that all windows are realized before querying their
positions on screen, so add an extra wxYield().
Also adjust the tests slightly as the windows are now all created in the
beginning of the function.
Finally, use Destroy() instead of wxDELETE() for windows.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Return the deepest child of the window and not the first one as this function
needs to return the window that is at the top of Z-order.
Closes#14591.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use ChildWindowFromPointEx(CWP_SKIPINVISIBLE) to ensure that we find the
disabled children (by not using CWP_SKIPDISABLED).
Add a unit test to check for the correct behaviour in all cases and document
it.
Closes#2942.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Verify that this function (which is used for parsing the wildcard strings used
with file-related dialogs) works as expected and also asserts when given
invalid input.
See #4489.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This change is not needed any longer after r66219 which fixed the real
underlying problem, i.e. that attempting to load an invalid XRC file resulted
in failures when loading all subsequent XRC files.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Leaving invalid XRC entries in wxXmlResource internal list of loaded resources
resulted in failures in the XRC unit test which executed after this one.
It seems that loading an invalid resource shouldn't prevent the other ones
from loading correctly later and this probably should be corrected at
wxXmlResource level but for now work around this problem in the test itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMax, wxMin and wxClip work correctly when called with a mix of signed and
unsigned arguments but give warnings about comparing them when compiled with
g++.
Cast both arguments to the result type, which is defined consistently with
standard C rules for implicit promotion, before comparing them to avoid this.
Also add more tests to check that using these functions in this case doesn't
provoke warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
- wxLog already has a better cppunit test class
- wxLocale test in the console sample didn't work on Windows and wasn't very useful
move some tests from the console sample to CppUnit tests:
- wxPathList => PathListTestCase
- wxModule => ModuleTestCase
remove some tests about removed functions of wxMimeTypesManager
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code in CFSTR_SHELLURLDataObject::GetDataHere() was confused by
ANSI/Unicode and ended up overwriting output buffer because of it. Moreover,
this function was actually completely unnecessary as the base class version
did work correctly.
Closes#11102 (thanks to Tim Kosse).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775