mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-06-27 00:01:01 +03:00
Use combinations_with_replacement
for inputs
When generating combinations of values, `itertools.combinations` will not allow inputs to be repeated. This is replaced so that cases where input values match are generated, i.e. ("0", "0"). Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
@ -166,7 +166,7 @@ class BignumOperation(BignumTarget, metaclass=ABCMeta):
|
|||||||
"""
|
"""
|
||||||
yield from cast(
|
yield from cast(
|
||||||
Iterator[Tuple[str, str]],
|
Iterator[Tuple[str, str]],
|
||||||
itertools.combinations(cls.input_values, 2)
|
itertools.combinations_with_replacement(cls.input_values, 2)
|
||||||
)
|
)
|
||||||
yield from cls.input_cases
|
yield from cls.input_cases
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ class BignumAdd(BignumOperation):
|
|||||||
test_name = "MPI add"
|
test_name = "MPI add"
|
||||||
input_cases = cast(
|
input_cases = cast(
|
||||||
List[Tuple[str, str]],
|
List[Tuple[str, str]],
|
||||||
list(itertools.combinations(
|
list(itertools.combinations_with_replacement(
|
||||||
[
|
[
|
||||||
"1c67967269c6", "9cde3",
|
"1c67967269c6", "9cde3",
|
||||||
"-1c67967269c6", "-9cde3",
|
"-1c67967269c6", "-9cde3",
|
||||||
|
Reference in New Issue
Block a user