From d615791f0cc48bda5ed3112df7213ffac3af5022 Mon Sep 17 00:00:00 2001 From: Mishaal Aleem Date: Mon, 23 Jun 2025 13:48:49 -0700 Subject: [PATCH 1/2] Updates for Svc/BufferAccumulator corresponding to UT cmake udpate for protected/private --- Svc/BufferAccumulator/test/ut/Accumulate.cpp | 8 +++--- .../test/ut/BufferAccumulatorTester.cpp | 4 +++ .../test/ut/BufferAccumulatorTester.hpp | 8 ++++++ Svc/BufferAccumulator/test/ut/Drain.cpp | 24 ++++++++--------- Svc/BufferAccumulator/test/ut/Errors.cpp | 27 +++++++++---------- Svc/BufferAccumulator/test/ut/Health.cpp | 2 +- 6 files changed, 42 insertions(+), 31 deletions(-) diff --git a/Svc/BufferAccumulator/test/ut/Accumulate.cpp b/Svc/BufferAccumulator/test/ut/Accumulate.cpp index b78f9170911..6efeb791ccd 100644 --- a/Svc/BufferAccumulator/test/ut/Accumulate.cpp +++ b/Svc/BufferAccumulator/test/ut/Accumulate.cpp @@ -23,7 +23,7 @@ namespace Accumulate { void BufferAccumulatorTester ::OK() { ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); @@ -35,12 +35,12 @@ void BufferAccumulatorTester ::OK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::DRAIN); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(1); ASSERT_from_bufferSendOutDrain_SIZE(1); @@ -49,7 +49,7 @@ void BufferAccumulatorTester ::OK() { U32 expectedNumBuffers = 1; for (U32 i = 0; i < MAX_NUM_BUFFERS; ++i) { this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ++expectedNumBuffers; if (i + 1 < MAX_NUM_BUFFERS) { ++expectedNumBuffers; diff --git a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp index 8850e4d6696..8dc056f725a 100644 --- a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp +++ b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp @@ -130,4 +130,8 @@ void BufferAccumulatorTester ::initComponents() { this->component.init(QUEUE_DEPTH, INSTANCE); } +void BufferAccumulatorTester ::dispatchOne() { + this->component.doDispatch(); +} + } // end namespace Svc diff --git a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp index a115de6e778..500fe5651d8 100644 --- a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp +++ b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp @@ -81,6 +81,14 @@ class BufferAccumulatorTester : public BufferAccumulatorGTestBase { //! Whether to allocate/deallocate a queue for the user bool doAllocateQueue; + + + // ---------------------------------------------------------------------- + // Methods + // ---------------------------------------------------------------------- + + //! Helper method to call doDispatch + void dispatchOne(void); }; } // end namespace Svc diff --git a/Svc/BufferAccumulator/test/ut/Drain.cpp b/Svc/BufferAccumulator/test/ut/Drain.cpp index d96d2ad36a9..3a9c2baab71 100644 --- a/Svc/BufferAccumulator/test/ut/Drain.cpp +++ b/Svc/BufferAccumulator/test/ut/Drain.cpp @@ -35,11 +35,11 @@ void BufferAccumulatorTester ::OK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_from_bufferSendOutDrain_SIZE(i + 1); ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); } @@ -48,7 +48,7 @@ void BufferAccumulatorTester ::OK() { void BufferAccumulatorTester ::PartialDrainOK() { this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_CMD_RESPONSE_SIZE(1); ASSERT_CMD_RESPONSE(0, BufferAccumulator::OPCODE_BA_SETMODE, 0, Fw::CmdResponse::OK); @@ -63,10 +63,10 @@ void BufferAccumulatorTester ::PartialDrainOK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(i + 1); ASSERT_EVENTS_BA_PartialDrainDone(i, 1u); // + 1 for first BufferAccumulator_OpState::ACCUMULATE command; + 1 for @@ -79,7 +79,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(i + 1); @@ -99,7 +99,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } @@ -108,7 +108,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain_SIZE(i); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_CMD_RESPONSE_SIZE(i + 1); ASSERT_CMD_RESPONSE(i, BufferAccumulator::OPCODE_BA_DRAINBUFFERS, 0, Fw::CmdResponse::OK); @@ -121,7 +121,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain_SIZE(i + 1); ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(i + 1); @@ -140,7 +140,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } @@ -152,7 +152,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_EVENTS_BA_PartialDrainDone_SIZE(0); this->sendCmd_BA_DrainBuffers(0, 0, MAX_NUM_BUFFERS, BufferAccumulator_BlockMode::BLOCK); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_CMD_RESPONSE_SIZE(0); for (U32 i = 0; i < MAX_NUM_BUFFERS; ++i) { @@ -170,7 +170,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain_SIZE(i + 1); ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); } diff --git a/Svc/BufferAccumulator/test/ut/Errors.cpp b/Svc/BufferAccumulator/test/ut/Errors.cpp index 275028c0077..14958f13dbf 100644 --- a/Svc/BufferAccumulator/test/ut/Errors.cpp +++ b/Svc/BufferAccumulator/test/ut/Errors.cpp @@ -23,7 +23,7 @@ namespace Errors { void BufferAccumulatorTester ::PartialDrain() { ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->component.doDispatch(); // will fail - we are still in + this->dispatchOne(); // will fail - we are still in // BufferAccumulator_OpState::DRAIN mode ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); @@ -32,12 +32,12 @@ void BufferAccumulatorTester ::PartialDrain() { ASSERT_EQ(0u, this->component.m_numToDrain); this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); this->sendCmd_BA_DrainBuffers(0, 0, 10, BufferAccumulator_BlockMode::BLOCK); - this->component.doDispatch(); // will succeed - now we are in ACCUMULATE + this->dispatchOne(); // will succeed - now we are in ACCUMULATE ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE( 0); // would be first buffer out, but we are empty @@ -49,8 +49,7 @@ void BufferAccumulatorTester ::PartialDrain() { ASSERT_EQ(10u, this->component.m_numToDrain); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->component - .doDispatch(); // will fail - we are still doing a partial drain + this->dispatchOne(); // will fail - we are still doing a partial drain ASSERT_EVENTS_BA_StillDraining_SIZE(1); ASSERT_EVENTS_BA_StillDraining(0, 0u, 10u); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(0); // partial drain not done @@ -69,57 +68,57 @@ void BufferAccumulatorTester ::QueueFull() { // Go to Accumulate mode ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); // Fill up the buffer queue for (U32 i = 0; i < MAX_NUM_BUFFERS; ++i) { this->invoke_to_bufferSendInFill(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } // Send another buffer and expect an event this->invoke_to_bufferSendInFill(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_SIZE(1); ASSERT_EVENTS_BA_QueueFull_SIZE(1); // Send another buffer and expect no new event this->invoke_to_bufferSendInFill(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_SIZE(1); // Drain one buffer this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::DRAIN); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_FROM_PORT_HISTORY_SIZE(1); ASSERT_from_bufferSendOutDrain_SIZE(1); ASSERT_from_bufferSendOutDrain(0, buffer); // Send another buffer and expect an event this->invoke_to_bufferSendInFill(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_SIZE(2); ASSERT_EVENTS_BA_BufferAccepted_SIZE(1); // Return the original buffer in order to drain one buffer this->invoke_to_bufferSendInReturn(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_FROM_PORT_HISTORY_SIZE(3); ASSERT_from_bufferSendOutDrain_SIZE(2); ASSERT_from_bufferSendOutDrain(1, buffer); // Send another buffer and expect no new event this->invoke_to_bufferSendInFill(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_SIZE(2); ASSERT_EVENTS_BA_BufferAccepted_SIZE(1); // Send another buffer and expect an event this->invoke_to_bufferSendInFill(0, buffer); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_SIZE(3); ASSERT_EVENTS_BA_QueueFull_SIZE(2); diff --git a/Svc/BufferAccumulator/test/ut/Health.cpp b/Svc/BufferAccumulator/test/ut/Health.cpp index dcb2dbeedc8..c20492df46d 100644 --- a/Svc/BufferAccumulator/test/ut/Health.cpp +++ b/Svc/BufferAccumulator/test/ut/Health.cpp @@ -20,7 +20,7 @@ void BufferAccumulatorTester ::Ping() { U32 key = 42; this->invoke_to_pingIn(0, key); - this->component.doDispatch(); + this->dispatchOne(); ASSERT_EVENTS_SIZE(0); ASSERT_from_pingOut_SIZE(1); From 84efc36213b2328be52185569583ae4055d351f5 Mon Sep 17 00:00:00 2001 From: Mishaal Aleem Date: Tue, 24 Jun 2025 11:28:16 -0700 Subject: [PATCH 2/2] Rename dispatchOne to doDispatch for consistency --- Svc/BufferAccumulator/test/ut/Accumulate.cpp | 8 +++--- .../test/ut/BufferAccumulatorTester.cpp | 2 +- .../test/ut/BufferAccumulatorTester.hpp | 2 +- Svc/BufferAccumulator/test/ut/Drain.cpp | 24 ++++++++--------- Svc/BufferAccumulator/test/ut/Errors.cpp | 26 +++++++++---------- Svc/BufferAccumulator/test/ut/Health.cpp | 2 +- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Svc/BufferAccumulator/test/ut/Accumulate.cpp b/Svc/BufferAccumulator/test/ut/Accumulate.cpp index 6efeb791ccd..367facc5bd8 100644 --- a/Svc/BufferAccumulator/test/ut/Accumulate.cpp +++ b/Svc/BufferAccumulator/test/ut/Accumulate.cpp @@ -23,7 +23,7 @@ namespace Accumulate { void BufferAccumulatorTester ::OK() { ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->dispatchOne(); + this->doDispatch(); ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); @@ -35,12 +35,12 @@ void BufferAccumulatorTester ::OK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::DRAIN); - this->dispatchOne(); + this->doDispatch(); ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(1); ASSERT_from_bufferSendOutDrain_SIZE(1); @@ -49,7 +49,7 @@ void BufferAccumulatorTester ::OK() { U32 expectedNumBuffers = 1; for (U32 i = 0; i < MAX_NUM_BUFFERS; ++i) { this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ++expectedNumBuffers; if (i + 1 < MAX_NUM_BUFFERS) { ++expectedNumBuffers; diff --git a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp index 8dc056f725a..27fc08559d6 100644 --- a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp +++ b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.cpp @@ -130,7 +130,7 @@ void BufferAccumulatorTester ::initComponents() { this->component.init(QUEUE_DEPTH, INSTANCE); } -void BufferAccumulatorTester ::dispatchOne() { +void BufferAccumulatorTester ::doDispatch() { this->component.doDispatch(); } diff --git a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp index 500fe5651d8..71f426662d2 100644 --- a/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp +++ b/Svc/BufferAccumulator/test/ut/BufferAccumulatorTester.hpp @@ -88,7 +88,7 @@ class BufferAccumulatorTester : public BufferAccumulatorGTestBase { // ---------------------------------------------------------------------- //! Helper method to call doDispatch - void dispatchOne(void); + void doDispatch(void); }; } // end namespace Svc diff --git a/Svc/BufferAccumulator/test/ut/Drain.cpp b/Svc/BufferAccumulator/test/ut/Drain.cpp index 3a9c2baab71..20b7a7cdae4 100644 --- a/Svc/BufferAccumulator/test/ut/Drain.cpp +++ b/Svc/BufferAccumulator/test/ut/Drain.cpp @@ -35,11 +35,11 @@ void BufferAccumulatorTester ::OK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_from_bufferSendOutDrain_SIZE(i + 1); ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); } @@ -48,7 +48,7 @@ void BufferAccumulatorTester ::OK() { void BufferAccumulatorTester ::PartialDrainOK() { this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->dispatchOne(); + this->doDispatch(); ASSERT_CMD_RESPONSE_SIZE(1); ASSERT_CMD_RESPONSE(0, BufferAccumulator::OPCODE_BA_SETMODE, 0, Fw::CmdResponse::OK); @@ -63,10 +63,10 @@ void BufferAccumulatorTester ::PartialDrainOK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(i + 1); ASSERT_EVENTS_BA_PartialDrainDone(i, 1u); // + 1 for first BufferAccumulator_OpState::ACCUMULATE command; + 1 for @@ -79,7 +79,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(i + 1); @@ -99,7 +99,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } @@ -108,7 +108,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain_SIZE(i); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->dispatchOne(); + this->doDispatch(); ASSERT_CMD_RESPONSE_SIZE(i + 1); ASSERT_CMD_RESPONSE(i, BufferAccumulator::OPCODE_BA_DRAINBUFFERS, 0, Fw::CmdResponse::OK); @@ -121,7 +121,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain_SIZE(i + 1); ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(i + 1); @@ -140,7 +140,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { Fw::Buffer b(data, size, bufferID); buffers[i] = b; this->invoke_to_bufferSendInFill(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } @@ -152,7 +152,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_EVENTS_BA_PartialDrainDone_SIZE(0); this->sendCmd_BA_DrainBuffers(0, 0, MAX_NUM_BUFFERS, BufferAccumulator_BlockMode::BLOCK); - this->dispatchOne(); + this->doDispatch(); ASSERT_CMD_RESPONSE_SIZE(0); for (U32 i = 0; i < MAX_NUM_BUFFERS; ++i) { @@ -170,7 +170,7 @@ void BufferAccumulatorTester ::PartialDrainOK() { ASSERT_from_bufferSendOutDrain_SIZE(i + 1); ASSERT_from_bufferSendOutDrain(i, buffers[i]); this->invoke_to_bufferSendInReturn(0, buffers[i]); - this->dispatchOne(); + this->doDispatch(); ASSERT_from_bufferSendOutReturn(i, buffers[i]); } diff --git a/Svc/BufferAccumulator/test/ut/Errors.cpp b/Svc/BufferAccumulator/test/ut/Errors.cpp index 14958f13dbf..7da286e903b 100644 --- a/Svc/BufferAccumulator/test/ut/Errors.cpp +++ b/Svc/BufferAccumulator/test/ut/Errors.cpp @@ -23,7 +23,7 @@ namespace Errors { void BufferAccumulatorTester ::PartialDrain() { ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->dispatchOne(); // will fail - we are still in + this->doDispatch(); // will fail - we are still in // BufferAccumulator_OpState::DRAIN mode ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); @@ -32,12 +32,12 @@ void BufferAccumulatorTester ::PartialDrain() { ASSERT_EQ(0u, this->component.m_numToDrain); this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->dispatchOne(); + this->doDispatch(); ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); this->sendCmd_BA_DrainBuffers(0, 0, 10, BufferAccumulator_BlockMode::BLOCK); - this->dispatchOne(); // will succeed - now we are in ACCUMULATE + this->doDispatch(); // will succeed - now we are in ACCUMULATE ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE( 0); // would be first buffer out, but we are empty @@ -49,7 +49,7 @@ void BufferAccumulatorTester ::PartialDrain() { ASSERT_EQ(10u, this->component.m_numToDrain); this->sendCmd_BA_DrainBuffers(0, 0, 1, BufferAccumulator_BlockMode::BLOCK); - this->dispatchOne(); // will fail - we are still doing a partial drain + this->doDispatch(); // will fail - we are still doing a partial drain ASSERT_EVENTS_BA_StillDraining_SIZE(1); ASSERT_EVENTS_BA_StillDraining(0, 0u, 10u); ASSERT_EVENTS_BA_PartialDrainDone_SIZE(0); // partial drain not done @@ -68,57 +68,57 @@ void BufferAccumulatorTester ::QueueFull() { // Go to Accumulate mode ASSERT_EQ(BufferAccumulator_OpState::DRAIN, this->component.m_mode.e); this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::ACCUMULATE); - this->dispatchOne(); + this->doDispatch(); ASSERT_EQ(BufferAccumulator_OpState::ACCUMULATE, this->component.m_mode.e); ASSERT_FROM_PORT_HISTORY_SIZE(0); // Fill up the buffer queue for (U32 i = 0; i < MAX_NUM_BUFFERS; ++i) { this->invoke_to_bufferSendInFill(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_FROM_PORT_HISTORY_SIZE(0); } // Send another buffer and expect an event this->invoke_to_bufferSendInFill(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_SIZE(1); ASSERT_EVENTS_BA_QueueFull_SIZE(1); // Send another buffer and expect no new event this->invoke_to_bufferSendInFill(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_SIZE(1); // Drain one buffer this->sendCmd_BA_SetMode(0, 0, BufferAccumulator_OpState::DRAIN); - this->dispatchOne(); + this->doDispatch(); ASSERT_FROM_PORT_HISTORY_SIZE(1); ASSERT_from_bufferSendOutDrain_SIZE(1); ASSERT_from_bufferSendOutDrain(0, buffer); // Send another buffer and expect an event this->invoke_to_bufferSendInFill(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_SIZE(2); ASSERT_EVENTS_BA_BufferAccepted_SIZE(1); // Return the original buffer in order to drain one buffer this->invoke_to_bufferSendInReturn(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_FROM_PORT_HISTORY_SIZE(3); ASSERT_from_bufferSendOutDrain_SIZE(2); ASSERT_from_bufferSendOutDrain(1, buffer); // Send another buffer and expect no new event this->invoke_to_bufferSendInFill(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_SIZE(2); ASSERT_EVENTS_BA_BufferAccepted_SIZE(1); // Send another buffer and expect an event this->invoke_to_bufferSendInFill(0, buffer); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_SIZE(3); ASSERT_EVENTS_BA_QueueFull_SIZE(2); diff --git a/Svc/BufferAccumulator/test/ut/Health.cpp b/Svc/BufferAccumulator/test/ut/Health.cpp index c20492df46d..05253d3a8e0 100644 --- a/Svc/BufferAccumulator/test/ut/Health.cpp +++ b/Svc/BufferAccumulator/test/ut/Health.cpp @@ -20,7 +20,7 @@ void BufferAccumulatorTester ::Ping() { U32 key = 42; this->invoke_to_pingIn(0, key); - this->dispatchOne(); + this->doDispatch(); ASSERT_EVENTS_SIZE(0); ASSERT_from_pingOut_SIZE(1);