FuncType* target = &FreeFunction;
assert(globalMemCounter.checkOutstandingNewEq(0));
std::function<FuncType> f2(std::allocator_arg, alloc, target);
- assert(globalMemCounter.checkOutstandingNewEq(0));
+ // The allocator may not fit in the small object buffer, if we allocated
+ // check it was done via the allocator.
+ assert(globalMemCounter.checkOutstandingNewEq(test_alloc_base::alloc_count));
assert(f2.template target<FuncType*>());
assert(*f2.template target<FuncType*>() == target);
assert(f2.template target<FuncType>() == 0);
TargetType target = &MemFunClass::foo;
assert(globalMemCounter.checkOutstandingNewEq(0));
std::function<FuncType> f2(std::allocator_arg, alloc, target);
- assert(globalMemCounter.checkOutstandingNewEq(0));
+ assert(globalMemCounter.checkOutstandingNewEq(test_alloc_base::alloc_count));
assert(f2.template target<TargetType>());
assert(*f2.template target<TargetType>() == target);
assert(f2.template target<FuncType*>() == 0);