osmo-pcu/tests/rlcmac
Vadim Yanitskiy 29aeb901e4 csn1: fix: do not return 0 if no bits left in the buffer
Both csnStreamDecoder() and csnStreamEncoder() shall not return 0
prematurely if no more bits left in the input / output bit-vector.

Returning CSN_ERROR_NEED_MORE_BITS_TO_UNPACK might make more sense,
however we don't know in advance (i.e. without entering the loop)
whether it's an error or not. Some CSN.1 definitions have names
like 'M_*_OR_NULL', what basically means that they're optional
and can be ignored or omitted.

Most of the case statements do check whether the number of remaining
bits is enough to unpack / pack a value, so let's leave it up to
the current CSN_* handler (pointed by pDescr) if no bits left.

Return CSN_ERROR_NEED_MORE_BITS_TO_UNPACK only if the number of
remaining bits is negative as this is an error in any case.

Change-Id: Ie3a15e210624599e39b1e70c8d34efc10c552f6c
2020-03-11 19:55:55 +00:00
..
RLCMACTest.cpp tests/rlcmac: also enable logging for DRLCMACDATA category 2020-03-07 16:13:26 +07:00
RLCMACTest.err csn1: fix: do not return 0 if no bits left in the buffer 2020-03-11 19:55:55 +00:00
RLCMACTest.ok csn1: fix: do not return 0 if no bits left in the buffer 2020-03-11 19:55:55 +00:00