[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:
Abtin Keshavarzian
2026-05-25 19:39:27 -07:00
committed by GitHub
parent 6847b9acdf
commit 9d95a19e52
15 changed files with 87 additions and 152 deletions
+1 -4
View File
@@ -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;