Skip to content

Commit

Permalink
Unit-test and CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Feb 27, 2025
1 parent c78b6f7 commit 1928a00
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Fw/Logger/test/ut/LoggerRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bool LogGoodStringObject::precondition(const MockLogging::FakeLogger& truth) {
void LogGoodStringObject::action(MockLogging::FakeLogger& truth) {
Fw::String my_string;
U32 random = STest::Pick::lowerUpper(0, my_string.getCapacity() - 1);
for (int i = 0; i < random; ++i) {
for (U32 i = 0; i < random; ++i) {
const_cast<char*>(my_string.toChar())[i] =
static_cast<char>(STest::Pick::lowerUpper(0, std::numeric_limits<unsigned char>::max()));
}
Expand Down
2 changes: 1 addition & 1 deletion Fw/Types/test/ut/TypesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ TEST(PerformanceTest, F64SerPerfTest) {

timer.stop();

printf("%d iterations took %d us (%f us each).\n", iters, timer.getDiffUsec(),
printf("%" PRI_FwSizeType " iterations took %d us (%f us each).\n", iters, timer.getDiffUsec(),
static_cast<F32>(timer.getDiffUsec()) / static_cast<F32>(iters));
}

Expand Down
2 changes: 1 addition & 1 deletion Os/test/ut/OsValidateFileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void testValidateFile(const char* fileName) {
return;
}
Utils::HashBuffer buf;
EXPECT_TRUE(fileSize == buf.getBuffCapacity());
EXPECT_TRUE(static_cast<FwSizeType>(fileSize) == buf.getBuffCapacity());

// Validate file:
printf("Validating file %s against hash file %s\n", fileName, hashFileName);
Expand Down
10 changes: 5 additions & 5 deletions Svc/BufferManager/test/ut/BufferManagerTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class TestAllocator: public Fw::MemAllocator {
* \return the pointer to memory. Zero if unable to allocate.
*/
void *allocate(
const NATIVE_UINT_TYPE identifier,
NATIVE_UINT_TYPE &size,
const FwEnumStoreType identifier,
FwSizeType &size,
bool& recoverable) {
this->m_reqId = identifier;
this->m_reqSize = size;
Expand All @@ -58,7 +58,7 @@ class TestAllocator: public Fw::MemAllocator {
* \ptr the pointer to memory returned by allocate()
*/
void deallocate(
const NATIVE_UINT_TYPE identifier,
const FwEnumStoreType identifier,
void* ptr) {
this->m_alloc.deallocate(identifier,ptr);
}
Expand All @@ -77,8 +77,8 @@ class TestAllocator: public Fw::MemAllocator {

private:
Fw::MallocAllocator m_alloc;
NATIVE_UINT_TYPE m_reqId;
NATIVE_UINT_TYPE m_reqSize;
FwEnumStoreType m_reqId;
FwSizeType m_reqSize;
void* m_mem;

};
Expand Down
2 changes: 1 addition & 1 deletion Svc/CmdSequencer/test/ut/SequenceFiles/Buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Svc {

namespace Buffers {

NATIVE_UINT_TYPE FileBuffer ::
FwSizeType FileBuffer ::
getBuffCapacity() const
{
return sizeof(m_buff);
Expand Down
2 changes: 1 addition & 1 deletion Svc/CmdSequencer/test/ut/SequenceFiles/Buffers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Svc {

public:

NATIVE_UINT_TYPE getBuffCapacity() const;
FwSizeType getBuffCapacity() const;

U8* getBuffAddr();

Expand Down
2 changes: 1 addition & 1 deletion Svc/ComLogger/ComLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ namespace Svc {
serialLength.serialize(size);
if(this->writeToFile(serialLength.getBuffAddr(),
static_cast<U16>(serialLength.getBuffLength()))) {
this->m_byteCount += serialLength.getBuffLength();
this->m_byteCount += static_cast<U32>(serialLength.getBuffLength());
}
else {
return;
Expand Down

0 comments on commit 1928a00

Please sign in to comment.