
| Current Path : /var/www/web-klick.de/dsh/50_dev2017/1330__canpy/scripts/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/50_dev2017/1330__canpy/scripts/DEADJOE |
*** These modified files were found in JOE when it aborted on Thu Jan 28 18:27:18 2016
*** JOE was aborted because the terminal closed
*** File 'test04.py'
import autocan
import sys
import random
import re
nr = int(sys.argv[1])
r = random.Random()
c = autocan.sigfilter.CAN()
CD if nr == 1:
x = c.hex_to_bit("e4546756475674903265704675082ac")
print x
y = c.bit_to_hex(x)
print y
elif nr == 2:
x1 = c.hex_to_bit("04")
x2 = c.hex_to_bit("f5")
y = c.concat(x1,x2)
z = c.bit_to_hex(y)
print z
elif nr == 3:
x = c.hex_to_bit("04abc")
y = c.substr(x,4,8)
z = c.bit_to_hex(y)
print z
elif nr ==4:
y=c.substr(4, 0,6*8)
print y
elif nr == 1:
'''
Chooses a random communication matrix,
chooses a random signal list,
converts it to messages, converts it back,
and checks whether signal list remains the same
'''
max_messages_in_the_communication_matrix = 20
max_signals_to_send = 50
count_of_tests = 10
rand = random.Random()
testnr = 0
while testnr < count_of_tests:
testnr = testnr + 1
canobj = autocan.transport.CAN({})
canobj.t_make_communication_matrix(rand.randint(
max_messages_in_the_communication_matrix/2,
max_messages_in_the_communication_matrix)
)
print "Communication matrix:"
print canobj.communication_matrix
print " "
signal_list = canobj.t_get_signals()
signals_to_send = {}
signals_count = rand.randint(1,min(len(signal_list)/2,max_signals_to_send))
while len(signals_to_send) < signals_count:
signal = rand.choice(signal_list.keys())
sigval = rand.randint(1,2**int(signal_list[signal])-1)
signals_to_send[signal] = sigval
print "Signals to send:"
print signals_to_send
print " "
messages = canobj.sig_to_msg(signals_to_send)
sig2 = {}
print "Messages and the included Signals:"
for msg in messages:
print msg
sig1 = canobj.msg_to_sig(msg)
print sig1
for o in sig1.keys():
sig2[o] = sig1[o]
print " "
print "Comparison of former and returned signal list:"
print signals_to_send
print sig2
print " "
print "Are both identical?"
erg = signals_to_send == sig2
print erg
if not erg:
break
*** File '(Unnamed)'
*** These modified files were found in JOE when it aborted on Thu Jan 28 18:27:22 2016
*** JOE was aborted by UNIX signal 15
*** File 'test04.py'
import autocan
import sys
import random
import re
nr = int(sys.argv[1])
r = random.Random()
c = autocan.sigfilter.CAN()
if nr == 1:
x = c.hex_to_bit("f")
print bin(x)
y = c.bit_to_hex(x)
print y
elif nr == 2:
x1 = c.hex_to_bit("04")
print bin(x1)
x2 = c.hex_to_bit("f5")
print bin(x2)
y = c.concat(x1,x2)
print bin(y)
z = c.bit_to_hex(y)
print z
elif nr == 3:
x = c.hex_to_bit("04abc")
y = c.substr(x,4,8)
z = c.bit_to_hex(y)
print z
elif nr ==4:
#msg = 12121212121212120112101010
#c.msg_to_sig(msg)
test= c.concat(4,1)
print test
elif nr ==5:
test = c.int(f,16)
print test
elif nr == 1:
'''
Chooses a random communication matrix,
chooses a random signal list,
converts it to messages, converts it back,
and checks whether signal list remains the same
'''
max_messages_in_the_communication_matrix = 20
max_signals_to_send = 50
count_of_tests = 10
rand = random.Random()
testnr = 0
while testnr < count_of_tests:
testnr = testnr + 1
canobj = autocan.transport.CAN({})
canobj.t_make_communication_matrix(rand.randint(
max_messages_in_the_communication_matrix/2,
max_messages_in_the_communication_matrix)
)
print "Communication matrix:"
print canobj.communication_matrix
print " "
signal_list = canobj.t_get_signals()
signals_to_send = {}
signals_count = rand.randint(1,min(len(signal_list)/2,max_signals_to_send))
while len(signals_to_send) < signals_count:
signal = rand.choice(signal_list.keys())
sigval = rand.randint(1,2**int(signal_list[signal])-1)
signals_to_send[signal] = sigval
print "Signals to send:"
print signals_to_send
print " "
messages = canobj.sig_to_msg(signals_to_send)
sig2 = {}
print "Messages and the included Signals:"
for msg in messages:
print msg
sig1 = canobj.msg_to_sig(msg)
print sig1
for o in sig1.keys():
sig2[o] = sig1[o]
print " "
print "Comparison of former and returned signal list:"
print signals_to_send
print sig2
print " "
print "Are both identical?"
erg = signals_to_send == sig2
print erg
if not erg:
break
*** File '(Unnamed)'
glob2
*** File '(Unnamed)'
test04.py
test04.py
test04.py
test04.py
test04.py
test04.py
sigfilter.py
test04.py
test04.py
sigfilter.py
test04.py
*** These modified files were found in JOE when it aborted on Mon Feb 1 11:58:25 2016
*** JOE was aborted because the terminal closed