r/cpp • u/According_Leopard_80 • Feb 28 '26
Mocking the Standard Template Library
https://middleraster.github.io/TBCI/MockingTheSTL.htmlWriting a test double for just one function or type in the STL can be achieved with "Test Base Class Injection" and namespace shadowing.
18
Upvotes
View all comments
Show parent comment
1
u/eyes-are-fading-blue Feb 28 '26
How many template parameters you have normally? Our most high level objects which basically encode entire business logic have around 4. Only one or two generally needs active mocking.