Skip to content

Fix accumulation of failure descriptions and error codes in UpdateDes…#57

Merged
peterbarancek merged 1 commit into
devfrom
54-_BUG_UpdateComprehensiveResult_overwrites_failure_description_instead_of_accumulating_it_upd
Jun 8, 2026
Merged

Fix accumulation of failure descriptions and error codes in UpdateDes…#57
peterbarancek merged 1 commit into
devfrom
54-_BUG_UpdateComprehensiveResult_overwrites_failure_description_instead_of_accumulating_it_upd

Conversation

@peterbarancek
Copy link
Copy Markdown
Collaborator

…criptions method

Copilot AI review requested due to automatic review settings June 8, 2026 09:07
@peterbarancek peterbarancek merged commit ad9110a into dev Jun 8, 2026
1 check failed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent incorrect accumulation/formatting of failure descriptions and error codes when TcoInspectionGroup updates its comprehensive result, and adjusts PLC unit tests to ensure failure/error strings are cleared between tests.

Changes:

  • Updated TcoInspectionGroup.UpdateComprehensiveResult to avoid prepending a separator when appending failures/error codes to an empty overall result.
  • Updated unit test setup to clear Failures and ErrorCodes fields to avoid cross-test contamination.
  • Added an assertion to verify the overall failures string starts empty before running the description update scenario.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/TcoInspectors/tests/PlcUnitTests/TcoInspectionGroupTests.cs Clears overall result failure/error strings in [SetUp] and adds an assertion to catch unexpected pre-population.
src/TcoInspectors/src/XAE/XAE/TcoInspectors/POUs/TcoInspectionGroup/TcoInspectionGroup.TcPOU Adjusts how failures/error codes are appended during comprehensive result updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +545 to +555
IF _refOverallResult.Failures<>'' THEN
_refOverallResult.Failures := concat(concat(_refOverallResult.Failures,';'), _currentRunResult.Failures);
ELSE
_refOverallResult.Failures := _currentRunResult.Failures;
END_IF;

IF _refOverallResult.ErrorCodes<>'' THEN
_refOverallResult.ErrorCodes := concat(concat(_refOverallResult.ErrorCodes,';'),_currentRunResult.ErrorCodes);
ELSE
_refOverallResult.ErrorCodes := _currentRunResult.ErrorCodes;
END_IF;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants