Skip to content

Commit

Permalink
Add some Compact-specific deserialization tests.
Browse files Browse the repository at this point in the history
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
David Goldblatt authored and facebook-github-bot committed May 17, 2023
1 parent 6c2966e commit aa41406
Show file tree
Hide file tree
Showing 2 changed files with 488 additions and 0 deletions.
Loading

0 comments on commit aa41406

Please sign in to comment.