diff --git a/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.cpp b/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.cpp index 3fa70f27f6..b820230b0d 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.cpp @@ -37,16 +37,16 @@ IndirectBuffer::~IndirectBuffer(void) { delete m_IndirectBuf; } -void IndirectBuffer::AddPacket(const BasePacket &packet) { - ASSERT_EQ(packet.PacketType(), m_PacketTypeAllowed) << "Cannot add a packet since packet type doesn't match queue"; +uint32_t *IndirectBuffer::AddPacket(const BasePacket &packet) { + EXPECT_EQ(packet.PacketType(), m_PacketTypeAllowed) << "Cannot add a packet since packet type doesn't match queue"; unsigned int writePtr = m_ActualSize; - ASSERT_GE(m_MaxSize, packet.SizeInDWords() + writePtr) << "Cannot add a packet, not enough room"; + EXPECT_GE(m_MaxSize, packet.SizeInDWords() + writePtr) << "Cannot add a packet, not enough room"; memcpy(m_IndirectBuf->As() + writePtr , packet.GetPacket(), packet.SizeInBytes()); m_ActualSize += packet.SizeInDWords(); m_NumOfPackets++; + + return m_IndirectBuf->As() + writePtr; } - - diff --git a/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.hpp b/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.hpp index c049402558..debf96c62a 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.hpp +++ b/projects/rocr-runtime/tests/kfdtest/src/IndirectBuffer.hpp @@ -39,7 +39,7 @@ class IndirectBuffer { ~IndirectBuffer(void); // @brief Add packet to queue, all validations are done with gtest ASSERT and EXPECT - void AddPacket(const BasePacket &packet); + uint32_t *AddPacket(const BasePacket &packet); // @returns Actual size of the indirect queue in DWords, equivalent to write pointer unsigned int SizeInDWord() { return m_ActualSize; } // @returns Indirect queue address