mirror of
https://github.com/espressif/openthread.git
synced 2026-08-01 00:27:47 +00:00
[tests] use constexpr for constants in unit tests (#13145)
This commit refactors various unit tests to use `constexpr` for defining constants instead of anonymous `enum` types. Using `constexpr` is the modern and preferred approach in C++, as it provides explicit types for constants and improves code clarity and type safety.
This commit is contained in:
@@ -36,10 +36,7 @@
|
||||
|
||||
namespace ot {
|
||||
|
||||
enum
|
||||
{
|
||||
kStringSize = 10,
|
||||
};
|
||||
constexpr uint16_t kStringSize = 10;
|
||||
|
||||
template <uint16_t kSize> void PrintString(const char *aName, const String<kSize> aString)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user