diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2023-11-16 12:34:27 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2024-02-28 18:03:22 +0100 |
commit | 2fa9de06c2c8583ee8e2434dc97014b26e218ab5 (patch) | |
tree | 3e55459da61c2ac8e903e537a9e6cd669f4f4345 /test | |
parent | ba907f96ad37c09c49c0e1532fad118fcb8dd4a8 (diff) |
net: make the list of known message types a compile time constant
Turn the `std::vector` to `std::array` because it is cheaper and
allows us to have the number of the messages as a compile time
constant: `ALL_NET_MESSAGE_TYPES.size()` which can be used in
future code to build other `std::array`s with that size.
Diffstat (limited to 'test')
-rwxr-xr-x | test/fuzz/test_runner.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py index ff3b6e6b6d..10caaa456e 100755 --- a/test/fuzz/test_runner.py +++ b/test/fuzz/test_runner.py @@ -205,12 +205,12 @@ def transform_process_message_target(targets, src_dir): p2p_msg_target = "process_message" if (p2p_msg_target, {}) in targets: lines = subprocess.run( - ["git", "grep", "--function-context", "g_all_net_message_types{", src_dir / "src" / "protocol.cpp"], + ["git", "grep", "--function-context", "ALL_NET_MESSAGE_TYPES{", src_dir / "src" / "protocol.h"], check=True, stdout=subprocess.PIPE, text=True, ).stdout.splitlines() - lines = [l.split("::", 1)[1].split(",")[0].lower() for l in lines if l.startswith("src/protocol.cpp- NetMsgType::")] + lines = [l.split("::", 1)[1].split(",")[0].lower() for l in lines if l.startswith("src/protocol.h- NetMsgType::")] assert len(lines) targets += [(p2p_msg_target, {"LIMIT_TO_MESSAGE_TYPE": m}) for m in lines] return targets |