Skip to content
Success

Changes

Summary

  1. construct: add length steps to StripTrailerAdapter (details)
Commit d1e435aa22c1d707c476b41250e432aa49fc6dfa by pmaier@sysmocom.de
construct: add length steps to StripTrailerAdapter

The class StripTrailerAdapter allows to remove trailing bytes that
match a specified value from the encoding result of a sub-construct.
The result is always the shortest possible remainder of bytes that
do not match the secified value.

Unfortunately there are specifications that explicitly require the
length of the result to fit into a limited set of possible length
values. For example: A result may be either one byte or three byte
long. To cover those cases as well, let's add an array parameter
where we can configure the allowed length values of the encoding
result.

Related: OS#6679
Change-Id: I86df064fa41db85923eeb0d83cc399504fdd4488
The file was modifiedtests/test_construct.py
The file was modifiedsrc/osmocom/construct.py