Commits

Hakan Ardo committed 95602c8 Merge

hg merge default

Comments (0)

Files changed (4)

pypy/jit/metainterp/optimizeopt/intbounds.py

 from pypy.jit.metainterp.resoperation import rop, ResOperation
 
 class OptIntBounds(Optimization):
-    """Keeps track of the bounds placed on integers by the guards and
-       remove redundant guards"""
+    """Keeps track of the bounds placed on integers by guards and remove
+       redundant guards"""
 
     def setup(self):
         self.posponedop = None

pypy/module/_rawffi/test/test__rawffi.py

             assert "Procedure called with too many arguments" in e.message
         else:
             assert 0, "Did not raise"
+        arg.free()
 
     def test_struct_byvalue(self):
         import _rawffi, sys

pypy/tool/pytest/test/test_pytestsupport.py

 from pypy.interpreter.argument import Arguments
 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.pyframe import PyFrame
-from pypy.tool.pytest.appsupport import AppFrame, build_pytest_assertion, AppExceptionInfo
+from pypy.tool.pytest.appsupport import (AppFrame, build_pytest_assertion,
+    AppExceptionInfo)
 import py
 from pypy.tool.udir import udir
 import os
         assert x == 43
     t = app2interp_temp(app_test_func)
     f = t.get_function(space)
-    space.setitem(space.builtin.w_dict, space.wrap('AssertionError'), 
+    space.setitem(space.builtin.w_dict, space.wrap('AssertionError'),
                   build_pytest_assertion(space))
     try:
         f.call_args(Arguments(None, []))
     else:
         assert False, "got no exception!"
 
-def app_test_exception(): 
-    try: 
+def app_test_exception():
+    try:
         raise AssertionError("42")
-    except AssertionError: 
-        pass 
-    else: 
+    except AssertionError:
+        pass
+    else:
         raise AssertionError, "app level AssertionError mixup!"
-    
+
 def app_test_exception_with_message():
     try:
         assert 0, "Failed"
         assert e.msg == "Failed"
 
 
-def test_appexecinfo(space): 
-    try: 
-        space.appexec([], "(): raise ValueError") 
-    except OperationError, e: 
+def test_appexecinfo(space):
+    try:
+        space.appexec([], "(): raise ValueError")
+    except OperationError, e:
         appex = AppExceptionInfo(space, e)
-    else: 
-        py.test.fail("did not raise!") 
-    assert appex.exconly().find('ValueError') != -1 
-    assert appex.exconly(tryshort=True).find('ValueError') != -1 
-    assert appex.errisinstance(ValueError) 
-    assert not appex.errisinstance(RuntimeError) 
-    class A: 
+    else:
+        py.test.fail("did not raise!")
+    assert appex.exconly().find('ValueError') != -1
+    assert appex.exconly(tryshort=True).find('ValueError') != -1
+    assert appex.errisinstance(ValueError)
+    assert not appex.errisinstance(RuntimeError)
+    class A:
         pass
-    assert not appex.errisinstance(A) 
+    assert not appex.errisinstance(A)
 
 
 def test_fakedexception(space):
         raise PicklingError("SomeMessage")
     space.setitem(space.builtin.w_dict, space.wrap('raise_error'),
                   space.wrap(raise_error))
-    
+
     try:
         space.appexec([], "(): raise_error()")
     except OperationError, e:
         py.test.fail("did not raise!")
     assert "PicklingError" in appex.exconly()
 
-class AppTestWithWrappedInterplevelAttributes: 
-    def setup_class(cls): 
+class AppTestWithWrappedInterplevelAttributes:
+    def setup_class(cls):
         space = cls.space
-        cls.w_some1 = space.wrap(42) 
+        cls.w_some1 = space.wrap(42)
 
-    def setup_method(self, meth): 
+    def setup_method(self, meth):
         self.w_some2 = self.space.wrap(23)
 
-    def test_values_arrive(self): 
-        assert self.some1 == 42  
-        assert self.some2 == 23 
+    def test_values_arrive(self):
+        assert self.some1 == 42
+        assert self.some2 == 23
 
-    def test_values_arrive2(self): 
+    def test_values_arrive2(self):
         assert self.some1 == 42
 
+    def w_compute(self, x):
+        return x + 2
+
+    def test_equal(self):
+        assert self.compute(3) == 5
+
 def test_expectcollect(testdir):
     py.test.importorskip("pexpect")
     conftestpath.copy(testdir.tmpdir)
                 pass
     """)
     ev, = sorter.getreports("pytest_runtest_logreport")
-    assert ev.passed 
+    assert ev.passed
     sfn = ev.item.safe_filename()
     print sfn
     assert sfn == 'test_safe_filename_test_safe_filename_ExpectTestOne_paren_test_one_1.py'
     ev, = sorter.getreports("pytest_runtest_logreport")
     assert ev.failed
     assert 'NameError' in ev.longrepr.reprcrash.message
-    assert 'blow' in ev.longrepr.reprcrash.message    
+    assert 'blow' in ev.longrepr.reprcrash.message

pypy/translator/c/src/asm_gcc_x86_64.h

  */
 
 #define READ_TIMESTAMP(val) do {                        \
-    unsigned int _eax, _edx;                            \
-    asm volatile("rdtsc" : "=a" (_eax), "=d" (_edx));   \
-    val = (((unsigned long) _edx) << 32) | _eax;        \
+    unsigned long _rax, _rdx;                           \
+    asm volatile("rdtsc" : "=rax"(_rax), "=rdx"(_rdx)); \
+    val = (_rdx << 32) | _rax;                          \
 } while (0)