Generates a buffer with special first and last bytes, repeating the middle byte of the pattern.
(size: int, pattern: bytes)
| 544 | |
| 545 | @staticmethod |
| 546 | def gen_blob_data(size: int, pattern: bytes) -> bytes: |
| 547 | """Generates a buffer with special first and last bytes, |
| 548 | repeating the middle byte of the pattern.""" |
| 549 | assert len(pattern) == 3 |
| 550 | assert size >= 3 |
| 551 | # Stretch out the middle byte to fill the space. |
| 552 | ret = pattern[0:1] + pattern[1:2] * (size - 2) + pattern[2:3] |
| 553 | assert len(ret) == size |
| 554 | return ret |
| 555 | |
| 556 | def test_round_trip_with_segments(self) -> None: |
| 557 | # Create a program with some delegate data blobs. |
no outgoing calls
no test coverage detected