Skip to content

Commit

Permalink
Minor CRC unit test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Feb 8, 2024
1 parent 88d6667 commit 1219d21
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Os/test/ut/file/MyRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ void Os::Test::File::Tester::shadow_flush() {

void Os::Test::File::Tester::shadow_crc(U32& crc) {
crc = this->m_independent_crc;
SyntheticFileData data = *reinterpret_cast<SyntheticFileData*>(this->m_shadow.getHandle());
SyntheticFileData& data = *reinterpret_cast<SyntheticFileData*>(this->m_shadow.getHandle());

// Calculate CRC on full file starting at m_pointer
for (FwSizeType i = data.m_pointer; i < data.m_data.size(); i++) {
for (FwSizeType i = data.m_pointer; i < data.m_data.size(); i++, this->m_shadow.seek(1, Os::File::SeekType::RELATIVE)) {
crc = update_crc_32(crc, static_cast<char>(data.m_data.at(i)));
}
// Update tracking variables
this->m_independent_crc = Os::File::INITIAL_CRC;
this->m_shadow.seek(data.m_data.size(), Os::File::SeekType::ABSOLUTE);
}

void Os::Test::File::Tester::shadow_partial_crc(FwSignedSizeType& size) {
Expand Down

0 comments on commit 1219d21

Please sign in to comment.