Download News Support Project

Next

Turtle

A C++ mock object library for Boost

Distributed under the Boost Software License, Version 1.0.


Table of Contents

Motivation
Getting Started
Create, expect, trigger, verify
Expectation selection algorithm
Error diagnostic
Customization
Logging
Constraints
Number of arguments
Test framework integration
Thread safety
Reference
Creation
Expectation
Verification
Reset
Constraint
Patterns
Managing static mock objects
Waiting for an asynchronous call
Retrieving an argument to use in a later constraint
Invoking a functor received as parameter
Quickly writing a custom constraint for a serializable type
Limitations
No support for unicode logging
Literal 0 cannot be used as null pointer in constraints
Non-virtual methods cannot be mocked
Template methods cannot be mocked
Template base class methods cannot be mocked without specifying the signature
Protected and private virtual methods cannot be mocked without specifying the signature
Methods with a throw specifier cannot be mocked
Compilers without support for variadic macros fail on commas in MOCK_BASE_CLASS
Warning C4505: '...' : unreferenced local function has been removed
Warning C4301: '...': overriding virtual function only differs from '...' by const/volatile qualifier
Warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
Using C++11 lambda as constraints requires decltype compiler support
Rationale
General design forces
Exceptions thrown should not extend std::exception
The library interface is based on many macros
Changelog
1.3.2
1.3.1
1.3.0
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.1
Acknowledgements
[Note] Note

Turtle is not an official Boost library.

Last revised: June 19, 2020 at 16:17:00 GMT


Next