There are two structures of interest. The first is the type
information for the outer structure (the result of s.getTypeInfo()).
The second is the type information provided for the inner structure,
s.inner.getTypeInfo().
Info on p variable from testNestedStructureTypeInfo:
Native Allocated Memory <0x2aaaf190b050> (24 bytes)
Dump 24 bytes of this memory to see what it looks like. You should
expect this structure:
8 bytes - size, offset 0
2 bytes - alignment, offset 8
2 bytes - type = 13, offset 10
8 bytes - pointer, offset 16
If the last field is not null, dump 24 bytes from that address. This
is the type information for each field; the first 8 bytes should be
the same as s.inner.getTypeInfo().
What might be wrong here is the test may be using the wrong offset
for the last pointer field in the above structure (which means it's
just a faulty test and the code is probably working correctly).
Pointer els = p.getPointer(Pointer.SIZE + 4); // try changing the
offset to Pointer.SIZE*2