Skip to content

Commit

Permalink
CheckWriteRead should fail if payloadBase38Representation fails to pa…
Browse files Browse the repository at this point in the history
…rse the QRCode (#27554)

* CheckWriteRead should fail if payloadBase38Representation fails to parse the QRCode

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 29, 2024
1 parent 7c99e89 commit 4399491
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/setup_payload/tests/TestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ inline bool CheckWriteRead(SetupPayload & inPayload, bool allowInvalidPayload =
memset(optionalInfo, 0xFF, sizeof(optionalInfo));
auto generator = QRCodeSetupPayloadGenerator(inPayload);
generator.SetAllowInvalidPayload(allowInvalidPayload);
generator.payloadBase38Representation(result, optionalInfo, sizeof(optionalInfo));
CHIP_ERROR err = generator.payloadBase38Representation(result, optionalInfo, sizeof(optionalInfo));

if (err != CHIP_NO_ERROR)
{
return false;
}

outPayload = {};
QRCodeSetupPayloadParser(result).populatePayload(outPayload);
Expand Down

0 comments on commit 4399491

Please sign in to comment.