summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* C++11: Use of nullptr instead of 0.Murray Cumming2015-07-183-7/+7
|
* Remove remaining parts of the sigc::lambda documentationKjell Ahlstedt2015-07-171-1/+0
| | | | | | | | | * docs/index.html: Remove link to group__lambdas.html. * sigc++/adaptors/macros/bind.h.m4: * sigc++/adaptors/macros/compose.h.m4: * sigc++/adaptors/macros/hide.h.m4: Remove talk of sigc::group(). * sigc++/.gitignore: * tests/.gitignore: Remove files that are no longer generated. Bug #672555.
* Remove remaining parts of the sigc::lambda API.Murray Cumming2015-07-171-10/+0
| | | | | | The remaining API, defined in a .cc file, does not actually end up being used by applications, so we can safely remove it. See https://bugzilla.gnome.org/show_bug.cgi?id=672555#c21
* Remove deprecated sigc::lambda API that is only in headers.Murray Cumming2015-07-172-265/+0
| | | | | | | So this is an API removal (of deprecated API) but not an ABI change. The remaining deprecated API in the headers is needed by the definitions in lambda.cc.m4. Bug #672555
* C++11: Avoid the need for SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPEKjell Ahlstedt2015-07-142-33/+5
| | | | | | | | | | | | | | | | | | * sigc++/adaptors/lambda/macros/base.h.m4: * sigc++/adaptors/lambda/macros/group.h.m4: * sigc++/adaptors/macros/track_obj.h.m4: * sigc++/macros/signal.h.m4: Remove all talk about SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE. * sigc++/functors/slot_base.h: Mentioned that SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE is not needed any more. * tests/test_cpp11_lambda.cc: * tests/test_track_obj.cc: Remove calls to SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE and tests for C++11 capability. * sigc++/functors/macros/functor_trait.h.m4: Add class can_deduce_result_type_with_decltype<>. Use it as default value for the new template parameter I_can_use_decltype in struct functor_trait<>. Bug #672555. Murray Cumming made the changes of all files except functor_trait.h.m4.
* Tests: Improve test_disconnect_during_emitKjell Ahlstedt2014-10-231-1/+4
| | | | | * tests/test_disconnect_during_emit.cc: Test that the slot is really disconnected during signal emission.
* test_lambda: Fix for MS Visual C++ 2013Kjell Ahlstedt2014-08-121-11/+11
| | | | | | * tests/test_lambda.cc: Don't rely on implicit conversion from std::ostream to bool. Instead, hide a problematic slot return type with sigc::hide_return(). Bug #734368.
* Tests: Enable C++11 lambda expressions with MS Visual Studio 2012 and laterRyan Beasley2014-07-292-2/+2
| | | | | | * tests/test_cpp11_lambda.cc: * tests/test_track_obj.cc: Compile C++11 lambda expressions if _MSC_VER >= 1700. Bug #733752.
* Tests: Add test_visit_eachKjell Ahlstedt2014-07-273-1/+208
| | | | | | * tests/.gitignore: * tests/Makefile.am: Add test_visit_each. * tests/test_visit_each.cc: New file. Bug #724496.
* Replace visit_each() overloads by struct visitor<>Kjell Ahlstedt2014-07-271-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: This patch breaks API for some users, but it does not break ABI. Only users who have added their own visit_each() overloads are affected by the API break. Their programs will still compile, but there will be run-time errors, if they rely on auto-disconnection of slots. Updated instructions for users who implement their own adaptors are found in the description of sigc::adapts<>. * sigc++/adaptors/bound_argument.h: * sigc++/adaptors/macros/adaptor_trait.h.m4: * sigc++/adaptors/macros/bind.h.m4: * sigc++/adaptors/macros/bind_return.h.m4: * sigc++/adaptors/macros/compose.h.m4: * sigc++/adaptors/macros/exception_catch.h.m4: * sigc++/adaptors/macros/hide.h.m4: * sigc++/adaptors/macros/retype.h.m4: * sigc++/adaptors/macros/retype_return.h.m4: * sigc++/adaptors/macros/track_obj.h.m4: * sigc++/adaptors/lambda/macros/base.h.m4: * sigc++/adaptors/lambda/macros/group.h.m4: * sigc++/adaptors/lambda/macros/operator.h.m4: * sigc++/functors/macros/mem_fun.h.m4: * sigc++/macros/limit_reference.h.m4: * sigc++/visit_each.h: Replace overloads of visit_each<>() by specializations of struct visitor<> with a specialized member function do_visit_each<>(). Qualify all calls to visit_each() with sigc:: to avoid argument-dependent lookup. * sigc++/functors/macros/slot.h.m4: Qualify the calls to visit_each_type() with sigc:: to avoid argument-dependent lookup. * tests/test_functor_trait.cc: Fix the expected result now when the test really works. Thanks to Ryan Beasley <rbeasley@vmware.com>, bug #724496.
* Fix 'make check' with clang++ and --enable-warnings=fatalKjell Ahlstedt2014-07-143-17/+33
| | | | | | | | * tests/test_cpp11_lambda.cc: * tests/test_deduce_result_type.cc: * tests/test_track_obj.cc: Don't define functions which are not used. The clang++ compiler considers unused functions an error, when libsigc++ is configured with --enable-warnings=fatal. Bug #724496.
* Update .gitignore filesKjell Ahlstedt2013-10-271-0/+2
| | | | | * build/.gitignore: * tests/.gitignore: Ignore files generated by automake 1.13 and 'make check'.
* Fix test_cpp11_lambda for gcc 4.8Kjell Ahlstedt2013-10-261-1/+30
| | | | | | * tests/test_cpp11_lambda.cc: Remove an unneccesary std::ref(). Show that std::bind() can be assigned to a slot, if it's combined with std::function.
* Deprecate libsigc++ lambdas, sigc::group(), sigc::var().Kjell Ahlstedt2013-03-191-0/+11
| | | | | | | | | | | | | * configure.ac: Add MM_ARG_DISABLE_DEPRECATED_API(SIGCXX). * sigc++/adaptors/lambda/macros/base.h.m4: * sigc++/adaptors/lambda/macros/group.h.m4: * sigc++/adaptors/lambda/macros/lambda.cc.m4: * sigc++/adaptors/lambda/macros/operator.h.m4: * sigc++/adaptors/lambda/macros/select.h.m4: Deprecate everything. * sigc++/macros/template.macros.m4: Add deprecation macros. * sigc++config.h.in: Add #undef SIGCXX_DISABLE_DEPRECATED. * tests/test_lambda.cc: Skip test if SIGCXX_DISABLE_DEPRECATED is defined. Bug #672555.
* Add track_obj() and test_track_obj.Kjell Ahlstedt2013-02-264-17/+248
| | | | | | | | | | | | | | | * sigc++/.gitignore: Add adaptors/track_obj.h. * sigc++/adaptors/adaptors.h: Add sigc++/adaptors/track_obj.h. * sigc++/adaptors/lambda/macros/group.h.m4: * sigc++/adaptors/macros/adaptor_trait.h.m4: Mention track_obj() in the documentation. * sigc++/adaptors/macros/track_obj.h.m4: New file. * sigc++/filelist.am: Add track_obj.h.m4 and track_obj.h. * tests/.gitignore: * tests/Makefile.am: Add test_track_obj. * tests/test_cpp11_lambda.cc: Use track_obj() to test auto-disconnection. * tests/test_track_obj.cc: New test case. Bug #672555.
* Test cases: Report pass/fail with exit status.Kjell Ahlstedt2012-10-1830-712/+1651
| | | | | | | | * tests/testutilities.[h|cc]: New files. Code common to all test cases. * tests/*.cc: Use class TestUtilities. Don't print anything if the test passes. Return EXIT_FAILURE if the test fails. * tests/Makefile.am: Add testutilities.[h|cc] to all test cases. Bug #684956.
* Fix comma operator in lambda expressions.Andris Pavenis2012-09-202-1/+20
| | | | | | | * sigc++/adaptors/lambda/macros/operator.h.m4: Add lambda_action<> specialization for comma operator (operator,()). * tests/test_cpp11_lambda.cc: * tests/test_lambda.cc: Add a test case for the comma operator. Bug #342911.
* Add SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE.Kjell Ahlstedt2012-09-191-2/+2
| | | | | | | | | * sigc++/adaptors/lambda/macros/base.h.m4: * sigc++/adaptors/lambda/macros/group.h.m4: * sigc++/functors/macros/functor_trait.h.m4: * tests/test_cpp11_lambda.cc: Replace the preprocessor macro SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH(C_keyword) with SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE. Bug #672555.
* Fix 'make check' with gcc 4.7.Kjell Ahlstedt2012-09-071-14/+14
| | | | | | | | | * sigc++/adaptors/lambda/macros/base.h.m4: Define sigc::unwrap_lambda_value() before it's used in sigc::lambda::operator[]() and operator=(). * sigc++/adaptors/lambda/macros/group.h.m4: Fix the C++11 examples in the documentation as in test_cpp11_lambda.cc. * tests/test_cpp11_lambda.cc: Only variables with automatic storage duration shall be captured in C++11 lambda expressions.
* Update .gitignore and tests/.gitignoreKjell Ahlstedt2012-08-281-0/+3
| | | | | * .gitignore: Add *~ (gedit's backup files). * tests/.gitignore: Add missing executable test files.
* Add SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH for C++11 lambda expressions.Kjell Ahlstedt2012-08-282-0/+485
| | | | | | | | | | | | | | * sigc++/functors/macros/functor_trait.h.m4: Add the preprocessor macro SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH(C_keyword), which makes it possible to assign C++11 lambda expressions with any return type to slots. Thanks to Chow Loong Jin, who posted similar code on libsigc-list. * sigc++/adaptors/lambda/macros/base.h.m4: * sigc++/adaptors/lambda/macros/group.h.m4: Add information on C++11 lambda expressions to the documentation of lambda expressions and sigc::group(). * tests/Makefile.am: Add test_cpp11_lambda.cc. * tests/test_cpp11_lambda.cc: New test case, showing that most uses of libsigc++'s lambda expressions can be replaced by standard C++11 lambda expressions. Bug #672555.
* Enable test_lambda in 'make check'.Kjell Ahlstedt2012-03-192-8/+17
| | | | | | * tests/Makefile.am: Enable test_lambda in 'make check'. * tests/test_lambda.cc: Comment out the tests with sigc::ref() in lambda functions' parameter lists. See Bug #669128.
* Missing changes from the previous commit.Murray Cumming2011-07-201-0/+2
|
* Add a test case for the previous commit.Kjell Ahlstedt2011-07-191-0/+470
| | | | | | | * tests/Makefile.am: * tests/test_bind_refptr.cc: A version of this test is also in glibmm. Note that this includes a copy/paste of RefPtr. See Bug #564005#14
* Update .gitignore and tests/.gitignoreDavid King2010-10-121-0/+1
|
* Accumulators: Allow return types that are different to the signal's.Murray Cumming2009-12-292-7/+42
| | | | | | | | | | | | | * sigc++/macros/signal.h.m4: signal_emit*: Correct the slot_iterator_buf_type and slot_reverse_iterator_buf_type typedefs to allow accumulators with return types that are different to the signal's return type. * tests/Makefile.am: Reenable test_accumulated, so we can test the fix. It should be manually disabled if building on AIX (if the AIX problem cannot be fixed properly). * tests/test_accumulated.cc: Add an accumulator with a return type that is different to the signal's return type. In this case it's a vector listing all results. Bug #586436.
* Remove unused parameter names for correctnessDaniel Elstner2009-08-165-22/+32
| | | | | | | | * tests/test_copy_invalid_slot.cc, tests/test_custom.cc, tests/test_deduce_result_type.cc, tests/test_functor_trait.cc, tests/test_limit_reference.cc: Remove the names of unused function parameters from the prototype, in order to get libsigc++ to build with fatal compiler warnings.
* Transition to new mm-common build infrastructureDaniel Elstner2009-08-063-85/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autogen.sh: Replace with a minimal script that simply executes mm-common-prepare, autoreconf and configure. * configure.ac: Get rid of an enormous amount of old cruft. Use macros from the new mm-common module to set up Doxygen for building the documentation. Add option to enable more compiler warnings. * sigc++-2.0-uninstalled.pc.in: New pkg-config data file to allow linking to an uninstalled libsigc++. * sigc++-2.0.pc.in: Modernize. Provide the location of the installed reference documentation and the Doxygen tag file. * sigc++config.h.in: Modernize and update for new build infrastructure. * Makefile.am, */Makefile.am: Modernize and adapt to the new C++ binding build infrastructure in the mm-common module. * sigc++/filelist.am: New Automake include file. Defines lists of C++ and M4 source files. * docs/Makefile.am: Rewrite using doc-reference.am from the mm-common module. * docs/doc-manual.am: New Automake include file for building the libsigc++ Docbook manual. * docs/images/Makefile.am: Remove file. * docs/manual/Makefile.am: ditto, * docs/reference/Makefile.am: ditto. * docs/Makefile_web.am_fragment: Remove for now, to be taken care of later. * docs/reference/Doxyfile.in: Modernize and adapt to new build infrastructure. * docs/reference/beautify_docs.pl: Remove and use the more recent scripts/doc-postprocess.pl instead. * libsigc++-2.0.spec.in: Remove, to be resurrected only if someone complains. * scripts/Makefile.am: Remove file. Distribute the files from the toplevel Makefile.am instead. * scripts/cxx_std.m4: Add missing third argument to AC_DEFINE(). * scripts/doc-install.pl: New file, copied from mm-common. * scripts/doc-postprocess.pl: ditto, * scripts/tagfile-to-devhelp2.xsl: ditto.
* Add ifdefs around uses of reverse_iterator to really fix the build withElaine Xiong2008-02-281-0/+4
| | | | | | | | | | | | 2008-02-28 Elaine Xiong <elaine.xiong@sun.com> * sigc++/macros/signal.h.m4: * tests/test_accum_iter.cc: Add ifdefs around uses of reverse_iterator to really fix the build with recent versions of Sun CC. Bug #302098. svn path=/trunk/; revision=294
* Include the cstdlib and cstring headers to fix the build with the gcc 4.3Ryan Hill2008-01-011-0/+2
| | | | | | | | | | 2008-01-01 Ryan Hill <dirtyepic@gentoo.> * tests/test_copy_invalid_slot.cc: Include the cstdlib and cstring headers to fix the build with the gcc 4.3 pre-release. Bug #454882. svn path=/trunk/; revision=292
* Added some includes to fix the build in some environments, such as whenMurray Cumming2007-12-091-0/+3
| | | | | | | | | | 2007-08-31 Murray Cumming <murrayc@murrayc.com> * tests/test_copy_invalid_slot.cc: Added some includes to fix the build in some environments, such as when using Sun CC. Thanks to Vladimir Marek in bug #469872. svn path=/trunk/; revision=291
* Removed this header.Murray Cumming2007-08-142-107/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-08-14 Murray Cumming <murrayc@murrayc.com> * sigc++/Makefile.am: * sigc++/compatibility.h: Removed this header. * sigc++/bind.h: * sigc++/bind_return.h: * sigc++/connection.h: * sigc++/macros/class_slot.h.m4: * sigc++/macros/hide.h.m4: * sigc++/macros/method_slot.h.m4: * sigc++/macros/object_slot.h.m4: * sigc++/macros/retype.h.m4: * sigc++/macros/signal.h.m4: * sigc++/macros/slot.h.m4: * sigc++/object.h: * sigc++/retype_return.h: Removed deprecated compatibility API, to probably fix the build with some compilers, such as some versions of the Sun Forte C++ CC compiler. This API has been deprecated April 2004, and is not widely used, so it seems safe to do this now. * tests/Makefile.am: * tests/test_compatibility.cc: Removed this test. svn path=/trunk/; revision=285
* slot_iterator_buf, slot_reverse_iterator_buf: Added typedefs forMichael Elkstrand2007-07-282-1/+46
| | | | | | | | | | | | | | | 2007-07-28 Michael Elkstrand <michael@elehack.net> * sigc++/macros/signal.h.m4: slot_iterator_buf, slot_reverse_iterator_buf: Added typedefs for value_type, reference, and pointer, so that these iterators are more like standard C++ iterators, so they can be used with standard C++ algorithms. * tests/Makefile.am: * tests/test_accum_iter.cc: Added a test for this. Bug #417926. svn path=/trunk/; revision=284
* Added test case from bug #311057.Murray Cumming2005-12-012-0/+39
| | | | | | | | 2005-12-01 Murray Cumming <murrayc@murrayc.com> * tests/Makefile.am: * tests/test_slot_disconnect.cc: Added test case from bug #311057.
* Specify int return type for main(), to be more ISO C++ compliant. BugMarek Rouchal2005-06-131-1/+3
| | | | | | | 2005-06-13 Marek Rouchal <marek.rouchal@infineon.com> * tests/test_deduce_result_type.cc: Specify int return type for main(), to be more ISO C++ compliant. Bug #307478.
* Specify the actual class when using test_int(), instead of the derivedMurray Cumming2005-06-071-1/+1
| | | | | | | | | 2005-06-07 Murray Cumming <murrayc@murrayc.com> * tests/test_compatibility.cc: Specify the actual class when using test_int(), instead of the derived class, to fix the build on SUN Forte CC 5.5. Patch from Friedemann Kleint in Bug #305647
* New class that just stores a reference, and makes sure that if theRégis Duchesne2005-05-107-119/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-05-06 Régis Duchesne <hpreg@vmware.com> * sigc++/macros/limit_reference.h.m4 (added): * sigc++/Makefile.am: New class that just stores a reference, and makes sure that if the reference derives from trackable, then the trackable reference will be used instead of the derived reference in visit_each(). * sigc++/functors/macros/mem_fun.h.m4: Better fix for bug #169225 by Régis Duchesne and Christian Hammond, based on the new limit_reference class. * sigc++/adaptors/bound_argument.h (added): New class (built upon the new limit_reference class) that handles all 3 kinds of bound arguments: by value, by reference, and by constant reference. References are unwrapped in the bound_argument's constructor. * sigc++/adaptors/macros/bind.h.m4: Fix for bug #302327 by Régis Duchesne. Bound arguments now need to know whether they are passed by reference or not. So bind() now builds bind_functor instances using 'reference_wrapper<Foo>' types, instead of 'Foo &' types. The bind_functor code is modified to compensate. * sigc++/adaptors/macros/bind_return.h.m4: Similar fix for a similar bug (unfiled) with bound return arguments. * sigc++/reference_wrapper.h: * sigc++/type_traits.h: The reference_wrapper class is only used in bound_argument.h. Put correct but unused code under #if 0. * sigc++/adaptors/lambda/base.h: This file needs reference_wrapper.h, but was incorrectly relying on type_traits.h to include it. * tests/Makefile.am: * tests/test_virtualbase_delete.cc (deleted): * tests/test_virtualbase_delete_ref_param.cc (deleted): * tests/test_limit_reference.cc (added): Replaced test_virtualbase_delete*.cc with a simpler test_limit_reference.cc which checks for all 3 aspects of the same bug in one file. * tests/test_bind_ref.cc: Slots must use 'Foo &' types. We were lucky this broken usage worked before this change. The change in type_traits.h made this bug obvious, by preventing the code to compile. * tests/test_bind_return.cc: After my change, bind() and bind_return() must use 'reference_wrapper<Foo>' types. * tests/test_custom.cc: Made this test a no-op (so it does not perturb 'make check' on released versions of the library) and made it a template ready to be modified by hackers.
* Added missing fileMurray Cumming2005-05-041-0/+41
|
* Added test caseMurray Cumming2005-05-012-9/+14
|
* slot_base::slot_base(src): If the source slot_base has a null rep->call_,Murray Cumming2005-05-011-0/+5
| | | | | | | | | | | | 2005-05-01 Murray Cumming <murrayc@murrayc.com> * sigc++/functors/slot_base.cc: slot_base::slot_base(src): If the source slot_base has a null rep->call_, meaning that the slot is invalid, just return a default-constructed slot, to prevent the crash shown in tests/tests_copy_invalid_slot.cc. Bug #302515 by Régis Duchesne.
* Added testMurray Cumming2005-05-012-0/+30
|
* Added simplified test case from bug #169225. We have a patch to make thisMurray Cumming2005-04-283-73/+58
| | | | | | | | | | 2005-04-28 Murray Cumming <murrayc@murrayc.com> * tests/Makefile.am: * tests/test_virtualbase_delete.cc: Added simplified test case from bug #169225. We have a patch to make this succeed but I am not ready to commit it just yet.
* Added a place to put extra test code, so I don't have to keep installingMurray Cumming2005-04-272-2/+96
| | | | | | | | | 2005-04-27 Murray Cumming <murrayc@murrayc.com> * tests/Makefile.am: * tests/test_custom.cc: Added a place to put extra test code, so I don't have to keep installing my crazy libsigc++ versions.
* Revert back to the non-explicit template call, because we can not specifyMurray Cumming2005-04-272-0/+52
| | | | | | | | | | | | 2005-04-27 Murray Cumming <murrayc@murrayc.com> * sigc++/visit_each.h: Revert back to the non-explicit template call, because we can not specify the template specialization so easily, because the specializations have different numbers of types. * tests/Makefile/am: * tests/test_bind_ref.cc: Add a simple test only for sigc::ref disconnection.
* Use the explicit template specialization, needed for Tru64 and AIXMurray Cumming2005-04-261-2/+6
| | | | | | | | | | | | | 2005-04-26 Murray Cumming <murrayc@murrayc.com> * sigc++/visit_each.h: Use the explicit template specialization, needed for Tru64 and AIX compilers. This causes a crash in some uses of sigc::ref() (when using g++ 3.3.4 or 3.3.5 , but not with 3.4) but seems to fix a crash in some uses of multiple inheritance (bug #169225). * tests/test_bind.cc: Comment out the crashing (not with g++ 3.4) use of sigc::ref() with an explanatory comment.
* #included <new> to avoid an unresolved symbol error with the Tru64Murray Cumming2005-02-202-0/+10
| | | | | | | | 2005-02-20 Murray Cumming <murrayc@murrayc.com> * tests/test_slot.cc, test_disconnect.cc: #included <new> to avoid an unresolved symbol error with the Tru64 compiler. Solutio found by Tim Mooney in bug #161503.
* Reenabled testsMurray Cumming2005-02-021-7/+4
|
* [murrayc@localhost libsigc++2]$ more ChangeLogMurray Cumming2005-02-011-12/+6
| | | | | | | | 2005-02-01 Murray Cumming <murrayc@murrayc.com> * sigc++/visit_each.h: visit_each_type(): Specify the specific template specialization of visit_each<>() to use. The AIX compiler, and possibly the Tru64 compiler, need this extra hint.
* Updated NEWSMurray Cumming2005-01-251-3/+5
|
* Disabled the test_accumulator, test_bind, and test_compose tests, and partMurray Cumming2005-01-214-28/+46
| | | | | | | | | 2005-01-21 Murray Cumming <murrayc@murrayc.com> * tests/: Disabled the test_accumulator, test_bind, and test_compose tests, and part of test_mem_fun because the AIX xlC compiler can not build them, but it can still do most things, including the examples. See the comments in tests/Makefile.am.