Comments (3)
I use NAMED_ALLOW_CALL and a vector of expectations, i.e.,
std::vector<std::unique_ptr<trompeloeil::expectation>> allowedExpectations;
[...]
for (i...)
allowedExpectations.push_back(NAMED_ALLOW_CALL(mock[i], foo());
[...]
from trompeloeil.
Thanks a lot.
I saw the documentation, but I could not quite make out how to use it ;-) Sorry about that.
If the scoped lifetime rules are unsuitable, there are also thee named versions of the expectations.
NAMED_ALLOW_CALL(...)
NAMED_REQUIRE_CALL(...)
NAMED_FORBID_CALL(...)
These do the same, but they creata a std::unique_ptr<trompeloeil::expectation>, which you can bind to variables that you control the life time of.
from trompeloeil.
Works for me
from trompeloeil.
Related Issues (20)
- Compile without exceptions HOT 1
- doctest: Trompeloeil error reporting via doctest/trompeloeil.hpp gives unhelpful output HOT 5
- Add libc++-15 to the CI matrix HOT 1
- Drop ubuntu-18.04 from the CI matrix HOT 3
- Question about expectations HOT 2
- Non-constexpr TIMES HOT 5
- CMakeLists.txt has lower minimum required version to features used HOT 3
- find_package should be used to find catch HOT 2
- Please add to README how to run tests HOT 6
- Singleton testing throwing compilation errors with Catch2 HOT 2
- Return any value HOT 3
- Conversion from wildcard to class with template constructor is ambiguous HOT 8
- Lambads inside SIDE_EFFECT HOT 1
- Trompeloeil should work with CMake FetchContent HOT 8
- Slightly confusing error message when using .TIMES() in combination with .IN_SEQUENCE() HOT 6
- Mis-spelled preprocessor symbol TROMPELOEIL_GCC_VERSION HOT 2
- Still ambigous match of wildcard _ for parameter type constructible from any T by value
- Feature Request: Would like a built-in way to prevent expiring async mocks
- regex matching `std::string_view` HOT 5
- Can't seem to mock a call to a function that lives on a windows dll when that dll is loaded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trompeloeil.