Skip to content

Commit

Permalink
use ir_tree_to_data to avoid going through full flow
Browse files Browse the repository at this point in the history
  • Loading branch information
tybug committed Mar 18, 2024
1 parent 075a46b commit fc9c009
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ def __stoppable_test_function(self, data):
# correct engine.
raise

def ir_tree_to_data(self, ir_tree_nodes):
data = ConjectureData.for_ir_tree(ir_tree_nodes)
self.__stoppable_test_function(data)
return data

def test_function(self, data):
if self.__pending_call_explanation is not None:
self.debug(self.__pending_call_explanation)
Expand Down Expand Up @@ -316,8 +321,7 @@ def test_function(self, data):

# drive the ir tree through the test function to convert it
# to a buffer
data = ConjectureData.for_ir_tree(data.examples.ir_tree_nodes)
self.__stoppable_test_function(data)
data = self.ir_tree_to_data(data.examples.ir_tree_nodes)
self.__data_cache[data.buffer] = data.as_result()

key = data.interesting_origin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ def calls(self):
return self.engine.call_count

def consider_new_tree(self, tree):
data = ConjectureData.for_ir_tree(tree)
self.engine.test_function(data)
data = self.engine.ir_tree_to_data(tree)

return self.consider_new_buffer(data.buffer)

Expand Down

0 comments on commit fc9c009

Please sign in to comment.