Skip to content

Commit 987e4f4

Browse files
committed
Attempt to fix satinizer error in unittesting.
1 parent b7c721d commit 987e4f4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

comms/include/comms/protocol/ChecksumPrefixLayer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ class ChecksumPrefixLayer : public
225225
using IterType = typename std::decay<decltype(iter)>::type;
226226
using Tag = typename std::iterator_traits<IterType>::iterator_category;
227227

228-
auto& thisObj = BaseImpl::thisLayer();
229-
thisObj.prepareFieldForWrite(0, &msg, field);
230228
return writeInternal(field, msg, iter, size, std::forward<TNextLayerWriter>(nextLayerWriter), Tag());
231229
}
232230

@@ -511,6 +509,7 @@ class ChecksumPrefixLayer : public
511509
{
512510
auto& thisObj = BaseImpl::thisLayer();
513511
auto checksumIter = iter;
512+
thisObj.prepareFieldForWrite(0U, &msg, field);
514513
auto es = thisObj.writeField(&msg, field, iter, size);
515514
if (es != comms::ErrorStatus::Success) {
516515
return es;
@@ -556,6 +555,7 @@ class ChecksumPrefixLayer : public
556555
TWriter&& nextLayerWriter) const
557556
{
558557
auto& thisObj = BaseImpl::thisLayer();
558+
thisObj.prepareFieldForWrite(0U, &msg, field);
559559
auto es = thisObj.writeField(&msg, field, iter, size);
560560
if (es != comms::ErrorStatus::Success) {
561561
return es;

comms/test/ChecksumPrefixLayer.th

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,12 @@ void ChecksumPrefixLayerTestSuite::test7()
458458
void ChecksumPrefixLayerTestSuite::test8()
459459
{
460460
static const char Buf[] = {
461-
static_cast<char>(0xab), static_cast<char>(0xcd), 0x06, 0x0, 0x3, MessageType1, 0x01, 0x02, static_cast<char>(0x3f)
461+
static_cast<char>(0xab), static_cast<char>(0xcd), // sync
462+
0x06, // checksum
463+
0x0, 0x3, // size
464+
MessageType1, // id
465+
0x01, 0x02, //data
466+
static_cast<char>(0x3f) // garbage
462467
};
463468

464469
static const std::size_t BufSize = std::extent<decltype(Buf)>::value;

0 commit comments

Comments
 (0)