Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We can not compile the consumer.cpp mainly because of two errors:
pact_mock_server_ffi::with_binary_file()
The first error can be resolved by including the third argument in the
pact_mock_server_ffi::write_pact_file
function call. And the second error can be resolved by casting thebuffer.data()
toconst uint8_t*
while calling thepact_mock_server_ffi::with_binary_file
function fromconsumer.cpp
Resolving error 1
The error is as follows:
Here the last boolean argument determines if the file should be overrite or not. The declaration in the
pact_mock_server_ffi.h
for this function is as follows:int32_t write_pact_file(int32_t mock_server_port, const char *directory, bool overwrite);
In this PR, I have set the overwrite to false.
Resolving error 2
The error is as follows:
This error arrise because the declaration of the
with_binary_file()
method in thepact_mock_server_ffi_h
is as follows:And while passing the argument
body
, achar*
data is passed. And the solution is parsing the argument toconst uint8_t*
while calling fromconsumer.cpp