mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 02:00:12 +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:
@@ -32,10 +32,7 @@
|
||||
|
||||
void DumpBuffer(const char *aTextMessage, const uint8_t *aBuffer, uint16_t aBufferLength)
|
||||
{
|
||||
enum
|
||||
{
|
||||
kBytesPerLine = 16, // Number of bytes per line.
|
||||
};
|
||||
static constexpr uint16_t kBytesPerLine = 16; // Number of bytes per line.
|
||||
|
||||
char charBuff[kBytesPerLine + 1];
|
||||
uint16_t counter;
|
||||
|
||||
Reference in New Issue
Block a user