ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/test/py_tests/unit_tools/lcompare.py
(Generate patch)

Comparing ray/test/py_tests/unit_tools/lcompare.py (file contents):
Revision 1.1 by schorsch, Sun Dec 7 20:40:51 2003 UTC vs.
Revision 1.2 by schorsch, Thu Mar 10 01:49:56 2016 UTC

# Line 8 | Line 8 | even if they are slightly different, eg. as a conseque
8   binary rounding errors.
9   '''
10  
11 import string
12 import types
11  
12   class error(Exception): pass
13  
# Line 72 | Line 70 | def llcompare(lltest, llref, ignore_empty=0, recurse=[
70                  lltest = filter(None, lltest)
71                  llref = filter(None, llref)
72          if len(lltest) != len(llref):
73 <                raise error, 'Comparision failed: Different number of lines (%d,%d)' %(
73 >                raise error, 'Comparision failed: Different number of lines (%d, %d)' %(
74                          len(lltest), len(llref))
75          for i in range(len(llref)):
76                  if llref[i]:
# Line 90 | Line 88 | def split_headers(s):
88          '''split Radiance file headers
89                  return a list of lists of tokens suitable for llcompare()
90                  this is useful to check the output of getinfo'''
91 <        ll = map(string.strip,string.split(s, '\n'))
91 >        ll = [ss.strip() for ss in s.split('\n')]
92          nll = []
93          for l in ll:
94 <                parts = string.split(l, '=', 1)
94 >                parts = l.split('=', 1)
95                  if len(parts) == 2:
96 <                        left = map(_typify_token, string.split(parts[0]))
97 <                        right = map(_typify_token, string.split(parts[1]))
96 >                        left = map(_typify_token, parts[0].split())
97 >                        right = map(_typify_token, parts[1].split())
98                          nll.append(left + ['='] + right)
99 <                else: nll.append(map(_typify_token, string.split(l)))
99 >                else: nll.append(map(_typify_token, l.split()))
100          return nll
101  
102   def split_rad(s):
103          '''Split the contents of a scene description string
104                  return a list of list of tokens suitable for llcompare()'''
105 <        ll = map(string.strip,string.split(s, '\n'))
105 >        ll = [ss.strip() for ss in s.split('\n')]
106          nll = []
107          for l in ll:
108 <                nll.append(map(_typify_token, string.split(l)))
108 >                nll.append(map(_typify_token, l.split()))
109          return nll
110  
111   def split_radfile(fn):

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines