As discussed on pull request #102, this is a proper fix for the bug when sending block messages when there is only one message type, as reported in issue #77. I put back the use of __builtin_clz.
I included basic tests. I wanted to go further and actually test that the message type is not serialized when there is only one message type (because redundant), but I didn't know how to do it. So instead I just tested basic message sending/receiving in all 3 cases:
Reliable: it was already working properly before the fix but it serves as a non regression test
Reliable blocks: the test threw an assert before the fix, and worked fine after the fix
As discussed on pull request #102, this is a proper fix for the bug when sending block messages when there is only one message type, as reported in issue #77. I put back the use of
__builtin_clz
.I included basic tests. I wanted to go further and actually test that the message type is not serialized when there is only one message type (because redundant), but I didn't know how to do it. So instead I just tested basic message sending/receiving in all 3 cases: