Skip to content

Add inline frame format helpers to C# tests - #114

Merged
rijesha merged 3 commits into
mainfrom
copilot/fix-failing-tests
Dec 20, 2025
Merged

Add inline frame format helpers to C# tests#114
rijesha merged 3 commits into
mainfrom
copilot/fix-failing-tests

Conversation

Copilot AI commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

C# tests failed to compile after #112 removed legacy compatibility layers. The commit added inline frame format helpers to C, C++, TypeScript, and JavaScript tests but missed C#.

Changes

  • Added Fletcher-16 checksum helper - Internal static method for CRC validation
  • Implemented 6 frame format helper classes - BasicDefault, TinyMinimal, BasicExtended, BasicExtendedMultiSystemStream, BasicMinimal, TinyDefault extending FrameFormatBase
  • Created TestCodecHelpers static class - Factory pattern for parser instantiation, encoding, and decoding
  • Updated test runner - Changed references from TestCodec to TestCodecHelpers

Each helper class implements the Encode() and ValidatePacket() methods following the same pattern as other languages:

class BasicDefault : FrameFormatBase
{
    public override byte[] Encode(int msgId, byte[] msgData)
    {
        const int headerSize = 4;
        const int footerSize = 2;
        byte[] buffer = new byte[headerSize + msgData.Length + footerSize];
        buffer[0] = HeaderConstants.BASIC_START_BYTE;
        buffer[1] = HeaderBasic.GetSecondStartByte(1); // DEFAULT = 1
        buffer[2] = (byte)msgData.Length;
        buffer[3] = (byte)msgId;
        // ... payload and CRC
    }
}

Pattern matches C, C++, TypeScript, and JavaScript implementations for consistency.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix failing tests </issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 20, 2025 01:59
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing tests in the project Add inline frame format helpers to C# tests Dec 20, 2025
Copilot AI requested a review from rijesha December 20, 2025 02:04
@rijesha
rijesha marked this pull request as ready for review December 20, 2025 02:37
@rijesha
rijesha merged commit 681cd81 into main Dec 20, 2025
@rijesha
rijesha deleted the copilot/fix-failing-tests branch January 5, 2026 17:15
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.

Fix failing tests

2 participants