Skip to content
Snippets Groups Projects
Commit 69b6d79f authored by Kenneth Hiemstra's avatar Kenneth Hiemstra
Browse files

compare with numpy

parent f31bd3e6
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,13 @@ from common import *
from pi_common import *
def compare_arrays(a,b):
import numpy as np
print 'Compare array A:\n',np.asarray(a)
print 'With array B:\n',np.asarray(b)
compared = (np.asarray(a) == np.asarray(b))
print 'Result:\n',compared
return (not False in compared)
def test_bg(tc, io):
tc.set_section_id('Test BG - ')
......@@ -101,7 +107,7 @@ def test_bg(tc, io):
for r in ram: lram.append(list(r)) # () -> []
bg_ram.append(lram)
#bg_ram[0][0]=0
bg_ram[0][0][2]=0
db_ram = []
for s in range(nof_streams):
......@@ -113,6 +119,7 @@ def test_bg(tc, io):
tc.append_log(1, '>>> (BG==DB): %s' % compared)
tc.append_log(3, '')
if compared==False: tc.set_result('FAILED')
compare_arrays(bg_ram,db_ram)
def test_tr_xaui(tc, io):
tc.set_section_id('Read tr xaui status - ')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment