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 often get bit by the issue that the data pointed to when calling will_set_contents_of_parameter(<parameter>, pointer_to_data, length) has to be retained until the actual call to the mock. This is documented but it would be much better if this wasn't an issue at all.
The expectation is probably that once the expect() has run you can forget about it, which is not the case.
I think it would be possible to memcpy() the data to an allocated area held by the expectation/constraint. This way it is saved from destruction until it is needed, used and discarded.
The text was updated successfully, but these errors were encountered:
thoni56
changed the title
will_set
will_set_contents_od_parameter() should save the data
Mar 23, 2022
I often get bit by the issue that the data pointed to when calling
will_set_contents_of_parameter(<parameter>, pointer_to_data, length)
has to be retained until the actual call to the mock. This is documented but it would be much better if this wasn't an issue at all.The expectation is probably that once the
expect()
has run you can forget about it, which is not the case.I think it would be possible to
memcpy()
the data to an allocated area held by the expectation/constraint. This way it is saved from destruction until it is needed, used and discarded.The text was updated successfully, but these errors were encountered: