(0 . 0)(1 . 30)
583 # Convert poorly structured test data to C arrays.
584
585 from sys import argv
586
587 def is_lane(s):
588 return len(s) == 16 and all(c in '0123456789ABCDEF' for c in s)
589
590 test_files = argv[1:]
591
592 print '#define NTESTS ' + str(len(test_files))
593 print '#define TEST_STEPS (1 + 24*5)'
594 print 'static lane_t tests[NTESTS][TEST_STEPS][25] = {'
595
596 for path in test_files:
597 with open(path) as f:
598 tokens = f.read().split()
599 lane = 0
600 print '\t{'
601 for t in tokens:
602 if is_lane(t):
603 if lane == 0:
604 print '\t\t{'
605 print '\t\t\t0x' + t + ','
606 lane += 1
607 if lane == 25:
608 lane = 0
609 print '\t\t},'
610 print '\t},'
611
612 print '};'