Commit Graph

17 Commits

Author SHA1 Message Date
Jonathan Hui 9c467a23ae [clang-format] apply v14 changes (#8490) 2022-12-07 16:23:20 -08:00
Simon Lin d79d0a99ac [logging] refine NOTE and WARN logs (#7369)
This commit refines `NOTE` and `WARN` logs:
- Certain `INFO` and `WARN` logs are changed to `INFO` since they are
  normal situations.
2022-02-25 21:28:00 -08:00
Simon Lin 53a19d961c [posix-netif] refactor address changing logs (#7271) 2022-01-05 11:58:51 -08:00
Abtin Keshavarzian 6895edda59 [linked-list] range-based for loop iteration over all entries (#6945)
This commit enables use of range-based `for` loop for iterating over
all the entries in a `LinkedList`. It adds private implementations of
`Iterator` and `ConstIterator` which inherit from `ItemPtrIterator`
and use the `GetNext()` to go to the next entry. The range-based
`for` loop practically acts as a syntactic sugar helping simplify the
code and does not add any code size (or any expected run-time)
overhead.
2021-08-23 14:50:14 -07:00
Abtin Keshavarzian 4d8cbe6d59 [netif] define related types (unicast/mcast addr, iterator) as nested types (#6928)
This commit renames and moves the related types in `Netif` module like
`UnicastAddress`, `MulticastAddress`, etc. under `Netif` class (as a
nested type). It also moves iterator types under the related type
(for example, `ExternalMulticastAddressIteratorBuilder` becomes
`Iterator::Builder` under `ExternalMulticastAddress` class. These
changes help simplify the code (allow us to use shorter names in the
`Netif` implementation).
2021-08-18 11:37:25 -07:00
Abtin Keshavarzian 57d072d352 [test] enhance {Verify/Success}OrQuit() and their use in unit test (#6764)
This commit updates `VerifyOrQuit()` and `SuccessOrQuit()` macros to
include the failed condition in the error message that is printed on
a failure (in addition to function name and line number where the
error happened). This commit also changes the second parameter
(`aMessage`) to in these macros to be optional.

This commit also updates unit tests to remove the second `aMessage`
string in cases where the failure can be inferred from the condition
itself.
2021-06-28 11:38:10 -07:00
Abtin Keshavarzian 7dca56e982 [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.
2021-03-15 21:07:07 -07:00
Jonathan Hui 4ac6e5509c [clang-tidy] google-explicit-constructor (#5734) 2020-10-29 08:37:31 -07:00
Jonathan Hui 1326d64a64 [style] replace NULL with nullptr (#5109) 2020-06-17 22:44:54 -07:00
Jonathan Hui c5b9c3efac [netif] change UnsubscribeAllRoutersMulticast() to return void (#4942) 2020-05-11 14:07:25 -07:00
Jonathan Hui f97aacb501 [netif] change SubscribeAllRoutersMulticast() to return void (#4942) 2020-05-11 14:07:25 -07:00
Jonathan Hui 19ecc83acc [netif] change UnsubscribeAllNodesMulticast() to return void (#4942) 2020-05-11 14:07:25 -07:00
Jonathan Hui 8ff86bba70 [netif] change SubscribeAllNodesMulticast() to return void (#4942) 2020-05-11 14:07:25 -07:00
Jonathan Hui 6a3e04a48f [netif] change UnsubscribeMulticast() to return void (#4942) 2020-05-11 14:07:25 -07:00
Jonathan Hui e8d6705fdd [netif] change SubscribeMulticast() to return void (#4942) 2020-05-11 14:07:25 -07:00
Abtin Keshavarzian 612e10e664 [error] add missing IgnoreError (#4931) 2020-05-06 22:05:25 -07:00
Abtin Keshavarzian ab89f40385 [unit-test] add test covering netif multicast address methods (#4388) 2019-12-12 08:56:08 -08:00