Commit eebaffe
committed
[#12] NativeStructSizesTests: document why sizes are duplicated
Reviewer suggested sharing the storage-size literals between
Iox2NativeMethods.cs and this test file. Doing so would erase the
tripwire: Marshal.SizeOf<T> reads the StructLayout(Size = ...) attribute,
so if both sides derive from the same const, the assert collapses to
const-equals-const and trivially passes. The double-entry bookkeeping is
the point — a maintainer who updates one side but forgets the other
gets a failing test. Adding an in-line note so the design intent is
visible at the literals, not buried in the class docstring.1 parent 493c2de commit eebaffe
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
0 commit comments