diff --git a/tests/test_cobs_decode_inc.cc b/tests/test_cobs_decode_inc.cc index d5ca694..d0cc0ca 100644 --- a/tests/test_cobs_decode_inc.cc +++ b/tests/test_cobs_decode_inc.cc @@ -24,7 +24,7 @@ TEST_CASE("cobs_decode_inc") { .dst = dec.data(), .src_max = enc.size(), .dst_max = dec.size() }; - size_t enc_len, dec_len; + size_t enc_len{ 0u }, dec_len{ 0u }; bool done{ false }; SUBCASE("bad args") { @@ -65,7 +65,7 @@ TEST_CASE("cobs_decode_inc") { REQUIRE(enc_len <= COBS_ENCODE_MAX(dec_len)); byte_vec_t oneshot(enc.size()); - size_t oneshot_len; + size_t oneshot_len{ 0u }; REQUIRE( cobs_decode(enc.data(), enc_len, oneshot.data(), oneshot.size(), &oneshot_len) == COBS_RET_SUCCESS); @@ -78,7 +78,7 @@ TEST_CASE("cobs_decode_inc") { args.src_max = 1; args.dst_max = 1; - size_t this_enc_len, this_dec_len; + size_t this_enc_len{ 0u }, this_dec_len{ 0u }; REQUIRE_MESSAGE(cobs_decode_inc(&ctx, &args, &this_enc_len, &this_dec_len, &done) == COBS_RET_SUCCESS, cur_dec); diff --git a/tests/test_cobs_decode_inplace.cc b/tests/test_cobs_decode_inplace.cc index a9819aa..b690dbc 100644 --- a/tests/test_cobs_decode_inplace.cc +++ b/tests/test_cobs_decode_inplace.cc @@ -114,7 +114,7 @@ TEST_CASE("Inplace decoding") { namespace { void verify_decode_inplace(unsigned char *inplace, size_t payload_len) { byte_vec_t external(std::max(payload_len, size_t(1))); - size_t external_len; + size_t external_len{ 0u }; REQUIRE_MESSAGE(cobs_decode(inplace, payload_len + 2, external.data(), diff --git a/tests/test_cobs_encode.cc b/tests/test_cobs_encode.cc index eefa20b..a9e47d2 100644 --- a/tests/test_cobs_encode.cc +++ b/tests/test_cobs_encode.cc @@ -26,7 +26,7 @@ TEST_CASE("Encoding validation") { TEST_CASE("Simple encodings") { byte_t dec[16], enc[16]; - size_t enc_len; + size_t enc_len{ 0u }; SUBCASE("Empty") { REQUIRE(cobs_encode(&dec, 0, enc, sizeof(enc), &enc_len) == COBS_RET_SUCCESS); @@ -94,7 +94,7 @@ TEST_CASE("Simple encodings") { namespace { byte_vec_t encode(byte_vec_t const &decoded) { byte_vec_t enc(COBS_ENCODE_MAX(static_cast(decoded.size()))); - size_t enc_len; + size_t enc_len{ 0u }; REQUIRE(cobs_encode(decoded.data(), decoded.size(), enc.data(), enc.size(), &enc_len) == COBS_RET_SUCCESS); return byte_vec_t(enc.data(), enc.data() + enc_len);