You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think setting the expectation .withOutputParameterReturning() should copied the value pointed to. However, it stores the pointer and dereferences it on the actualCall().withOutputParameter().
If the call .withOutputParameterReturning() copies the given memory it would allow the memory to be changed between expect and actual calls.
The problem was encountered when trying to mock an interface where the .withOutputParameterReturning() is given a chunk of dynamically allocated memory which is free'd (and reused) before the actual call.
This is the simplest example I can come up with to reproduce the issue.
The text was updated successfully, but these errors were encountered:
asgeroverby
changed the title
The value of .withOutputParameterReturning() is changeable setting the expectation
Expectation value of .withOutputParameterReturning() is changeable after the call
Jun 4, 2019
asgeroverby
changed the title
Expectation value of .withOutputParameterReturning() is changeable after the call
The expectation value of .withOutputParameterReturning() is changeable after the call
Jun 4, 2019
asgeroverby
added a commit
to asgeroverby/cpputest
that referenced
this issue
Jun 5, 2019
I think setting the expectation
.withOutputParameterReturning()
should copied the value pointed to. However, it stores the pointer and dereferences it on theactualCall().withOutputParameter()
.If the call
.withOutputParameterReturning()
copies the given memory it would allow the memory to be changed between expect and actual calls.The problem was encountered when trying to mock an interface where the
.withOutputParameterReturning()
is given a chunk of dynamically allocated memory which is free'd (and reused) before the actual call.This is the simplest example I can come up with to reproduce the issue.
The text was updated successfully, but these errors were encountered: