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.
In order to test issue 659, I have made some ugly changes to internal classes. Please review these changes and let me know if I'm on the right track or if there is a less intrusive manner to test the results of the "on_message" method of node_impl.
application.cpp - added comments only
node.hpp - node class - exposed "my" as protected, to have access in derived test class
node.hpp - simultated_network class - added method to retrieve the implementation thread. This class doesn't seem to be used anywhere, so I don't think there is any impact elsewhere. (NOTE: This required the addition of the header fc/thread/thread.hpp)
peer_connection.hpp -peer_connection class - change constructor to protected, to have access in derived test class
peer_connection.hpp - peer_connection class - changed send_message method to virtual, so as to override in derived test class
With those changes in place, I can test the on_message method. See p2p_node_tests.cpp. If you think these changes are horrible, I can say I agree. But I can think of no better way to do it. Please let me know your thoughts.