Explain test subtlety

This commit is contained in:
Andrew Noyes 2019-07-29 16:00:14 -07:00
parent 9d32cbcf50
commit 997da6882a

View File

@ -452,6 +452,10 @@ TEST_CASE("/flow/FlatBuffers/VectorRef") {
serializedVector = StringRef(readerArena, writer.toStringRef());
}
ArenaObjectReader reader(readerArena, serializedVector, Unversioned());
// The VectorRef and Arena arguments are intentionally in a different order from the serialize call above.
// Arenas need to get serialized after any Ref types whose memory they own. In order for schema evolution to be
// possible, it needs to be okay to reorder an Arena so that it appears after a newly added Ref type. For this
// reason, Arenas are ignored by the wire protocol entirely. We test that behavior here.
reader.deserialize(FileIdentifierFor<decltype(outVec)>::value, outVec, vecArena);
}
ASSERT(src.size() == outVec.size());