Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some Compact-specific deserialization tests.
Summary: The CompactProtocol deserialization pathways include numerous optimizations for the common-case context where struct data is mostly contiguous, and skips going through the Cursor API for such cases. All existing testing, though, is done through either the user-facing API (which doesn't use much of this machinery, like the field-advancing fast paths), or simple round-trip testing (serializing into an IOBufQueue and then deserializaing). The former doesn't test the most important code, and the latter doesn't test any edge cases where data crosses an IOBuf boundary (since those tests use small test structs in big IOBufQueue buffers, resulting in mostly contiguous reads). So this adds tests of both APIs in which we deliberately insert IOBuf boundaries at every possible point in a small bit of test data, and ensures we still deserialize correctly. Reviewed By: iahs Differential Revision: D45957952 fbshipit-source-id: 857c36b1510120c0662c9313674941289820d2ad
- Loading branch information