summaryrefslogtreecommitdiff
path: root/include/cppunit
Commit message (Collapse)AuthorAgeFilesLines
* Don't mis-apply GCC < 4.6 workaround for ClangHEADmasterStephan Bergmann2023-05-091-1/+2
| | | | | | | | | | | | | | ...which happens to define __GNUC__=4, __GNUC_MINOR__=2. (See also <https://git.libreoffice.org/core/+/9a23239b710e44754e4a28643420c9ba91552645%5E%21> "external/cppunit: Don't mis-apply GCC < 4.6 workaround for Clang". This change requires <https://gerrit.libreoffice.org/c/cppunit/+/147383> "Use snprintf instead of sprintf" to avoid deprecation warnings on macOS, which had originally been hidden by the mis-applied #pragma.) Change-Id: I4fcb38a79766238862795ba4019638862e65b041 Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/147384 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
* Use snprintf instead of sprintfStephan Bergmann2023-05-091-1/+1
| | | | | | | | | | | | | | | | | | | See <https://git.libreoffice.org/core/+/bd8a213c8ceccf66ab296ef0aea0fa4c451047e5%5E%21> "external/cppunit: Use snprintf instead of sprintf" for how sprintf would have caused deprecation warnings on macOS. (For MSVC, keep using sprintf_s. According to <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=msvc-170>: "Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no longer identical to _snprintf. The snprintf function behavior is now C99 standard conformant." So for older versions, snprintf would potentially not store a terminating NUL, like _snprintf but unlike sprintf_s.) Change-Id: Ibf8b228cd1dd57428ecf85ed10e0793b78ae90c9 Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/147383 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
* remove a few trailing whitespacesMarkus Mohrhard2021-10-011-21/+21
|
* avoid a few annoying compiler warningsFlorian Becker2021-10-011-4/+4
|
* replace 0 with nullptr when assigning to a pointerFlorian Becker2021-10-014-4/+4
|
* get rid of old casting macrosMarkus Mohrhard2021-10-013-19/+1
|
* remove superfluous semicolonsFlorian Becker2021-10-013-5/+5
|
* switch from throw() to noexceptFlorian Becker2021-10-011-5/+1
|
* add override annotationsFlorian Becker2021-10-0123-68/+68
|
* add missing [[noreturn]] attributesFlorian Becker2021-10-011-20/+20
|
* Replace NULL with nullptrFlorian Becker2021-10-0110-20/+20
|
* fix -Wdefaulted-function-deleted errorMarkus Mohrhard2019-12-211-2/+2
|
* Added some brackets to make it more clear for the compile which things ↵Tobias Groll2019-02-141-1/+1
| | | | belongs to the if body
* custom tostring formatter to CPPUNIT_ASSERT_MESSAGENoel Grandin2019-02-141-6/+40
| | | | | | | | | | Provide an extension trait message_to_string that allows client code to call ASSERT_MESSAGE with their own string types. Also provide a default extension trait that accepts std::ostream messages. Change-Id: I516f97063c34d86bc91c40e0ec147d5393e7b6ea
* Unconditionally use C++11 [[noreturn]]Stephan Bergmann2019-02-131-9/+3
| | | | | | | | | | | | This helps avoid issues like <https://gerrit.libreoffice.org/plugins/gitiles/ core/+/9808486a89c6368f836579f8d8c0dda63fd0063c%5E%21> "Avoid -Werror,-Wimplicit-fallthrough with clang-cl ...where CPPUNIT_FAIL is marked as noreturn only for __GNUC__". Change-Id: Idb33af7375f103f2dd7a7b4c3dbf20ce731b17ad Reviewed-on: https://gerrit.libreoffice.org/67247 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
* extensions: add CPPUNIT_TEST_FIXTURE()Miklos Vajna2018-11-021-0/+23
| | | | | | | | | | This is similar to googletest's TEST_F() macro, allows to avoid spelling out the test name in a suite only once, not 3 times. Change-Id: I90804d271d046d8158678617d8db75ed6ca7c420 Reviewed-on: https://gerrit.libreoffice.org/61732 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
* Avoid GCC 9 -Wdeprecated-copyStephan Bergmann2018-09-261-0/+5
| | | | | | | | | | | | | | | | ...when an implicitly-defined copy function is used that may in a future C++ standard be defined as deleted because of the user-declared destructor. Just declare all the four copy/move functions as defaulted for a consistent interface. (Originally addressed with LibreOffice commit <https://gerrit.libreoffice.org/58042> "external/cppunit: silence -Werror=deprecated-copy (GCC trunk towards GCC 9)".) Change-Id: Ie38ac3a613e6fbc2e4045cb5b14c3f6d167c79c5 Reviewed-on: https://gerrit.libreoffice.org/58690 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
* next version will be 1.15.0Markus Mohrhard2018-05-231-1/+1
|
* C++11 provides std::isfinite and std::isnanMarkus Mohrhard2018-05-231-38/+3
|
* tdf#116653, avoid NOMINMAX redefinition warnings with mingwMarkus Mohrhard2018-04-021-0/+2
|
* Report (un)signed char values numericallyStephan Bergmann2017-07-201-0/+10
| | | | | | | | | | | ...instead of as characters, as those values often represent numerical values (e.g., sal_uInt8 aka unsigned char in LibreOffice), and often even have values outside the printing ASCII range Change-Id: I72727e98f5af616f6b0c03c57fc1119c0c11c1fc Reviewed-on: https://gerrit.libreoffice.org/40138 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
* remove also all references to mfcMarkus Mohrhard2017-04-134-103/+1
|
* remove BeOS special supportMarkus Mohrhard2017-04-131-7/+0
|
* remove the qt test runner that depends on ancient qtMarkus Mohrhard2017-04-135-124/+1
|
* implement parameterized testsMarkus Mohrhard2016-12-163-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows to execute the same test with different parameters and treats each execution as an own test. The change consists of two parts, the TestCaller can now handle any callable which also makes it easy to generate programatically more complex test cases as well as the new CPPUNIT_TEST_PARAMETERIZED macro. That macro takes the test name as well as an iteratable, e.g. std::initializer_list. An example for this usage is: class SimpleTest : public CppUnit::TestFixture { public: CPPUNIT_TEST_SUITE(SimpleTest); CPPUNIT_TEST_PARAMETERIZED(test, {1, 2, 3, 4}); CPPUNIT_TEST_SUITE_END(); void test(int i) { CPPUNIT_ASSERT(i < 5); } }; which will execute test 4 times with the values 1 to 4.
* use std::function for the test method in TestCallerMarkus Mohrhard2016-12-161-5/+15
| | | | This allows us to pass in any callable e.g. results of std::bind.
* extract the code to turn a variable into a stringMarkus Mohrhard2016-12-163-30/+49
|
* error: blank line following trailing backslashDavid Tardon2016-12-161-1/+1
|
* tdf#104498 CPPUNIT_USE_TYPEINFO_NAME is a flagDavid Tardon2016-12-163-4/+4
| | | | ... so check just for existence.
* we no longer need a wrapper for the smart pointer caseMarkus Mohrhard2016-12-152-7/+0
|
* simpler implementation for the enum class work aroundMarkus Mohrhard2016-12-141-18/+14
|
* add support for enum class to the asserterMarkus Mohrhard2016-12-131-13/+32
| | | | | | The asserter now has special handling to convert the enum class to a std::string. This does not work without some template magic as enum class has no implicit conversion to int.
* remove support for old broken C++ compilersMarkus Mohrhard2016-12-1123-215/+36
|
* always use std::unique_ptrMarkus Mohrhard2016-10-151-4/+0
|
* replace with std::unique_ptrMarkus Mohrhard2016-10-151-12/+3
|
* HelperMacros: fix deprecated NULL macro usageGARCIN David2016-10-151-2/+2
| | | | | | | | | | | | | | | | | | | Using gcc (currently using gcc 5.2) flag -Wzero-as-null-pointer-constant triggers warnings: [...]include/cppunit/extensions/HelperMacros.h:171:31: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant] CppUnitExDeleter() : suite (0) {} \ ^ [...]include/cppunit/extensions/HelperMacros.h:174:45: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant] CPPUNIT_NS::TestSuite *tmp = suite; suite = NULL; return tmp; \ ^ Using nullptr is the c++11 way to initialize pointers with null value [1]. [1] http://en.cppreference.com/w/cpp/language/nullptr
* we always require RTTI nowMarkus Mohrhard2016-10-156-68/+2
| | | | | RTTI is supported by any decent compiler and with the mandatory c++11 support we are no longer supporting older compilers anyway.
* fix --disable-optional-features buildMarkus Mohrhard2015-11-081-0/+4
| | | | Use std::auto_ptr in C++03 mode.
* add a flag for adding optional featuresMarkus Mohrhard2015-11-072-1/+8
| | | | | | These features will switch the used C++ version from C++03 to C++11. We are also going to use std::unique_ptr instead of std::auto_ptr for the c++11 mode.
* next version is 1.14.0Markus Mohrhard2015-11-071-1/+1
|
* remove commented out codeMarkus Mohrhard2015-08-181-8/+1
| | | | | The code has been commented out for a long time and is not related to a missing fix.
* add new assertion macros for <, <=, > and >=Markus Mohrhard2014-07-132-3/+314
| | | | | | | | | Now we support the following new macros: - CPPUNIT_ASSERT_LESS - CPPUNIT_ASSERT_GREATER - CPPUNIT_ASSERT_LESSEQUAL - CPPUNIT_ASSERT_GREATEREQUAL
* mark the fails as no-returnCaolán McNamara2014-07-061-3/+10
| | | | | that might help clang scan-build understand that execution won't continue after they fail
* -Werror,-Woverloaded-virtualStephan Bergmann2013-08-161-0/+2
| | | | | | | "'CppUnit::TextTestResult::addFailure' hides overloaded virtual function; ../../include/cppunit/TestResult.h:85:16: note: hidden overloaded virtual function 'CppUnit::TestResult::addFailure' declared here: different number of parameters (2 vs 1)." (Clang)
* Bug # 51154: cppunit warning cleaningTobias Lippert2013-08-155-6/+20
| | | | | | | | | | | | This patch allows to compile the code with gcc's -Weffc++ It consists mostly of making copy constructors and assignment operators explicit and private, and of initializing all members in initializer lists. Change-Id: I6f1cae812c58e3791c2386a1288501cf2f559610 Reviewed-on: https://gerrit.libreoffice.org/5424 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi>
* Merge branch 'master' into feature/buildsystem_rewriteTomas Chvatal2012-08-063-8/+25
|\ | | | | | | | | | | | | | | | | Conflicts: .gitignore autogen.sh configure.in doc/Makefile.am examples/cppunittest/TestAssertTest.cpp
| * calm gcc paranoia about uninitialized stateMichael Meeks2012-06-271-0/+1
| |
| * avoid the need to work around auto_ptr warnings by dropping thatMichael Meeks2012-06-271-4/+13
| |
| * TestDecorator assumes ownership and is not allowed to create copiesMarkus Mohrhard2012-06-161-1/+8
| |
| * correct documentation, sf#2185407Markus Mohrhard2012-06-131-1/+1
| |