net: make CaptureMessage() mockable

Rename `CaptureMessage()` to `CaptureMessageToFile()` and introduce a
`std::function` variable called `CaptureMessage` whose value can be
changed by unit tests, should they need to inspect message contents.
This commit is contained in:
Vasil Dimov committed 2022-03-02 15:40:36 +01:00
1 parent 43868ba416
commit 3cb9d9c861
3 files changed
+23 -3

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ LENGTH_SIZE = 4
MSGTYPE_SIZE = 12
def mini_parser(dat_file):
"""Parse a data file created by CaptureMessage.
"""Parse a data file created by CaptureMessageToFile.
From the data file we'll only check the structure.