summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestAssertTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* add new assertion macros for <, <=, > and >=Markus Mohrhard2014-07-131-0/+45
| | | | | | | | | 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
* - removed wrong comment.Baptiste Lepilleur2007-02-251-1/+1
|
* Src/cppunit/TestAssert.Baptiste Lepilleur2007-02-241-3/+34
| | | | | | | | | | | | | | | | | | | 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-311-1/+20
| | | | assertion_traits<double>::toString().
* Remove declaration of unimplemented functions testAssertDoubleNotEquals1 and ↵Steve M. Robbins2007-01-271-0/+4
| | | | | | | | | | 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.
* Put a C++ statement in the first argument of CPPUNIT_ASSERT_THROW()Steve M. Robbins2007-01-121-4/+8
| | | | and CPPUNIT_ASSERT_NO_THROW().
* 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.
* 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-131-36/+81
| | | | | | | | | | | | | | | 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).
* CodingGuideLines.Baptiste Lepilleur2002-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/TestFactoryRegistry.Baptiste Lepilleur2001-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/extensions/TestFactoryRegistry.h * src/cppunit/TestFactoryRegistry.cpp : fixed memory leaks that occured when a TestFactoryRegistry was registered into another TestFactoryRegistry. * include/cppunit/extensions/AutoRegisterSuite.h : updated doc. * include/cppunit/extensions/HelperMacros.h : added macro CPPUNIT_TEST_SUITE_NAMED_REGISTRATION to register a suite into a named suite. Updated doc. * examples/cppunittest/CoreSuite.h: * examples/cppunittest/ExtensionSuite.h: * examples/cppunittest/HelperSuite.h: added, declaration of suite for use with CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/makefile.am : added HelperSuite.h, CoreSuite.h, ExtensionSuite.h, CppUnitTestSuite.h and CppUnitTestSuite.cpp. * examples/cppunittest/CppUnitTestSuite.*: added. * examples/cppunittest/ExceptionTest.cpp: * examples/cppunittest/TestAssertTest.cpp: * examples/cppunittest/TestCaseTest.cpp: * examples/cppunittest/TestFailureTest.cpp: * examples/cppunittest/TestListenerTest.cpp: * examples/cppunittest/TestResultTest.cpp: * examples/cppunittest/TestSuiteTest.cpp: moved into named suite "Core" using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/OrthodoxTest.cpp: * examples/cppunittest/RepeatedTest.cpp: * examples/cppunittest/TestDecoratorTest.cpp: * examples/cppunittest/TestSetUpTest.cpp: moved into named suite "Extension" using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/HelperMacrosTest.cpp: * examples/cppunittest/TestCallerTest.cpp: moved into named suite "Helper" using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/CppUnitTest.dsp : * examples/msvc6/CppUnitTestApp/CppUnitTestApp.dsp : added Makefile.am, HelperSuite.h, CoreSuite.h, ExtensionSuite.h, CppUnitTestSuite.h and CppUnitTestSuite.cpp.
* NEWS : updated.Baptiste Lepilleur2001-10-021-40/+39
| | | | | | | | | | | | | | | | | | | | | | | | | NEWS : updated. * doc/other_documentation.dox : added all the authors to the list of authors. * examples/cppunittest/HelperMacrosTest.*: added unit tests for CPPUNIT_TEST_FAIL & CPPUNIT_TEST_EXCEPTION. * examples/cppunittest/TestAssertTest.*: added unit tests for CPPUNIT_FAIL. Corrected spelling error. Relaxed constraint on message produced by CPPUNIT_ASSERT_MESSAGE. Refactored some tests. * include/cppunit/extensions/HelperMacros.h : added macro CPPUNIT_TEST_EXCEPTION to create a test case for the specified method that must throw an exception of the specified type. * include/cppunit/extensions/TestSuiteBuilder.h : made makeTestName() public. Added addTestCallerForException() to add a test case expecting an exception of the specified type to be caught. * include/cppunit/TestAssert.h : added macro CPPUNIT_FAIL as a shortcut for CPPUNIT_ASSERT_MESSAGE( message, false ).
* Add tests for CPPUNIT_ASSERT_EQUAL.Steve M. Robbins2001-07-131-0/+11
|
* Examples/cppunittest/TestResultTest.Baptiste Lepilleur2001-06-111-0/+143
examples/cppunittest/TestResultTest.*: renamed TestListenerTest.* * examples/cppunittest/*: added unit tests for: HelperMacros, TestAssert, TestCaller, TestCase, TestFailure, TestResult, TestSuite, TestDecoratorTest, TestSetUp, RepeatedTestTest, Orthodox, Exception.