forge: add patch 15 — report DM flood paths

This commit is contained in:
cj-vana
2026-05-17 21:08:43 -06:00
parent f00355c100
commit 6123355ced
2 changed files with 51 additions and 1 deletions

View File

@@ -547,7 +547,7 @@ static void test_ack_response_format() {
message.channel_name[0] = 0;
assert(FirmwareBot::parseCommand("!t", 2, &command));
assert(FirmwareBot::writeAckResponse(message, command, out, sizeof(out), &written) == BOT_WRITE_OK);
assert(strcmp(out, "@[unknown] direct | 0 hops, SNR 0.00 | recv 21:25:45") == 0);
assert(strcmp(out, "@[unknown] | 0 hops, SNR 0.00 | recv 21:25:45") == 0);
uint8_t path[] = { 0x12, 0x34, 0xab, 0xcd };
message.channel_kind = BOT_CHANNEL_BOT;
@@ -561,6 +561,11 @@ static void test_ack_response_format() {
assert(strcmp(out, "@[bob] | 2 hops, 2-byte hashes, SNR -1.25 | recv 21:25:45") == 0);
assert(strstr(out, "Bot test OK") == NULL);
message.channel_kind = BOT_CHANNEL_DM;
message.channel_name[0] = 0;
assert(FirmwareBot::writeAckResponse(message, command, out, sizeof(out), &written) == BOT_WRITE_OK);
assert(strcmp(out, "@[bob] | 2 hops, 2-byte hashes, SNR -1.25 | recv 21:25:45") == 0);
char small[16];
assert(FirmwareBot::writeAckResponse(message, command, small, sizeof(small), &written) == BOT_WRITE_TRUNCATED);
assert(strncmp(small, "@[bob]", 6) == 0);