martinmoene / lest

A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD (includes C++98 variant)
Boost Software License 1.0
390 stars 45 forks source link

Unclear output from example with using trompeloeil #67

Closed lopshopedun closed 5 years ago

lopshopedun commented 5 years ago

Hi, Martin!

I'm playing with the example 16-trompeloeil-runtime.cpp, where the default reporter for trompeloeil is used. I noticed that if the test case fails, an exception is always thrown with trompeloeil::severity::fatal and then I got the following output:

[file/line unavailable]:0: No match for call of method with signature bool(std::string) with. param _1 == world

Tried mock.method("hello") at 16-trompeloeil-runtime.cpp:37 Expected _1 == hello : Expect one call to mock.method(std::string): 1 out of 3 selected tests failed.

  1. Why it is necessary to throw exception in this case?
  2. Why is it output No match for calling the method with the signature bool (std::string) with. if the signature of mock-function is ok and the problem is just the wrong value of the argument?
  3. In which cases a line argument in use-trompeloeil-with-lest reporter not equal 0?
lopshopedun commented 5 years ago

Yes, those were a stupid questions. Re-read documentation of lest and trompeloeil once again.

martinmoene commented 5 years ago

@dmitofclubs -1 for stupid questions, +1 for reread documentation ;)