borromeotlhs / amop

Automatically exported from code.google.com/p/amop
0 stars 0 forks source link

amop doesn't count correctly the calls to methods #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile the attached example
2. run the example

What is the expected output? What do you see instead?
expect: the test should fail
instead: the test passes !!!

What version of the product are you using? On what operating system?
SVN rev 135

Please provide any additional information below.
I have attached the files I have used for testing. The unit-test I've used
is CxxTest.

Original issue reported on code.google.com by ibo...@gmail.com on 22 Nov 2008 at 6:19

Attachments:

GoogleCodeExporter commented 9 years ago
I've updated the amop_test01.cpp to be more explicit on what's wrong from my 
point of
view (attached).

When I run the test, I get this:

Running 1 test
In TestInternal::testAdd:
.../amop_test01.cpp:28: Error: Expected (mock.verify()) to throw
(amop::CallCountException) but it didn't throw
Failed 1 of 1 test

Unless I have understood the purpose of verify() wrong, it should have thrown 
because
the mock.close() was called only once by internal.add(100), but the testAdd 
expects 2
calls to be made to mock.close().

Original comment by ibo...@gmail.com on 22 Nov 2008 at 9:28

Attachments: