示例#1
0
    def __init__(self,
                 root_node,
                 node_consumer,
                 make_determinist=False,
                 make_random=False,
                 max_steps=-1,
                 initial_step=1):
        self._root_node = root_node
        self._root_node.make_finite(all_conf=True, recursive=True)

        if make_determinist:
            assert (not make_random)
            self._root_node.make_determinist(all_conf=True, recursive=True)
        elif make_random:
            assert (not make_determinist)
            self._root_node.make_random(all_conf=True, recursive=True)

        self._root_node.freeze()

        self._max_steps = int(max_steps)
        self._initial_step = int(initial_step)

        assert (self._max_steps > 0 or self._max_steps == -1)

        self.ic = dm.NodeInternalsCriteria(mandatory_attrs=[
            dm.NodeInternals.Mutable, dm.NodeInternals.Finite
        ])
        self.triglast_ic = dm.NodeInternalsCriteria(
            mandatory_custo=[dm.GenFuncCusto.TriggerLast])

        self.consumed_node_path = None

        self.set_consumer(node_consumer)
示例#2
0
    def init_specific(self, separators=None):
        self._internals_criteria = \
            dm.NodeInternalsCriteria(mandatory_attrs=[dm.NodeInternals.Mutable, dm.NodeInternals.Separator],
                                     node_kinds=[dm.NodeInternals_Term])

        self.values = [b'']
        if separators is not None:
            self.values += list(separators)
示例#3
0
    def init_specific(self, ignore_separator=False):
        if ignore_separator:
            self._internals_criteria = dm.NodeInternalsCriteria(
                mandatory_attrs=[dm.NodeInternals.Mutable],
                negative_attrs=[dm.NodeInternals.Separator],
                node_kinds=[
                    dm.NodeInternals_TypedValue, dm.NodeInternals_GenFunc
                ])
        else:
            self._internals_criteria = dm.NodeInternalsCriteria(
                mandatory_attrs=[dm.NodeInternals.Mutable],
                node_kinds=[
                    dm.NodeInternals_TypedValue, dm.NodeInternals_GenFunc
                ])

        # self.orig_value = None
        self.current_fuzz_vt_list = None
        self.current_node = None
        self.orig_internal = None

        self.need_reset_when_structure_change = True
示例#4
0
    def init_specific(self, **kwargs):
        self.__node_backup = None

        self.need_reset_when_structure_change = True

        self._internals_criteria = dm.NodeInternalsCriteria(
            mandatory_attrs=[dm.NodeInternals.Mutable])
        self._owned_confs = ['MAIN']
        self.current_consumed_node = None
        self.orig_conf = None
        self.confs_list = None
        self.recover = False
示例#5
0
def fuzz_data_tree(top_node, paths_regexp=None):

    c = dm.NodeInternalsCriteria(mandatory_attrs=[dm.NodeInternals.Mutable],
                                 node_kinds=[dm.NodeInternals_NonTerm])

    if paths_regexp:
        node_list = top_node.get_reachable_nodes(path_regexp=paths_regexp)
    else:
        node_list = [top_node]

    for node in node_list:
        l = node.get_reachable_nodes(internals_criteria=c)
        for e in l:
            e.cc.change_subnodes_csts([('*', 'u=.')])
示例#6
0
 def init_specific(self, **kwargs):
     self._internals_criteria = dm.NodeInternalsCriteria(
         node_kinds=[dm.NodeInternals_NonTerm])
     self.need_reset_when_structure_change = True
     self.last_node = None
     self.current_node = None
示例#7
0
 def init_specific(self):
     self._internals_criteria = dm.NodeInternalsCriteria(
         negative_node_kinds=[dm.NodeInternals_NonTerm])
     self.firstcall = True
示例#8
0
 def init_specific(self, **kwargs):
     self._internals_criteria = dm.NodeInternalsCriteria(
         negative_node_kinds=[dm.NodeInternals_NonTerm])