[boost-users] [test] Boost.Test Mock
Hi All, Whare can i find information about Boost.Test Mock? -- Regards, Andrey
On 1 March 2010 22:59, Gennadiy Rozental
Do you mean header mock_object.hpp and related interaction testing facilities in logged_expectations.hpp and exception_safety.hpp?
Yes I've just discovered for myself BOOST_TEST_EXCEPTION_SAFETY and boost::itest::mock_object. I would like read more about this tools. What is the algorithm of running test case of BOOST_TEST_EXCEPTION_SAFETY? -- Regards, Andrey
Andrey Torba
I've just discovered for myself BOOST_TEST_EXCEPTION_SAFETY and boost::itest::mock_object. I would like read more about this tools.What is the algorithm of running test case of BOOST_TEST_EXCEPTION_SAFETY?
The idea, which originally should be attributed to David Abrahams I believe, is to test an exception safety of generic components. You implement particular interaction (for example adding element to the generic collection) based on generic component instantiated with mock object, specify all the invariants and the test case will check that no memory leaks and no invariants will be broken regardless where and if an exception occurred. You can see an example of it's usage in examples folder. Unfortunately as of now there is no documentation page covering this functionality. Gennadiy
Now i can test code for exception safety:
template
participants (2)
-
Andrey Torba
-
Gennadiy Rozental