Skip to content

Add tests for Ice constants and default values#4373

Merged
bernardnormier merged 2 commits intoicerpc:mainfrom
bernardnormier:ice-const-tests
Apr 6, 2026
Merged

Add tests for Ice constants and default values#4373
bernardnormier merged 2 commits intoicerpc:mainfrom
bernardnormier:ice-const-tests

Conversation

@bernardnormier
Copy link
Copy Markdown
Member

This PR depends on zeroc-ice/ice#5282

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

Adds new generator baseline tests to validate Slice/Ice constant emission and default value initialization behaviors in the generated C# code.

Changes:

  • Introduces a new ConstTests Slice file + NUnit test suite to validate primitive, string (escape sequences), and enum constants (including aliases).
  • Introduces a new DefaultValueTests Slice file + NUnit test suite to validate default values for structs, classes, and exceptions (including defaults sourced from constants).
  • Covers qualification variations for enums/constants (::Fully::Qualified, module-qualified, and unqualified).

Reviewed changes

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

File Description
tests/IceRpc.Ice.Generator.Base.Tests/ConstTests.ice Defines enums + constants (including aliases) used to validate constant mapping.
tests/IceRpc.Ice.Generator.Base.Tests/ConstTests.cs NUnit tests verifying generated constant values and escape sequence preservation.
tests/IceRpc.Ice.Generator.Base.Tests/DefaultValueTests.ice Defines structs/classes/exceptions with explicit defaults (literal and const-based).
tests/IceRpc.Ice.Generator.Base.Tests/DefaultValueTests.cs NUnit tests asserting generated default-value initialization semantics.

Comment thread tests/IceRpc.Ice.Generator.Base.Tests/DefaultValueTests.cs
@bernardnormier bernardnormier merged commit 016084c into icerpc:main Apr 6, 2026
17 of 23 checks passed
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.

4 participants