Menu

Turtle 1.2.2 has been released !

This release focusses on providing a better API for compilers with variadic macros support :

  • Added variadic macro support for MOCK_BASE_CLASS
  • Added variadic macro support for MOCK_FUNCTION, MOCK_FUNCTOR and the MOCK_METHOD family
  • Added round parenthesis support for signatures for MOCK_FUNCTION, MOCK_FUNCTOR and the MOCK_METHOD family
  • Added MOCK_CONVERSION_OPERATOR_TPL, MOCK_CONST_CONVERSION_OPERATOR_TPL and MOCK_NON_CONST_CONVERSION_OPERATOR_TPL
  • Added MOCK_FUNCTOR_TPL

The main changes are twofold, first they deal with making it possible to write code such as

MOCK_BASE_CLASS( mock_class, base_class< int, int > )
{};

Whereas previously the compiler would refuse to pass 3 arguments where the macro was accepting only two.

Then the MOCK_METHOD macro has been extended to support the following combinations :

MOCK_BASE_CLASS( mock_class, base_class )
{
    MOCK_METHOD( method, 0 )                 // as before, method must be a virtual member function in base_class
    MOCK_METHOD( method, 0, void() )         // equivalent to MOCK_METHOD_EXT( method, 0, void(), method )
    MOCK_METHOD( method, 0, void(), method ) // also equivalent to MOCK_METHOD_EXT( method, 0, void(), method )
};

The MOCK_METHOD_EXT macro remains supported for compilers which do not have variadic macros.

For more information see http://turtle.sf.net

Posted by Mathieu Champlon 2013-03-09

Log in to post a comment.