Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing [[maybe_unused]] annotations in unit tests #33007

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions examples/platform/silabs/SoftwareFaultReports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString)
extern "C" __attribute__((used)) void debugHardfault(uint32_t * sp)
{
#if SILABS_LOG_ENABLED
uint32_t cfsr = SCB->CFSR;
uint32_t hfsr = SCB->HFSR;
uint32_t mmfar = SCB->MMFAR;
uint32_t bfar = SCB->BFAR;
uint32_t r0 = sp[0];
uint32_t r1 = sp[1];
uint32_t r2 = sp[2];
uint32_t r3 = sp[3];
uint32_t r12 = sp[4];
uint32_t lr = sp[5];
uint32_t pc = sp[6];
uint32_t psr = sp[7];
[[maybe_unused]] uint32_t cfsr = SCB->CFSR;
lpbeliveau-silabs marked this conversation as resolved.
Show resolved Hide resolved
[[maybe_unused]] uint32_t hfsr = SCB->HFSR;
[[maybe_unused]] uint32_t mmfar = SCB->MMFAR;
[[maybe_unused]] uint32_t bfar = SCB->BFAR;
[[maybe_unused]] uint32_t r0 = sp[0];
[[maybe_unused]] uint32_t r1 = sp[1];
[[maybe_unused]] uint32_t r2 = sp[2];
[[maybe_unused]] uint32_t r3 = sp[3];
[[maybe_unused]] uint32_t r12 = sp[4];
[[maybe_unused]] uint32_t lr = sp[5];
[[maybe_unused]] uint32_t pc = sp[6];
[[maybe_unused]] uint32_t psr = sp[7];

ChipLogError(NotSpecified, "HardFault:");
ChipLogError(NotSpecified, "SCB->CFSR 0x%08lx", cfsr);
Expand Down
8 changes: 4 additions & 4 deletions src/crypto/tests/TestChipCryptoPAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ static void TestRawIntegerToDerInvalidCases(nlTestSuite * inSuite, void * inCont
{ .input = bad_buffer_empty, .output = good_out_buffer, .expected_status = CHIP_ERROR_INVALID_ARGUMENT }
};

int case_idx = 0;
[[maybe_unused]] int case_idx = 0;
for (const ErrorCase & v : error_cases)
{
CHIP_ERROR status = ConvertIntegerRawToDerWithoutTag(v.input, v.output);
Expand Down Expand Up @@ -704,7 +704,7 @@ static void TestReadDerLengthValidCases(nlTestSuite * inSuite, void * inContext)
{ .input_buf = max_byte_length_large_buf, .expected_length = SIZE_MAX },
};

int case_idx = 0;
[[maybe_unused]] int case_idx = 0;
for (const SuccessCase & v : cases)
{
size_t output_length = SIZE_MAX - 1;
Expand Down Expand Up @@ -768,7 +768,7 @@ static void TestReadDerLengthInvalidCases(nlTestSuite * inSuite, void * inContex
{ .input_buf = max_byte_length_large_insufficient_bytes_buf, .expected_status = CHIP_ERROR_BUFFER_TOO_SMALL },
};

int case_idx = 0;
[[maybe_unused]] int case_idx = 0;
for (const ErrorCase & v : error_cases)
{
size_t output_length = SIZE_MAX;
Expand Down Expand Up @@ -2135,7 +2135,7 @@ static void TestX509_VerifyAttestationCertificateFormat(nlTestSuite * inSuite, v
};
// clang-format on

int case_idx = 0;
[[maybe_unused]] int case_idx = 0;
for (auto & testCase : sValidationTestCases)
{
ByteSpan cert = testCase.cert;
Expand Down
Loading