Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
a7245d8c
Commit
a7245d8c
authored
Aug 09, 2016
by
Maxime Perrotin
Browse files
Use custom product function also for seqof
parent
e459ff9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/ValueGenerator.py
View file @
a7245d8c
...
...
@@ -182,9 +182,8 @@ def compute_sequence_combinations(asn1_ty, pool):
def
compute_sequenceof_combinations
(
asn1_ty
,
pool
):
''' Generator returning all combinations of arrays '''
for
size
in
xrange
(
int
(
asn1_ty
.
Min
),
int
(
asn1_ty
.
Max
)
+
1
):
elems
=
[]
for
_
in
xrange
(
size
):
elems
.
append
(
compute_combinations
(
asn1_ty
,
pool
))
for
each
in
itertools
.
product
(
*
elems
):
elems
=
[
partial
(
compute_combinations
,
asn1_ty
,
pool
)
for
_
in
xrange
(
size
)]
for
each
in
myproduct
(
*
elems
):
res
=
'{{ {} }}'
.
format
(
', '
.
join
(
each
))
yield
res
asn1_value_editor/sdlHandler.py
View file @
a7245d8c
...
...
@@ -675,7 +675,6 @@ class sdlHandler(QObject):
if
asn1_ty
:
print
'Exhausting'
,
name
for
arg
in
compute_combinations
(
asn1_ty
,
self
.
proc
.
dataview
):
#print name, arg
self
.
click_tc
(
name
,
arg
)
new_hash
=
self
.
current_hash
self
.
undo
()
...
...
@@ -721,6 +720,7 @@ class sdlHandler(QObject):
for
(
pi
,
arg
)
in
scenario
:
print
(
' {} ({})'
.
format
(
pi
,
arg
))
nb_states
+=
1
print
'Visited'
,
nb_states
if
nb_states
>=
max_states
:
return
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment