summaryrefslogtreecommitdiff
path: root/examples/cppunittest
Commit message (Collapse)AuthorAgeFilesLines
* get rid of old casting macrosMarkus Mohrhard2021-10-012-2/+2
|
* Replace NULL with nullptrFlorian Becker2021-10-013-10/+10
|
* drop project files for old versions of MSVCDavid Tardon2019-12-224-1002/+1
| | | | | | | Change-Id: I36ceddb5a8a1f8e96b36a2e851338366cda1808d Reviewed-on: https://gerrit.libreoffice.org/85662 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
* Fix build with gcc9.1Martin Liška2019-04-301-0/+6
| | | | | | | Change-Id: I8a0d7a0b51b5c537dbcfa8fdd34e816605b1f32e Reviewed-on: https://gerrit.libreoffice.org/71573 Reviewed-by: Tomáš Chvátal <tchvatal@suse.cz> Tested-by: Tomáš Chvátal <tchvatal@suse.cz>
* custom tostring formatter to CPPUNIT_ASSERT_MESSAGENoel Grandin2019-02-142-0/+32
| | | | | | | | | | 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
* implement parameterized testsMarkus Mohrhard2016-12-162-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* AM_CPPFLAGS is preferred by "newer" versions of automakeDavid Tardon2016-12-161-1/+1
|
* we no longer need a wrapper for the smart pointer caseMarkus Mohrhard2016-12-152-11/+12
|
* add support for enum class to the asserterMarkus Mohrhard2016-12-131-0/+8
| | | | | | 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-111-2/+2
|
* add a flag for adding optional featuresMarkus Mohrhard2015-11-072-11/+11
| | | | | | 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.
* add new assertion macros for <, <=, > and >=Markus Mohrhard2014-07-132-0/+53
| | | | | | | | | Now we support the following new macros: - CPPUNIT_ASSERT_LESS - CPPUNIT_ASSERT_GREATER - CPPUNIT_ASSERT_LESSEQUAL - CPPUNIT_ASSERT_GREATEREQUAL
* a bit warning cleaning in the testsMarkus Mohrhard2012-06-161-0/+4
| | | | -Werror -Wall -Wextra now works in make and in make check
* Applied patch #2807259: lib -ldl... should be in LDADD instead of LDFLAGSBaptiste Lepilleur2009-11-231-5/+2
|
* Added updated project and instructions for building under Visual Studio.Net 2008Andy Dent2008-12-162-0/+2946
|
* Changes to suppress warnings of gcc -Wall -W -ansi, mainly from patch [1898225].Steve M. Robbins2008-02-214-15/+15
|
* - removed wrong comment.Baptiste Lepilleur2007-02-251-1/+1
|
* Src/cppunit/TestAssert.Baptiste Lepilleur2007-02-242-3/+42
| | | | | | | | | | | | | | | | | | | src/cppunit/TestAssert.cpp (assertDoubleEquals): Moved finite & NaN tests to include/cppunit/portability/FloatingPoint.h. Changed implementation assertDoubleEquals to explicitly test for NaN in case of non-finite values to force equality failure in the presence of NaN. Previous implementation failed on Microsoft Visual Studio 6 (on this platform: NaN == NaN). * examples/cppunittest/TestAssertTest.cpp: Add more unit tests to test the portable floating-point primitive. Added missing include <limits>. * include/cppunit/portability/Makefile.am: * include/cppunit/portability/FloatingPoint.h: Added file. Extracted isfinite() from TestAssert.cpp. * include/cppunit/config-evc4: * include/cppunit/config-msvc6: Added support for _finite().
* Add tests of the precision generated bySteve M. Robbins2007-01-315-1/+86
| | | | assertion_traits<double>::toString().
* Remove declaration of unimplemented functions testAssertDoubleNotEquals1 and ↵Steve M. Robbins2007-01-272-2/+6
| | | | | | | | | | testAssertDoubleNotEquals2. * examples/cppunittest/TestAssertTest.cpp: * examples/cppunittest/TestAssertTest.h: Remove declaration of unimplemented functions testAssertDoubleNotEquals1 and testAssertDoubleNotEquals2. Factor new method testAssertDoubleNonFinite out of existing testAssertDoubleEquals.
* Add unit tests for CPPUNIT_ASSERT_DOUBLES_EQUAL() that test withSteve M. Robbins2007-01-271-0/+11
| | | | non-finite values.
* Arrange class initializers in correct order.Steve M. Robbins2007-01-124-10/+10
|
* Put a C++ statement in the first argument of CPPUNIT_ASSERT_THROW()Steve M. Robbins2007-01-121-4/+8
| | | | and CPPUNIT_ASSERT_NO_THROW().
* removed most warning when compiling with vc++ 6sp6.Baptiste Lepilleur2005-10-132-9/+12
|
* removed most warning when compiling with vc++ 6sp6.Baptiste Lepilleur2005-10-137-0/+7
|
* Include/cppunit/TestAssert.Baptiste Lepilleur2004-11-051-2/+2
| | | | | | | include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: integrated Neil Ferguson patch for missing _MESSAGE assertion variants. Also enhanced the failure message of a few assertions.
* Include/cppunit/Portability.Baptiste Lepilleur2004-06-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/Portability.h: moved OStringStream alias definition to Portability/Stream.h. User need to define EVC4 to indicate that config-evc4.h should be used. (how to we detect this automatically ?). Notes that this means it might be needed to add #include <string> to some headers since its no longer included by Portability.h. * include/cppunit/Portability/Stream.h: define alias OStringStream, stdCOut(), and OFileStream. If CPPUNIT_NO_STREAM is defined (evc4 config), then provides our own implementation (based on sprintf and fwrite). * include/cppunit/config/config-evc4.h: config file for embedded visual c++ 4. Still need to detect for this platform in Portability.h (currently relying on EVC4 being defined...) * *.[cpp/h]: most source files have been impacted with the following change: #include <iostream> -> #include <cppunit/Portability/Stream.h> std::ostream -> CPPUNIT_NS::OStream std::ofstream -> CPPUNIT_NS::OFileStream std::cout -> CPPUNIT_NS::stdCOut() std::endl -> "\n" Also, code using std::cin as been defined out if CPPUNIT_NO_STREAM was defined. The exact list of impact files can be obtain in CVS using tags: TG_CPPUNIT_NO_STREAM_BEFORE & TG_CPPUNIT_NO_STREAM_AFTER.
* Src/Baptiste Lepilleur2004-06-181-5/+5
| | | | src/*/*.dsp: bug #933154, post build fail in directory with spaces.
* fixing project compilation settings (rtti not always enabled)Baptiste Lepilleur2004-06-162-3/+3
|
* removed usage of std::exception ctor with a string (gcc 2.95 issue)Baptiste Lepilleur2004-03-131-6/+6
|
* Examples/cppunittest/TestAssertTest.Baptiste Lepilleur2004-03-134-56/+101
| | | | | | | | | | | | | | | examples/cppunittest/TestAssertTest.h: * examples/cppunittest/TestAssertTest.cpp: * examples/cppunittest/XmlUniformiserTest.h: * examples/cppunittest/XmlUniformiserTest.cpp: * include/cppunit/TestAssert.h: add the exception assertion macros from cppunit 2: CPPUNIT_ASSERT_THROW, CPPUNIT_ASSERT_NO_THROW, CPPUNIT_ASSERT_ASSERTION_FAIL, CPPUNIT_ASSERT_ASSERTION_PASS. Updated unit test to use and test the new macros. * include/cppunit/extensions/HelperMacros.h: deprecated the test case factory that check for exception (CPPUNIT_TEST_FAIL & CPPUNIT_TEST_EXCEPTION).
* added new linesBaptiste Lepilleur2003-05-072-2/+2
|
* Makefile.Baptiste Lepilleur2003-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | Makefile.am * configure.in * config/ac_dll.m4 * examples/cppunittest/Makefile.am * examples/hierarchy/Makefile.am * examples/money/Makefile.am * examples/simple/Makefile.am * include/cppunit/config/SelectDllLoader.h * include/cppunit/plugin/TestPlugIn.h * include/cppunit/tools/Algorithm.h * src/DllPlugInTester/Makefile.am * src/cppunit/Makefile.am * src/cppunit/TestDecorator.cpp * src/cppunit/ShlDynamicLibraryManager.cpp * src/cppunit/UnixDynamicLibraryManager.cpp * src/cppunit/Win32DynamicLibraryManager.cpp: applied patch from Abdessattar Sassi <abdesassi@users.sourceforge.net> to add support for plug-in to hp-ux.
* include/cppunit/extensions/TestSuiteBuilder.h: removed (unused)Baptiste Lepilleur2003-04-062-6/+6
|
* added missing project fileBaptiste Lepilleur2003-03-151-1/+1
|
* added missing project fileBaptiste Lepilleur2003-03-151-1/+1
|
* Include/cppunit/tools/Algorithm.Baptiste Lepilleur2003-03-153-3/+3
| | | | | | | | | | | | | | | | include/cppunit/tools/Algorithm.h: * examples/cppunittest/XmlOutputterTest.cpp: * examples/cppunittest/XmlUniformiser.*: * src/cppunit/CompilerOutputter.cpp: * src/cppunit/ProtectorChain.cpp: * src/cppunit/StringTools.cpp: * src/cppunit/TestPath.cpp: * src/cppunit/TypeInfoHelper.cpp: * src/cppunit/XmlElement.cpp: * src/cppunit/XmlOutputter.cpp: * src/DllPlugInTester/CommandLineParser.h: * src/msvc6/testrunner/TestRunnerDlg.cpp: switched to using unsigned index in loop to avoid signed/unsigned warning in vc7.
* Src/examples/cppunittest/TrackedTestCase.Baptiste Lepilleur2003-03-112-2/+2
| | | | | | | src/examples/cppunittest/TrackedTestCase.cpp: * src/examples/cppunittest/CppUnitTestMain.cpp: * src/examples/money/Money.h: partially applied patch #699794. Fixed compilation issues with Borland C++ 6.
* Src/cppunit/XmlElement.Baptiste Lepilleur2003-03-111-1/+4
| | | | | | src/cppunit/XmlElement.cpp: * src/examples/CppUnitTest/XmlUniformser.cpp: fixed bug #676505 (no space between attributes of XmlElement).
* Include/cppunit/plugin/DynamicLibraryManagerException.Baptiste Lepilleur2002-12-027-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/plugin/DynamicLibraryManagerException.h: added constructor to fix compilation issues on recents version of gcc and sun CC (bug #619059) * include/cppunit/input/XmlInputHelper.h: added. * include/cppunit/extensions/TestSuiteBuilderContext.h: * src/cppunit/TestSuiteBuilderContext.cpp: added addProperty() and getStringProperty(). Added macros CPPUNIT_TEST_SUITE_PROPERTY. * src/msvc6/testrunner/TestRunnerDlg.cpp: integrated Tim Threlkeld's bug fix #610162: browse button was disabled if history was empty. * src/msvc6/testrunner/DynamicWindow/cdxCSizeIconCtrl.cpp: integrated Tim Threlkeld's bug fix #610191: common control were not initialized. * include/cppunit/extensions/ExceptionTestCaseDecorator.h: bug #603172, missing Message construction. * src/cppunit/DefaultProtector.cpp: bug #603172. Fixed missing ';'. * src/cppunit/TestCase.cpp: bug #603671. Removed unguarded typeinfo include. * examples/cppunittests/*Suite.h: bug #603666. Added missing Portability.h include.
* Include/cppunit/Portability.Baptiste Lepilleur2002-08-282-40/+10
| | | | | | | | | | | | | | | | | | | | | include/cppunit/Portability.h: added CPPUNIT_STATIC_CAST. * include/cppunit/extensions/TestFixtureFactory.h: extracted from HelperMacros.h. Added template class ConcretTestFixtureFactory. * include/cppunit/extensions/TestSuiteBuilderContext.h: * src/cppunit/TestSuiteBuilderContext.cpp: added. Context used to add test case to the fixture suite. Prevent future compatibility break for custom test API. * include/cppunit/extensions/HelperMacros.h: mostly rewritten. No longer use TestSuiteBuilder. Added support for abstract test fixture through macro CPPUNIT_TEST_SUITE_END_ABSTRACT. Made custom test API easier to use. * examples/cppunittest/HelperMacrosTest.h: * examples/cppunittest/HelperMacrosTest.cpp: updated against HelperMacros.h changes.
* CodingGuideLines.Baptiste Lepilleur2002-08-277-1/+333
| | | | | | | | | | | | | | | | | | | | | | | | | CodingGuideLines.txt: updated for OS/390 C++ limitation. * examples/cppunittests/MockFunctor.h: added. Mock Functor to help testing. * examples/cppunittests/MockProtector.h: qdded. Mock Protector to help testing. * examples/cppunittests/TestResultTest.h * examples/cppunittests/TestResultTest.cpp: added tests for pushProtector(), popProtector() and protect(). * include/cppunit/TestAssert.h: removed default message value from assertEquals(). Caused compilation error on OS/390. * include/cppunit/plugin/PlugInParameters.h: * src/cppunit/PlugInParameters.cpp: renamed commandLine() to getCommandLine(). * src/msvc6/testrunner/TestRunnerDlg.h: * src/msvc6/testrunner/TestRunnerDlg.cpp: bug fix, disabled Browse button while running tests.
* Include/cppunit/Exception.Baptiste Lepilleur2002-08-0310-11/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/Exception.h: * src/cppunit/Exception.h: added setMessage(). * include/cppunit/Protector.h: * src/cppunit/Protector.cpp: added class ProtectorGuard. Change the reportXXX() method to support Exception passing and SourceLine. * include/cppunit/TestCaller.h: removed 'expect exception' features. It is now handled by ExceptionTestCaseDecorator and TestCaller no longer need default template argument support. * include/cppunit/TestCase.h: * include/cppunit/extensions/TestCaller.h: runTest() is now public instead of protected, so that it can be decorated. * include/cppunit/TestResult.h: * src/cppunit/TestResult.h: added pushProtector() and popProtector() methods. This allow user to specify their own exception trap when running test case. * include/cppunit/extensions/TestDecorator.h: * src/cppunit/TestDecorator.cpp: added. Extracted from TestDecorator.h. The test passed to the constructor is now owned by the decorator. * include/cppunit/extensions/TestCaseDecorator.h: * src/cppunit/TestCaseDecorator.cpp: added. Decorator for TestCase setUp(), tearDown() and runTest(). * include/cppunit/extensions/ExceptionTestCaseDecorator.h: added. TestCaseDecorator to expect that a specific exception is thrown. * include/cppunit/extensions/HelperMacros.h: updated against TestCaller change. * src/cppunit/DefaultFunctor.h: fixed bug (did not return underlying test return code). * src/cppunit/ProtectorChain.cpp: fixed bug in chaing return code. * src/cppunit/DefaultFunctor.h: fixed bug. * src/msvc6/testrunner/ActiveTest.h: * src/msvc6/testrunner/ActiveTest.cpp: updated against TestCaseDecorator ownership policy change. Moved inline functions to .cpp. * examples/cppunittest/TestSetUpTest.cpp: updated to use MockTestCase and against the new ownership policy. * examples/cppunittest/TestDecoratorTest.cpp: * examples/cppunittest/RepeatedTestTest.cpp: updated against TestDecorator ownership policy change. * examples/cppunittest/ExceptionTestCaseDecoratorTest.h: * examples/cppunittest/ExceptionTestCaseDecoratorTest.cpp: added. Unit tests for ExceptionTestCaseDecoratorTest.
* CodingGuideLines.Baptiste Lepilleur2002-07-1433-96/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CodingGuideLines.txt: added. CppUnit's coding guidelines for portability. * include/cppunit/portability/CppUnitStack.h: added. wrapper for std::stack. * include/cppunit/portability/CppUnitSet.h: added. wrapper for std::set. * include/cppunit/ui/text/TestRunner.h: fixed namespace definition for deprecated TestRunner. * include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: removed old deprecated functions that did not use SourceLine. Moved assertEquals() and assertDoubleEquals() into CppUnit namespace. * src/cppunit/TestFactoryRegistry.cpp: use CppUnitMap instead of std::map. * src/DllPlugInTester/CommandLineParser.h: use CppUnitDeque instead std::deque. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: removed all usage of CppUnitTest namespace. Everything is now in global space. * examples/*/*.h: * examples/*/*.cpp: replaced usage of CppUnit:: with CPPUNIT_NS::. * examples/ClockerPlugIn/ClockerModel.h: use CppUnit STL wrapper instead of STL container.
* Include/cppunit/ui/text/TestRunner.Baptiste Lepilleur2002-07-1344-397/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/ui/text/TestRunner.h: * src/cppunit/TextTestRunner.cpp: Renamed TextUi::TestRunner TextTestRunner and moved it to the CppUnit namespace. Added a deprecated typedef for compatibility with previous version. * include/cppunit/ui/text/TextTestRunner.h: added. * include/cppunit/ui/mfc/TestRunner.h: * src/cppunit/msvc6/testrunner/TestRunner.cpp: Renamed MfcUi::TestRunner MfcTestRunner. Added deprecated typedef for compatibility. Renamed TestRunner.cpp to MfcTestRunner.cpp. * include/cppunit/ui/mfc/MfcTestRunner.h: added. * include/cppunit/ui/qt/TestRunner.h: * src/qttestrunner/TestRunner.cpp: renamed QtUi::TestRunner QtTestRunner and moved it to CppUnit namespace. Added a deprecated typedef for compatibility. Renamed TestRunner.cpp to QtTestRunner.cpp. * include/cppunit/ui/qt/TestRunner.h: * src/qttestrunner/TestRunner.h: Moved TestRunner to CppUnit namespace and renamed it QtTestRunner. Added deprecated typedef for compatibility. * include/cppunit/Asserter.h: * src/cppunit/Asserter.cpp: changed namespace Asserter to a struct and made all methods static. * include/cppunit/extensions/HelperMacros.h: * include/cppunit/extensions/SourceLine.h: * include/cppunit/extensions/TestAssert.h: * include/cppunit/extensions/TestPlugIn.h: * include/cppunit/Portability.h: changed CPPUNIT_NS(symbol) to a symbol macro that expand either to CppUnit or nothing. The symbol is no longer a parameter. * include/cppunit/portability/CppUnitVector.h: * include/cppunit/portability/CppUnitDeque.h: * include/cppunit/portability/CppUnitMap.h: added. STL Wrapper for compilers that do not support template default argumenent and need the allocator to be passed when instantiating STL container. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: * src/msvc6/testrunner/*.h: * src/msvc6/testrunner/*.cpp: * src/msvc6/testpluginrunner/*.h: * src/msvc6/testpluginrunner/*.cpp: * src/qttestrunner/*.h: * src/qttestrunner/*.cpp: replaced occurence of CppUnit:: by CPPUNIT_NS. * src/cppunit/TestSuite.h: replaced occurence of std::vector by CppUnitVector.
* added missing filesBaptiste Lepilleur2002-07-111-1/+1
|
* Include/cppunit/extensions/AutoRegisterSuite.Baptiste Lepilleur2002-07-102-2/+3
| | | | | | | | | | | | | | | | | | | | | | | include/cppunit/extensions/AutoRegisterSuite.h: * include/cppunit/extensions/Orthodox.h: * include/cppunit/extensions/TestSuiteBuilder.h: * include/cppunit/extensions/TestSuiteFactory.h: * include/cppunit/TestCaller.h: * examples/hierarchy/BoardGameTest.h: * examples/hierarchy/ChessTest.h: replaced usage of 'typename' in template declaration with 'class'. * include/cppunit/ui/text/TestRunner.h: * src/cppunit/TextTestRunner.cpp: updated to use the generic TestRunner. Removed methods runTestByName() and runTest(). Inherits CppUnit::TestRunner. * include/cppunit/extensions/TestSuiteBuilder.h: removed templatized method addTestCallerForException(). It is no longer used since release 1.9.8. * examples/cppunittest/MockTestCase.h * examples/cppunittest/MockTestCase.cpp: removed the usage of 'mutable' keyword.
* Include/cppunit/XmlOutputter.Baptiste Lepilleur2002-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/XmlOutputter.h: fixed XmlOutputter constructed default value initializatino which caused compilation error with BC5. * src/cppunit/PlugInManager.cpp: added missing CPPUNIT_NO_TESTPLUGIN guard. * src/msvc6/testrunner/TestRunner.dsp: * src/msvc6/testrunner/TestRunner.rc: * src/msvc6/testrunner/TestRunnerDlg.cpp: * src/msvc6/testrunner/TestRunnerDlg.h: * src/msvc6/testrunner/TreeHierarchyDlg.cpp: * src/msvc6/testrunner/TreeHierarchyDlg.h: * src/msvc6/testpluginrunner/TestPlugInRunner.dsp: * src/msvc6/testpluginrunner/TestPlugInRunner.rc: * src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp: * src/msvc6/testpluginrunner/TestPlugInRunnerDlg.cpp: * src/msvc6/testpluginrunner/TestPlugInRunnerDlg.h: applied Steven Mitter patch to fix bug #530426 (conflict between TestRunner and host application resources). Adapted patch to compile work with Unicode. * src/msvc6/testrunner/ResourceLoaders.h: * src/msvc6/testrunner/ResourceLoaders.cpp: * src/msvc6/testrunner/Change-Diary-ResourceBugFix.txt: added, from Steven Mitter's patch. Simplified loadCString() to compile with Unicode. * src/cppunit/cppunit.dsp: * src/cppunit/cppunit_dll.dsp: * src/DllPlugInTester/DllPlugInTester.dsp: * src/msvc6/testrunner/TestRunner.dsp: * src/msvc6/testpluginrunner/TestPlugInRunner.dsp: all lib, dll and exe are now created in the intermediate directory. A post-build rule is used to copy them to the lib/ directory.
* examples/cppunittest/MessageTest.cpp: removed std::string() fromBaptiste Lepilleur2002-06-161-2/+4
| | | | assertion. Somehow gcc can't parse it. Added missing include <stdexcept>.
* Examples/cppunittest/MessageTest.Baptiste Lepilleur2002-06-162-0/+2
| | | | | examples/cppunittest/MessageTest.cpp: * examples/cppunittest/XmlElement.cpp: added missing include <stdexcept>.