mirror of
https://github.com/espressif/openthread.git
synced 2026-09-06 17:20:09 +00:00
[child] remove instance parameter from Ip6Address related methods (#4569)
Remove the now unnecessary `aInstance` parameter in `Child` methods (since `Child` is now itself an `InstanceLocator`).
This commit is contained in:
committed by
Jonathan Hui
parent
fb65c77c1a
commit
0f5edc4c89
+15
-15
@@ -54,7 +54,7 @@ void VerifyChildIp6Addresses(const Child &aChild, uint8_t aAddressListLength, co
|
||||
|
||||
for (uint8_t index = 0; index < aAddressListLength; index++)
|
||||
{
|
||||
VerifyOrQuit(aChild.HasIp6Address(*sInstance, aAddressList[index]), "HasIp6Address() failed");
|
||||
VerifyOrQuit(aChild.HasIp6Address(aAddressList[index]), "HasIp6Address() failed");
|
||||
}
|
||||
|
||||
memset(addressObserved, 0, sizeof(addressObserved));
|
||||
@@ -67,7 +67,7 @@ void VerifyChildIp6Addresses(const Child &aChild, uint8_t aAddressListLength, co
|
||||
}
|
||||
}
|
||||
|
||||
while (aChild.GetNextIp6Address(*sInstance, iterator, address) == OT_ERROR_NONE)
|
||||
while (aChild.GetNextIp6Address(iterator, address) == OT_ERROR_NONE)
|
||||
{
|
||||
bool addressIsInList = false;
|
||||
|
||||
@@ -90,7 +90,7 @@ void VerifyChildIp6Addresses(const Child &aChild, uint8_t aAddressListLength, co
|
||||
|
||||
if (sInstance->Get<Mle::MleRouter>().IsMeshLocalAddress(aAddressList[index]))
|
||||
{
|
||||
SuccessOrQuit(aChild.GetMeshLocalIp6Address(*sInstance, address),
|
||||
SuccessOrQuit(aChild.GetMeshLocalIp6Address(address),
|
||||
"Child::GetMeshLocalIp6Address() failed\n");
|
||||
VerifyOrQuit(address == aAddressList[index], "GetMeshLocalIp6Address() did not return expected address");
|
||||
hasMeshLocal = true;
|
||||
@@ -99,7 +99,7 @@ void VerifyChildIp6Addresses(const Child &aChild, uint8_t aAddressListLength, co
|
||||
|
||||
if (!hasMeshLocal)
|
||||
{
|
||||
VerifyOrQuit(aChild.GetMeshLocalIp6Address(*sInstance, address) == OT_ERROR_NOT_FOUND,
|
||||
VerifyOrQuit(aChild.GetMeshLocalIp6Address(address) == OT_ERROR_NOT_FOUND,
|
||||
"Child::GetMeshLocalIp6Address() returned an address not in the expected list");
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ void TestChildIp6Address(void)
|
||||
|
||||
for (uint8_t index = 0; index < numAddresses; index++)
|
||||
{
|
||||
SuccessOrQuit(child.AddIp6Address(*sInstance, addresses[index]), "AddIp6Address() failed");
|
||||
SuccessOrQuit(child.AddIp6Address(addresses[index]), "AddIp6Address() failed");
|
||||
VerifyChildIp6Addresses(child, 1, &addresses[index]);
|
||||
|
||||
child.ClearIp6Addresses();
|
||||
@@ -168,7 +168,7 @@ void TestChildIp6Address(void)
|
||||
|
||||
for (uint8_t index = 0; index < numAddresses; index++)
|
||||
{
|
||||
SuccessOrQuit(child.AddIp6Address(*sInstance, addresses[index]), "AddIp6Address() failed");
|
||||
SuccessOrQuit(child.AddIp6Address(addresses[index]), "AddIp6Address() failed");
|
||||
VerifyChildIp6Addresses(child, index + 1, addresses);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void TestChildIp6Address(void)
|
||||
|
||||
for (uint8_t index = 0; index < numAddresses; index++)
|
||||
{
|
||||
VerifyOrQuit(child.AddIp6Address(*sInstance, addresses[index]) == OT_ERROR_ALREADY,
|
||||
VerifyOrQuit(child.AddIp6Address(addresses[index]) == OT_ERROR_ALREADY,
|
||||
"AddIp6Address() did not fail when adding same address");
|
||||
VerifyChildIp6Addresses(child, numAddresses, addresses);
|
||||
}
|
||||
@@ -191,10 +191,10 @@ void TestChildIp6Address(void)
|
||||
|
||||
for (uint8_t index = 0; index < numAddresses; index++)
|
||||
{
|
||||
SuccessOrQuit(child.RemoveIp6Address(*sInstance, addresses[index]), "RemoveIp6Address() failed");
|
||||
SuccessOrQuit(child.RemoveIp6Address(addresses[index]), "RemoveIp6Address() failed");
|
||||
VerifyChildIp6Addresses(child, numAddresses - 1 - index, &addresses[index + 1]);
|
||||
|
||||
VerifyOrQuit(child.RemoveIp6Address(*sInstance, addresses[index]) == OT_ERROR_NOT_FOUND,
|
||||
VerifyOrQuit(child.RemoveIp6Address(addresses[index]) == OT_ERROR_NOT_FOUND,
|
||||
"RemoveIp6Address() did not fail when removing an address not on the list");
|
||||
}
|
||||
|
||||
@@ -206,15 +206,15 @@ void TestChildIp6Address(void)
|
||||
|
||||
for (uint8_t index = 0; index < numAddresses; index++)
|
||||
{
|
||||
SuccessOrQuit(child.AddIp6Address(*sInstance, addresses[index]), "AddIp6Address() failed");
|
||||
SuccessOrQuit(child.AddIp6Address(addresses[index]), "AddIp6Address() failed");
|
||||
}
|
||||
|
||||
for (uint8_t index = numAddresses - 1; index > 0; index--)
|
||||
{
|
||||
SuccessOrQuit(child.RemoveIp6Address(*sInstance, addresses[index]), "RemoveIp6Address() failed");
|
||||
SuccessOrQuit(child.RemoveIp6Address(addresses[index]), "RemoveIp6Address() failed");
|
||||
VerifyChildIp6Addresses(child, index, &addresses[0]);
|
||||
|
||||
VerifyOrQuit(child.RemoveIp6Address(*sInstance, addresses[index]) == OT_ERROR_NOT_FOUND,
|
||||
VerifyOrQuit(child.RemoveIp6Address(addresses[index]) == OT_ERROR_NOT_FOUND,
|
||||
"RemoveIp6Address() did not fail when removing an address not on the list");
|
||||
}
|
||||
|
||||
@@ -229,12 +229,12 @@ void TestChildIp6Address(void)
|
||||
|
||||
for (uint8_t index = 0; index < numAddresses; index++)
|
||||
{
|
||||
SuccessOrQuit(child.AddIp6Address(*sInstance, addresses[index]), "AddIp6Address() failed");
|
||||
SuccessOrQuit(child.AddIp6Address(addresses[index]), "AddIp6Address() failed");
|
||||
}
|
||||
|
||||
SuccessOrQuit(child.RemoveIp6Address(*sInstance, addresses[indexToRemove]), "RemoveIp6Address() failed");
|
||||
SuccessOrQuit(child.RemoveIp6Address(addresses[indexToRemove]), "RemoveIp6Address() failed");
|
||||
|
||||
VerifyOrQuit(child.RemoveIp6Address(*sInstance, addresses[indexToRemove]) == OT_ERROR_NOT_FOUND,
|
||||
VerifyOrQuit(child.RemoveIp6Address(addresses[indexToRemove]) == OT_ERROR_NOT_FOUND,
|
||||
"RemoveIp6Address() did not fail when removing an address not on the list");
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user