Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesnicholson committed Dec 30, 2023
1 parent 3271e9a commit 80146c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/test_cobs_decode_inc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cobs_decode_inplace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cobs_encode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<unsigned>(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);
Expand Down

0 comments on commit 80146c7

Please sign in to comment.