test_files: Test decoder also with ff-padded input

It's customary in the SIM card universe to right-pad data with ff bytes.
So far we only test decoders without such padding, which is unrealistic.
Let's also tests the decoders with extra 'ff' padding present.

For some files this doesn't make sense, so we add a _test_no_pad class
attribute that can be spcified to prevent this new "test with ff-padding"
from being executed for the test data of the class.

Change-Id: I7f5cbb4a6f91040fe9adef9da0a1f30f9f156dae
This commit is contained in:
Harald Welte
2023-12-28 09:41:35 +01:00
parent bcd261583c
commit ce01f48b00
5 changed files with 53 additions and 7 deletions

View File

@@ -526,6 +526,7 @@ class EF_ECC(LinFixedEF):
"marine_guard": False, "mountain_rescue": False,
"manual_ecall": False, "automatic_ecall": False } } ),
]
_test_no_pad = True
cc_construct = BcdAdapter(Rpad(Bytes(3)))
category_construct = FlagsEnum(Byte, police=1, ambulance=2, fire_brigade=3, marine_guard=4,
mountain_rescue=5, manual_ecall=6, automatic_ecall=7)
@@ -588,6 +589,8 @@ class EF_AD(TransparentEF):
"prose_services": False, "extended_drx": False },
"rfu": 0, "mnc_len": 2, "extensions": b'' } ),
]
_test_no_pad = True
class OP_MODE(enum.IntEnum):
normal = 0x00
type_approval = 0x80