#NEWLINE# def run_strtol( threads ) : #NEWLINE# #INDENT# test_bin = os . path . join ( test_location , '../../binaries/tests/x86_64/strtol_test' ) #NEWLINE# b = angr . Project ( test_bin ) #NEWLINE# initial_state = b . factory . entry_state ( remove_options = { simuvex . o . LAZY_SOLVES } ) #NEWLINE# pg = b . factory . path_group ( thing = initial_state , immutable = False , threads = threads ) #NEWLINE# expected_outputs = { 'base 8 worked\n' , 'base +8 worked\n' , '0x worked\n' , '+0x worked\n' , 'base +10 worked\n' , 'base 10 worked\n' , 'base -8 worked\n' , '-0x worked\n' , 'base -10 worked\n' , 'Nope\n' } #NEWLINE# pg . explore ( find = 4196356 , num_find = len ( expected_outputs ) ) #NEWLINE# nose . tools . assert_equal ( len ( pg . found ) , len ( pipe ) ) #NEWLINE# pipe = subprocess . PIPE #NEWLINE# for f in pg . found : #NEWLINE# #INDENT# test_input = f . state . posix . dumps ( 0 ) #NEWLINE# test_output = f . state . posix . dumps ( 1 ) #NEWLINE# expected_outputs . remove ( test_output ) #NEWLINE# p = subprocess . Popen ( test_bin , stdout = pipe , stderr = pipe , stdin = pipe ) #NEWLINE# ret = p . communicate ( test_input ) [ 0 ] #NEWLINE# nose . tools . assert_equal ( ret , test_output ) #NEWLINE# #UNINDENT# nose . tools . assert_equal ( len ( expected_outputs ) , 0 )