Class FunctionComparator¶
Defined in File NamedValueComparator.hpp
Inheritance Relationships¶
Base Type¶
public mu::tiny::mock::NamedValueComparator(Class NamedValueComparator)
Class Documentation¶
-
class FunctionComparator : public mu::tiny::mock::NamedValueComparator¶
[source] NamedValueComparator backed by plain function pointers.
Convenient alternative to subclassing when you want to keep comparator logic in standalone functions.
Public Types
-
using IsEqualFunction = bool (*)(const void*, const void*)¶
Function type for the equality predicate.
Public Functions
-
inline FunctionComparator(IsEqualFunction equal, ValueToStringFunction val_to_string)¶
Construct from two plain function pointers.
- Parameters:
equal – Equality predicate.
val_to_string – String-conversion function.
-
inline virtual bool is_equal(const void *object1, const void *object2) override¶
Return true if
object1andobject2are equal.Both pointers point to objects of the type associated with this comparator.
- Parameters:
object1 – Pointer to the first object (typically the expected value).
object2 – Pointer to the second object (typically the actual value).
- Returns:
true if the two objects are considered equal.
-
using IsEqualFunction = bool (*)(const void*, const void*)¶