You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for field_value in range(0, {{get_field_max_value_hex_string(node)}}+1):
564
-
if field_value in [{%- forvalue_of_enum_neededinnode.get_property('encode') -%}{{value_of_enum_needed.value}}{%ifnotloop.last%}, {%endif%}{%- endfor%}]:
565
-
# legal int value of the eunm so no test is needed
566
-
continue
559
+
{# only run this if there are field values that are not part of the enum #}
# check that other values of the field int that don't appear in the enum generate
562
+
# an error
563
+
{%ifnode.width <= 8 %}
564
+
{# for enumerated fields of up to 8 bit all combinations can be exhaustively tested #}
565
+
for field_value in set(range({{get_field_max_value_hex_string(node)}}+1)) - { {%- forvalue_of_enum_neededinnode.get_property('encode') -%}{{value_of_enum_needed.value}}{%ifnotloop.last%}, {%endif%}{%- endfor%} }:
566
+
{%else%}
567
+
{# for enumerated fields of with larger sizes look for up to 100 illegal values #}
568
+
for field_value in { random.randint(0, {{get_field_max_value_hex_string(node)}}+1) for _ in range(100) } - { {%- forvalue_of_enum_neededinnode.get_property('encode') -%}{{value_of_enum_needed.value}}{%ifnotloop.last%}, {%endif%}{%- endfor%} }:
0 commit comments