test/hfp: test invalid commands

This commit is contained in:
Matthias Ringwald 2024-07-31 13:33:49 +02:00
parent 36916f811e
commit d4c70691b6

View File

@ -652,12 +652,18 @@ TEST(HFPParser, custom_command_hf_with_assignment){
}
TEST(HFPParser, HFP_GABRBAGE_AND_ANSWER_CALL){
parse_ag("\r\nABCDEF\r\n");
parse_ag("\r\nAT+ABCDEF\r\n");
CHECK_EQUAL(HFP_CMD_UNKNOWN, context.command);
snprintf(packet, sizeof(packet), "\r\n%s\r\n", HFP_ANSWER_CALL);
parse_ag(packet);
CHECK_EQUAL(HFP_CMD_CALL_ANSWERED, context.command);
}
TEST(HFPParser, AG_SENDS_RANDOM){
parse_hf("\r\n+$PATH:511\r\n");
CHECK_EQUAL(HFP_CMD_UNKNOWN, context.command);
}
TEST(HFPParser, long_command){
char command[300];
uint16_t offset = 0;