diff --git a/tests/test_cobs_decode_tinyframe.cc b/tests/test_cobs_decode_tinyframe.cc index ffa933d..e4e07fe 100644 --- a/tests/test_cobs_decode_tinyframe.cc +++ b/tests/test_cobs_decode_tinyframe.cc @@ -176,7 +176,7 @@ TEST_CASE("Decode: Inplace == External") { SUBCASE("Fill with one/zero pattern") { for (auto i{ 0u }; i < inplace.size() - 2; ++i) { inplace[0] = COBS_TINYFRAME_SENTINEL_VALUE; - for (auto j = 1u; j < i; ++j) { + for (auto j{ 1u }; j < i; ++j) { inplace[j] = (j & 1) ^ 1; } inplace[i + 1] = COBS_TINYFRAME_SENTINEL_VALUE; diff --git a/tests/test_cobs_encode_inc.cc b/tests/test_cobs_encode_inc.cc index f23e4fc..9239c11 100644 --- a/tests/test_cobs_encode_inc.cc +++ b/tests/test_cobs_encode_inc.cc @@ -40,9 +40,9 @@ TEST_CASE("cobs_encode_inc") { .code_idx = 0, .code = 0, .need_advance = 0 }; - size_t const enc_max{ 1024 }; + size_t constexpr enc_max{ 1024 }; byte_vec_t enc_buf(enc_max); - size_t const dec_max{ 1024 }; + size_t constexpr dec_max{ 1024 }; byte_vec_t dec_buf(dec_max); REQUIRE(cobs_encode_inc_begin(enc_buf.data(), enc_max, &ctx) == COBS_RET_SUCCESS); @@ -136,7 +136,7 @@ TEST_CASE("cobs_encode_inc") { TEST_CASE("cobs_encode_inc_end") { cobs_enc_ctx_t ctx; - size_t const enc_max{ 1024 }; + size_t constexpr enc_max{ 1024 }; byte_vec_t enc_buf(enc_max); size_t enc_len; @@ -218,9 +218,9 @@ void require_equal(byte_vec_t const &v1, byte_vec_t const &v2) { TEST_CASE("Single/multi-encode equivalences") { cobs_enc_ctx_t ctx; - size_t const enc_max{ 4096 }; + size_t constexpr enc_max{ 4096 }; byte_vec_t enc_buf(enc_max); - size_t const dec_max{ 4096 }; + size_t constexpr dec_max{ 4096 }; byte_vec_t dec_buf(dec_max); REQUIRE(cobs_encode_inc_begin(enc_buf.data(), enc_max, &ctx) == COBS_RET_SUCCESS); @@ -288,7 +288,7 @@ TEST_CASE("Single/multi-encode equivalences") { } SUBCASE("Header / payload split") { - byte_t const h[]{ 0x02, 0x03, 0xCC, 0xDF, 0x13, 0x49 }; + byte_t constexpr h[]{ 0x02, 0x03, 0xCC, 0xDF, 0x13, 0x49 }; dec_buf.resize(400); std::iota(std::begin(dec_buf), std::end(dec_buf), byte_t{ 0x01 }); diff --git a/tests/test_cobs_encode_tinyframe.cc b/tests/test_cobs_encode_tinyframe.cc index 4cfd92d..2abe2e0 100644 --- a/tests/test_cobs_encode_tinyframe.cc +++ b/tests/test_cobs_encode_tinyframe.cc @@ -5,7 +5,7 @@ #include #include -static constexpr byte_t CSV = COBS_TINYFRAME_SENTINEL_VALUE; +static constexpr byte_t CSV{ COBS_TINYFRAME_SENTINEL_VALUE }; namespace { cobs_ret_t cobs_encode_vec(byte_vec_t &v) { @@ -148,30 +148,30 @@ TEST_CASE("Encode: Inplace == External") { byte_t inplace[COBS_TINYFRAME_SAFE_BUFFER_SIZE]; SUBCASE("Fill with zeros") { - for (auto i = 0u; i < sizeof(inplace) - 2; ++i) { + for (auto i{ 0u }; i < sizeof(inplace) - 2; ++i) { fill_inplace(inplace, i, 0x00); verify_encode_inplace(inplace, i); } } SUBCASE("Fill with nonzeros") { - for (auto i = 0u; i < sizeof(inplace) - 2; ++i) { + for (auto i{ 0u }; i < sizeof(inplace) - 2; ++i) { fill_inplace(inplace, i, 0x01); verify_encode_inplace(inplace, i); } } SUBCASE("Fill with 0xFF") { - for (auto i = 0u; i < sizeof(inplace) - 2; ++i) { + for (auto i{ 0u }; i < sizeof(inplace) - 2; ++i) { fill_inplace(inplace, i, 0xFF); verify_encode_inplace(inplace, i); } } SUBCASE("Fill with zero/one pattern") { - for (auto i = 0u; i < sizeof(inplace) - 2; ++i) { + for (auto i{ 0u }; i < sizeof(inplace) - 2; ++i) { inplace[0] = COBS_TINYFRAME_SENTINEL_VALUE; - for (auto j = 1u; j < i; ++j) { + for (auto j{ 1u }; j < i; ++j) { inplace[j] = j & 1; } inplace[i + 1] = COBS_TINYFRAME_SENTINEL_VALUE; @@ -180,9 +180,9 @@ TEST_CASE("Encode: Inplace == External") { } SUBCASE("Fill with one/zero pattern") { - for (auto i = 0u; i < sizeof(inplace) - 2; ++i) { + for (auto i{ 0u }; i < sizeof(inplace) - 2; ++i) { inplace[0] = COBS_TINYFRAME_SENTINEL_VALUE; - for (auto j = 1u; j < i; ++j) { + for (auto j{ 1u }; j < i; ++j) { inplace[j] = (j & 1) ^ 1; } inplace[i + 1] = COBS_TINYFRAME_SENTINEL_VALUE;