Add test for parsing broadcast source ID
This commit is contained in:
@@ -151,6 +151,21 @@ void test_unicast_destination_address()
|
||||
delete[] packet_data;
|
||||
}
|
||||
|
||||
void test_broadcast_source_address()
|
||||
{
|
||||
const uint8_t* packet_data = hex_string_to_array("C00F0005A1FFFF00008604FF000053471B446B");
|
||||
|
||||
Packet packet;
|
||||
|
||||
run_parse_test(packet_data, packet);
|
||||
|
||||
auto header = std::get<BroadcastHeader>(packet.header);
|
||||
|
||||
TEST_ASSERT_EQUAL_HEX16(0x0000, header.source);
|
||||
|
||||
delete[] packet_data;
|
||||
}
|
||||
|
||||
int runUnityTests(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
@@ -163,6 +178,7 @@ int runUnityTests(void)
|
||||
RUN_TEST(test_groups_multiple_groups);
|
||||
RUN_TEST(test_unicast_source_address);
|
||||
RUN_TEST(test_unicast_destination_address);
|
||||
RUN_TEST(test_broadcast_source_address);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user