mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 14:47:46 +00:00
[error] add 'ot::Error' and 'kError{Name}' for use by core modules (#6237)
This commit adds a new core header files `common/error.hpp` which
defines `ot::Error` (mirroring `otError`) and `kError{Name}` constants
(mirroring the public `OT_ERROR_{NAME}` definitions). The new (C++
style) definitions are used by core modules. This commit also moves
`otThreadErrorToString()` (from `logging.hpp` to `error.hpp`) and
renames it to `ErrorToString()` which is used as the internal (to
core) function to covert an `Error` to a string.
This commit is contained in:
@@ -168,11 +168,11 @@ void TestNetifMulticastAddresses(void)
|
||||
VerifyMulticastAddressList(netif, &addresses[0], 8);
|
||||
|
||||
IgnoreError(address.FromString(kTestAddress1)); // same as netifAddress (internal)
|
||||
VerifyOrQuit(netif.UnsubscribeExternalMulticast(address) == OT_ERROR_INVALID_ARGS,
|
||||
VerifyOrQuit(netif.UnsubscribeExternalMulticast(address) == kErrorInvalidArgs,
|
||||
"UnsubscribeExternalMulticast() did not fail when address was not external");
|
||||
|
||||
IgnoreError(address.FromString(kRealmLocalAllMpl));
|
||||
VerifyOrQuit(netif.UnsubscribeExternalMulticast(address) == OT_ERROR_INVALID_ARGS,
|
||||
VerifyOrQuit(netif.UnsubscribeExternalMulticast(address) == kErrorInvalidArgs,
|
||||
"UnsubscribeExternalMulticast() did not fail when address was fixed address");
|
||||
|
||||
netif.UnsubscribeAllRoutersMulticast();
|
||||
@@ -200,7 +200,7 @@ void TestNetifMulticastAddresses(void)
|
||||
|
||||
for (uint8_t i = 0; i < 5; i++)
|
||||
{
|
||||
VerifyOrQuit(netif.SubscribeExternalMulticast(addresses[i]) == OT_ERROR_INVALID_ARGS,
|
||||
VerifyOrQuit(netif.SubscribeExternalMulticast(addresses[i]) == kErrorInvalidArgs,
|
||||
"SubscribeExternalMulticast() did not fail when address was a default/fixed address");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user