From 938279e0e0d30bc95ef6130712e7a3759e4d1b72 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 16 May 2022 13:43:17 -0600 Subject: [PATCH] Fix #2103, Resolve UT buffer underflow warning --- modules/cfe_testcase/src/es_counter_test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/cfe_testcase/src/es_counter_test.c b/modules/cfe_testcase/src/es_counter_test.c index 6e1f70558..55c37ade1 100644 --- a/modules/cfe_testcase/src/es_counter_test.c +++ b/modules/cfe_testcase/src/es_counter_test.c @@ -62,6 +62,13 @@ void TestCounterCreateDelete(void) CFE_Assert_STATUS_MAY_BE(CFE_SUCCESS); } + /* If no counters were available skip the rest of the test */ + if (NumCounters == 0) + { + UtAssert_MIR("No ES generic counters available for testing, skipping"); + return; + } + /* Confirm that the expected number of counters were created */ UtAssert_UINT32_LTEQ(NumCounters, CFE_PLATFORM_ES_MAX_GEN_COUNTERS);