Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PersistedAssemblyBuilder tests to cover input and boundary cases #103086

Closed
steveharter opened this issue Jun 5, 2024 · 1 comment · Fixed by #105782
Closed

Add PersistedAssemblyBuilder tests to cover input and boundary cases #103086

steveharter opened this issue Jun 5, 2024 · 1 comment · Fixed by #105782
Assignees
Labels
area-System.Reflection.Emit blocking-release in-pr There is an active PR which will close this issue when it is merged test-enhancement Improvements of test source code
Milestone

Comments

@steveharter
Copy link
Member

steveharter commented Jun 5, 2024

Per offline discussions, it was considered useful to add tests for the following cases; some of these tests were already done in an ad-hoc fashion but not committed:

  • Test for special characters in member and class names. ECMA-335 doesn't provide rules here, unlike C# for example, but we should check for special characters and strings such as "*", "!", "@", "_", "__", "0x42", "\42" (Unicode escaping), and embedded quotes and nulls. We shouldn't have cases where the input is valid, but the encoding of that fails or is misrepresented.
  • Tests for high length counts in member and class names. ECMA-335 doesn't provide rules here, unlike C# for example, but we should verify that long names work as expected.
  • Test for class and member name collisions; adding the same property more than once for example.
  • Validate ECMA-335 "II.24.2.6 #~ stream" cases when it switches from a 2 byte index to a 4 byte index. There is a bug in the spec (and in .NET) since in one place it says "it is stored using 2 bytes if table i has less than 2^16 rows, otherwise it is stored using 4 bytes" and in section "II.22.37 TypeDef : 0x02" it says we may need "rowcount + 1" which would push the rowcount value from 0xffff to 0x10000 but which would not fit in 2 bytes. See also Compiler can silently generate a bad image when there's 0xFFFF parameters in the module #94892
@steveharter steveharter added area-System.Reflection.Emit test-enhancement Improvements of test source code labels Jun 5, 2024
@steveharter steveharter added this to the 9.0.0 milestone Jun 5, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection-emit
See info in area-owners.md if you want to be subscribed.

@buyaa-n buyaa-n self-assigned this Jul 17, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Aug 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Reflection.Emit blocking-release in-pr There is an active PR which will close this issue when it is merged test-enhancement Improvements of test source code
Projects
None yet
3 participants