diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/runner.py b/tests/runner.py index ebd4e8ba..662360a3 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -381,10 +381,15 @@ if 'benchmark' not in sys.argv: int y32 = hold+50; printf("*%u,%u*\\n", hold, y32); + // Comparisons + x8 = 0; + for (int i = 0; i < 254; i++) x8++; // make it an actual 254 in JS - not a -2 + printf("*%d,%d*\\n", x8+1 == 0xff, x8+1 != 0xff); // 0xff may be '-1' in the bitcode + return 0; } ''' - self.do_test(src, '*4294967295,0,4294967219*\n*-1,1,-1,1*\n*-2,1,-2,1*\n*246,296*') + self.do_test(src, '*4294967295,0,4294967219*\n*-1,1,-1,1*\n*-2,1,-2,1*\n*246,296*\n*1,0*') def test_bitfields(self): global SAFE_HEAP; SAFE_HEAP = 0 # bitfields do loads on invalid areas, by design @@ -1639,9 +1644,8 @@ if 'benchmark' not in sys.argv: force_c=True) def test_openjpeg(self): - if COMPILER == LLVM_GCC: return # Not sure why, but fails in gcc - generally correct, but noisy output - global SAFE_HEAP; SAFE_HEAP = 0 # Very slow + global CORRECT_SIGNS; CORRECT_SIGNS = 1 # Needed for some comparisons, at least in gcc original_j2k = path_from_root('tests', 'openjpeg', 'syntensity_lobby_s.j2k') @@ -1672,11 +1676,14 @@ if 'benchmark' not in sys.argv: # check our output by comparing the average pixel difference def image_compare(output): # Get the image generated by JS, from the JSON.stringify'd array - m = re.search('\[[\d, ]*\]', output) + m = re.search('\[[\d, -]*\]', output) try: js_data = eval(m.group(0)) except AttributeError: print 'Failed to find proper image output in: ' + output + raise + + js_data = map(lambda x: x if x >= 0 else 256+x, js_data) # Our output may be signed, so unsign it # Generate the native code output using lli lli_file = os.path.join(self.get_dir(), 'lli.raw') @@ -1697,7 +1704,7 @@ if 'benchmark' not in sys.argv: diff_mean = diff_total/float(num) image_mean = 83 - print '[image stats:', js_mean, image_mean, lli_mean, diff_mean, num, ']' + #print '[image stats:', js_mean, image_mean, lli_mean, diff_mean, num, ']' assert abs(js_mean - image_mean) < 2 assert abs(lli_mean - image_mean) < 2 assert diff_mean < 2 # XXX All of these are not quite right... |