[test] fix address list comparison in spinel_prop_codec (#10954)

This commit updates how address lists are compared in the unit test
`spinel_prop_codec`, ensuring that the correct size based on the
array length is passed to `memcmp()`.
This commit is contained in:
Abtin Keshavarzian
2024-11-27 07:33:11 -08:00
committed by GitHub
parent 8dfacb514b
commit 64cf63ecb2
+2 -2
View File
@@ -84,8 +84,8 @@ void TestDnssd(void)
SuccessOrQuit(error = DecodeDnssdHost(decoder, dnssdHostDecode, requestId, callbackData, callbackDataLen));
VerifyOrQuit(strcmp(dnssdHostDecode.mHostName, dnssdHostEncode.mHostName) == 0);
VerifyOrQuit(dnssdHostDecode.mAddressesLength == dnssdHostEncode.mAddressesLength);
VerifyOrQuit(memcmp(dnssdHostDecode.mAddresses, dnssdHostEncode.mAddresses, sizeof(dnssdHostEncode.mAddresses)) ==
0);
VerifyOrQuit(memcmp(dnssdHostDecode.mAddresses, dnssdHostEncode.mAddresses,
dnssdHostDecode.mAddressesLength * sizeof(otIp6Address)) == 0);
VerifyOrQuit(requestId == 1);
VerifyOrQuit(callbackDataLen == sizeof(otPlatDnssdRegisterCallback));
VerifyOrQuit(*reinterpret_cast<const otPlatDnssdRegisterCallback *>(callbackData) == DnssdFakeCallback);