<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cppunit.git/include/cppunit/extensions/HelperMacros.h, branch cppunit-1.15.0</title>
<subtitle>anongit.freedesktop.org: git/libreoffice/cppunit.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/'/>
<entry>
<title>extensions: add CPPUNIT_TEST_FIXTURE()</title>
<updated>2018-11-02T05:03:13+00:00</updated>
<author>
<name>Miklos Vajna</name>
<email>vmiklos@collabora.co.uk</email>
</author>
<published>2018-10-12T19:34:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=48145587c4c2dc4f1e07d83073e136336c81ce79'/>
<id>48145587c4c2dc4f1e07d83073e136336c81ce79</id>
<content type='text'>
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 &lt;markus.mohrhard@googlemail.com&gt;
Tested-by: Markus Mohrhard &lt;markus.mohrhard@googlemail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;markus.mohrhard@googlemail.com&gt;
Tested-by: Markus Mohrhard &lt;markus.mohrhard@googlemail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>implement parameterized tests</title>
<updated>2016-12-16T13:05:07+00:00</updated>
<author>
<name>Markus Mohrhard</name>
<email>markus.mohrhard@googlemail.com</email>
</author>
<published>2016-12-16T12:53:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=4e529c6a6569d1f352e02af16e53aba7ae7bdc1a'/>
<id>4e529c6a6569d1f352e02af16e53aba7ae7bdc1a</id>
<content type='text'>
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 &lt; 5);
    }
};

which will execute test 4 times with the values 1 to 4.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt; 5);
    }
};

which will execute test 4 times with the values 1 to 4.
</pre>
</div>
</content>
</entry>
<entry>
<title>replace with std::unique_ptr</title>
<updated>2016-10-15T15:31:58+00:00</updated>
<author>
<name>Markus Mohrhard</name>
<email>markus.mohrhard@googlemail.com</email>
</author>
<published>2016-10-15T15:09:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=c314941600c5bd601831e6204b04b06a223064e7'/>
<id>c314941600c5bd601831e6204b04b06a223064e7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>HelperMacros: fix deprecated NULL macro usage</title>
<updated>2016-10-15T15:31:48+00:00</updated>
<author>
<name>GARCIN David</name>
<email>david.garcin@openwide.fr</email>
</author>
<published>2016-10-15T15:01:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=29ae31614fb70e192f63fdab1c65105493319edc'/>
<id>29ae31614fb70e192f63fdab1c65105493319edc</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>calm gcc paranoia about uninitialized state</title>
<updated>2012-06-27T12:15:22+00:00</updated>
<author>
<name>Michael Meeks</name>
<email>michael.meeks@suse.com</email>
</author>
<published>2012-06-27T12:15:22+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=4a433cde9871b77858b059c318488f7a1a6f3e50'/>
<id>4a433cde9871b77858b059c318488f7a1a6f3e50</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>avoid the need to work around auto_ptr warnings by dropping that</title>
<updated>2012-06-27T12:00:15+00:00</updated>
<author>
<name>Michael Meeks</name>
<email>michael.meeks@suse.com</email>
</author>
<published>2012-06-27T12:00:15+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=943e73cc0401df0fac2636e3676218c8e1219a05'/>
<id>943e73cc0401df0fac2636e3676218c8e1219a05</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>correct documentation, sf#2186611</title>
<updated>2012-06-13T07:52:00+00:00</updated>
<author>
<name>Markus Mohrhard</name>
<email>markus.mohrhard@googlemail.com</email>
</author>
<published>2012-06-13T07:52:00+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=7e306f41b0b1930e3cb20c533ccd665a71e73c7e'/>
<id>7e306f41b0b1930e3cb20c533ccd665a71e73c7e</id>
<content type='text'>
std::vector::at() throws std::out_of_range and not std::invalid_argument
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
std::vector::at() throws std::out_of_range and not std::invalid_argument
</pre>
</div>
</content>
</entry>
<entry>
<title>Examples/cppunittest/TestAssertTest.</title>
<updated>2004-03-13T11:52:57+00:00</updated>
<author>
<name>Baptiste Lepilleur</name>
<email>gaiacrtn@free.fr</email>
</author>
<published>2004-03-13T11:52:57+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=224cf85f2b7fd7ec47cda4788902996349f8c754'/>
<id>224cf85f2b7fd7ec47cda4788902996349f8c754</id>
<content type='text'>
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 &amp;
CPPUNIT_TEST_EXCEPTION).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &amp;
CPPUNIT_TEST_EXCEPTION).
</pre>
</div>
</content>
</entry>
<entry>
<title>Include/cppunit/plugin/DynamicLibraryManagerException.</title>
<updated>2002-12-02T18:45:54+00:00</updated>
<author>
<name>Baptiste Lepilleur</name>
<email>gaiacrtn@free.fr</email>
</author>
<published>2002-12-02T18:45:54+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=e2b784709cde0cd7040b4bfb3401869c6306bcc0'/>
<id>e2b784709cde0cd7040b4bfb3401869c6306bcc0</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Include/cppunit/Portability.</title>
<updated>2002-08-28T21:20:52+00:00</updated>
<author>
<name>Baptiste Lepilleur</name>
<email>gaiacrtn@free.fr</email>
</author>
<published>2002-08-28T21:20:52+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cppunit.git/commit/?id=edf9c347bd42b7940d39dd70049fb9895d3a3c5a'/>
<id>edf9c347bd42b7940d39dd70049fb9895d3a3c5a</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
