From 90040096dd5bbc4dbc0c4ee47d8a92577def4e4e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 15 Aug 2023 12:14:11 +1000 Subject: [PATCH] test: rename a variable to avoid clashes Future changes will use slen further below because it's the best name, so let's rename this one since it's less impactful. --- src/brei-shared.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/brei-shared.c b/src/brei-shared.c index 414649e..faa378d 100644 --- a/src/brei-shared.c +++ b/src/brei-shared.c @@ -647,10 +647,10 @@ MUNIT_TEST(test_brei_send_message) { const char string[12] = "hello wor"; /* tests padding too */ - int slen = bytes_to_int32(strlen0(string)) * 4; - munit_assert_int(slen, ==, sizeof(string)); + uint32_t string_len = bytes_to_int32(strlen0(string)) * 4; + munit_assert_int(string_len, ==, sizeof(string)); - const int msglen = header_size + 24 + slen; /* 4 bytes + 2 * 8 bytes + string length */ + const int msglen = header_size + 24 + string_len; /* 4 bytes + 2 * 8 bytes + string length */ object_id_t id = 2; uint32_t opcode = 3; const char *signature = "ison"; @@ -677,8 +677,8 @@ MUNIT_TEST(test_brei_send_message) munit_assert_string_equal(s->str, string); munit_assert_int(memcmp(s->str, string, brei_string_proto_length(s->len) - 4), ==, 0); - munit_assert_int(buf[6 + slen/4], ==, 0xab); - munit_assert_int(buf[8 + slen/4], ==, 0xcdef); + munit_assert_int(buf[6 + string_len/4], ==, 0xab); + munit_assert_int(buf[8 + string_len/4], ==, 0xcdef); } {