Skip to content

Add PersistedAssemblyBuilder tests to cover input and boundary cases #103086

@steveharter

Description

@steveharter

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions