| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Now we support the following new macros:
- CPPUNIT_ASSERT_LESS
- CPPUNIT_ASSERT_GREATER
- CPPUNIT_ASSERT_LESSEQUAL
- CPPUNIT_ASSERT_GREATEREQUAL
|
|
|
|
| |
-Werror -Wall -Wextra now works in make and in make check
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
| |
assertion_traits<double>::toString().
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
non-finite values.
|
| |
|
|
|
|
| |
and CPPUNIT_ASSERT_NO_THROW().
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.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/*/*.dsp: bug #933154, post build fail in directory with spaces.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/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.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.cpp:
* src/examples/CppUnitTest/XmlUniformser.cpp: fixed bug #676505 (no space
between attributes of XmlElement).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.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.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.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.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.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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.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.
|
|
|
|
| |
assertion. Somehow gcc can't parse it. Added missing include <stdexcept>.
|
|
|
|
|
| |
examples/cppunittest/MessageTest.cpp:
* examples/cppunittest/XmlElement.cpp: added missing include <stdexcept>.
|