Skip to content

Commit

Permalink
bugs: cosmetic changes in dests due to avast/retdec/issues/652
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMatula committed Sep 19, 2019
1 parent 7523176 commit 4bd5195
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions bugs/bad-stack-operations/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Test(Test):

def test_while_loop(self):
assert self.out_c.contains('while \(.*v. != 0\)')
assert self.out_c.contains('v4\+\+')
assert self.out_c.contains('v2\+\+')
assert self.out_c.contains('v3\+\+')
assert self.out_c.contains('v3 =.*v5')
assert self.out_c.contains('v5 =.*v4')
assert self.out_c.contains('v4 =.*v3')
assert self.out_c.contains('v2 =.*v4')
5 changes: 2 additions & 3 deletions bugs/fib-missing-result-sum/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ def test_general_structure(self):
assert self.out_c.has_string_literal( 'fib(%d) = %d\\n' )

def test_bug_solution(self):
assert self.out_c.contains(r'\= fib.*\- ?1')
assert self.out_c.contains(r'\= fib.*\- ?2')
assert self.out_c.contains(r'return v. \+ v.;')
assert self.out_c.contains(r'v. \= fib.*\- ?1')
assert self.out_c.contains(r'return fib.*\- ?2.*\+ v.')
3 changes: 1 addition & 2 deletions bugs/issue-197-empty-selected-fnc-body/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ def test_selected_function(self):
assert self.out_c.has_comment_matching('// Address range: 0x7148 - 0x71b4')
assert self.out_c.has_just_funcs('LzmaProps_Decode')
assert self.out_c.contains('a3 >= 4 != a3 != 4')
assert self.out_c.contains('v[0-9]+ < .*&g[0-9]+')
assert self.out_c.contains('v[0-9]+ >= 224 == \(v[0-9]+ != -32\)')
assert self.out_c.contains('return 4')
assert self.out_c.contains('v[0-9]+ < .*&g[0-9]+')
5 changes: 3 additions & 2 deletions bugs/real-register-names/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ class X86Test(Test):
input='input-x86.ex'
)

def test_real_register_name_is_emitted_in_comment(self):
assert self.out_c.contains(r'int32_t g[0-9]+ = 0; // ecx')
# TODO: we should test that v1 is in fact ecx
def test_ecx_is_used(self):
assert self.out_c.contains(r'return printf\("%d\\n", v1\);')

class SameRegAndFncNameTest(Test):
settings = TestSettings(
Expand Down

0 comments on commit 4bd5195

Please sign in to comment.