[pypy-commit] pypy default: Fix test collection on windows and s390x

2019-08-11 Thread rlamy
Author: Ronan Lamy 
Branch: 
Changeset: r97146:597f4be1ae97
Date: 2019-08-11 17:51 +0100
http://bitbucket.org/pypy/pypy/changeset/597f4be1ae97/

Log:Fix test collection on windows and s390x

diff --git a/pypy/module/_cppyy/test/conftest.py 
b/pypy/module/_cppyy/test/conftest.py
--- a/pypy/module/_cppyy/test/conftest.py
+++ b/pypy/module/_cppyy/test/conftest.py
@@ -5,7 +5,7 @@
 
 @py.test.mark.tryfirst
 def pytest_runtest_setup(item):
-if py.path.local.sysfind('genreflex') is None:
+if not disabled and py.path.local.sysfind('genreflex') is None:
 import pypy.module._cppyy.capi.loadable_capi as lcapi
 if 'dummy' in lcapi.backend_library:
 # run only tests that are covered by the dummy backend and tests
@@ -33,16 +33,18 @@
 
 def pytest_ignore_collect(path, config):
 path = str(path)
-if py.path.local.sysfind('genreflex') is None and 
config.option.runappdirect:
-return commonprefix([path, THIS_DIR]) == THIS_DIR
 if disabled:
-return commonprefix([path, THIS_DIR]) == THIS_DIR
+if commonprefix([path, THIS_DIR]) == THIS_DIR:  # workaround for bug 
in pytest<3.0.5
+return True
 
 disabled = None
 
 def pytest_configure(config):
+global disabled
 if config.getoption('runappdirect') or config.getoption('direct_apptest'):
-return   # "can't run dummy tests in -A"
+if py.path.local.sysfind('genreflex') is None:
+disabled = True  # can't run dummy tests in -A
+return
 if py.path.local.sysfind('genreflex') is None:
 import pypy.module._cppyy.capi.loadable_capi as lcapi
 try:
@@ -77,7 +79,6 @@
 standalone=False)
 except CompilationError as e:
 if '-std=c++14' in str(e):
-global disabled
 disabled = str(e)
 return
 raise
diff --git a/pypy/module/_vmprof/conftest.py b/pypy/module/_vmprof/conftest.py
--- a/pypy/module/_vmprof/conftest.py
+++ b/pypy/module/_vmprof/conftest.py
@@ -1,8 +1,13 @@
-import py, platform, sys
+import pytest
+import platform
+import sys
+from os.path import commonprefix, dirname
 
-def pytest_collect_directory(path, parent):
-if platform.machine() == 's390x':
-py.test.skip("_vmprof tests skipped")
-if sys.platform == 'win32':
-py.test.skip("_vmprof tests skipped")
-pytest_collect_file = pytest_collect_directory
+THIS_DIR = dirname(__file__)
+
+@pytest.hookimpl(tryfirst=True)
+def pytest_ignore_collect(path, config):
+path = str(path)
+if sys.platform == 'win32' or platform.machine() == 's390x':
+if commonprefix([path, THIS_DIR]) == THIS_DIR:  # workaround for bug 
in pytest<3.0.5
+return True
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test as well

2019-06-12 Thread rlamy
Author: Ronan Lamy 
Branch: 
Changeset: r96801:e53c20a6841a
Date: 2019-06-12 15:28 +0100
http://bitbucket.org/pypy/pypy/changeset/e53c20a6841a/

Log:fix test as well

diff --git a/lib-python/2.7/test/test_timeit.py 
b/lib-python/2.7/test/test_timeit.py
--- a/lib-python/2.7/test/test_timeit.py
+++ b/lib-python/2.7/test/test_timeit.py
@@ -317,9 +317,9 @@
 def test_main_recommends_perf(self):
 s = self.run_main(seconds_per_increment=2.0, switches=['-n35', '-s', 
'print("CustomSetup")'])
 self.assertIn(dedent("""\
-WARNING: timeit is a very unreliable tool. use perf or something 
else for real measurements
+WARNING: timeit is a very unreliable tool. use pyperf or something 
else for real measurements
 """), s)
-self.assertIn("-m pip install perf", s)
+self.assertIn("-m pip install pyperf", s)
 
 
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test for extra ops after shadowstack-issue2722

2019-05-26 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r96697:597a4f90a1b1
Date: 2019-05-27 08:53 +0300
http://bitbucket.org/pypy/pypy/changeset/597a4f90a1b1/

Log:fix test for extra ops after shadowstack-issue2722

diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py 
b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
--- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
@@ -425,9 +425,11 @@
 setarrayitem_raw(i153, 0, i106, descr=...)
 p156 = getfield_gc_r(p48, descr=...)
 i158 = getfield_raw_i(..., descr=...)
+i160 = int_sub(i158, 16)
+setfield_raw(#, i160, descr=...)
 setfield_gc(p48, p49, descr=...)
 setfield_gc(p134, ConstPtr(null), descr=...)
-i160 = int_lt(i158, 0)
+i160 = int_lt(i160, 0)
 guard_false(i160, descr=...)
 jump(..., descr=...)
 """)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2019-04-18 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r96516:d7c51628e606
Date: 2019-04-18 11:19 +0200
http://bitbucket.org/pypy/pypy/changeset/d7c51628e606/

Log:fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py 
b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -43,9 +43,9 @@
 guard_no_exception(descr=...)
 i100 = int_lt(i98, 0)
 guard_true(i100, descr=...)
-i102 = 
call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), 
p55, i83, 1, i89, descr=)
+i102 = 
call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), 
p13, i83, 1, i89, descr=)
 guard_true(i102, descr=...)
-i104 = int_add(i74, 1)
+i104 = int_add(i6, 1)
 --TICK--
 jump(..., descr=...)
 """ % (-sys.maxint-1,))
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2019-03-11 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r96270:c035c7de5e39
Date: 2019-03-11 09:12 +0200
http://bitbucket.org/pypy/pypy/changeset/c035c7de5e39/

Log:fix test

diff --git a/lib_pypy/_ctypes/array.py b/lib_pypy/_ctypes/array.py
--- a/lib_pypy/_ctypes/array.py
+++ b/lib_pypy/_ctypes/array.py
@@ -257,7 +257,7 @@
 try:
 itemsize = struct.calcsize(fmt[1:])
 except:
-itemsize = len(buffer(obj[0]))
+itemsize = sizeof(obj[0])
 return __pypy__.newmemoryview(memoryview(self._buffer), itemsize, fmt, 
shape)
 
 ARRAY_CACHE = {}
diff --git a/pypy/module/__pypy__/test/test_newmemoryview.py 
b/pypy/module/__pypy__/test/test_newmemoryview.py
--- a/pypy/module/__pypy__/test/test_newmemoryview.py
+++ b/pypy/module/__pypy__/test/test_newmemoryview.py
@@ -19,7 +19,7 @@
 from __pypy__ import bufferable, newmemoryview
 class B(bufferable.bufferable):
 def __init__(self):
-self.data = bytearray('abc')
+self.data = bytearray(b'abc')
 
 def __buffer__(self, flags):
 return newmemoryview(memoryview(self.data), 1, 'B')
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test from 275fd99e1c23 - __args__.keywords can be None or an empty list

2019-03-01 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r96195:739b9c69e036
Date: 2019-02-28 23:25 +0200
http://bitbucket.org/pypy/pypy/changeset/739b9c69e036/

Log:fix test from 275fd99e1c23 - __args__.keywords can be None or an
empty list

diff --git a/pypy/module/cpyext/methodobject.py 
b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -46,15 +46,15 @@
 _dealloc(space, py_obj)
 
 def w_kwargs_from_args(space, __args__):
-w_kwargs = None
-if __args__.keywords:
-# CCC: we should probably have a @jit.look_inside_iff if the
-# keyword count is constant, as we do in Arguments.unpack
-w_kwargs = space.newdict()
-for i in range(len(__args__.keywords)):
-key = __args__.keywords[i]
-w_obj = __args__.keywords_w[i]
-space.setitem(w_kwargs, space.newtext(key), w_obj)
+if __args__.keywords is None:
+return None
+# CCC: we should probably have a @jit.look_inside_iff if the
+# keyword count is constant, as we do in Arguments.unpack
+w_kwargs = space.newdict()
+for i in range(len(__args__.keywords)):
+key = __args__.keywords[i]
+w_obj = __args__.keywords_w[i]
+space.setitem(w_kwargs, space.newtext(key), w_obj)
 return w_kwargs
 
 class W_PyCFunctionObject(W_Root):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2019-02-18 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r96043:991f167e4663
Date: 2019-02-18 09:35 +0100
http://bitbucket.org/pypy/pypy/changeset/991f167e4663/

Log:fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py 
b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -43,7 +43,7 @@
 guard_no_exception(descr=...)
 i100 = int_lt(i98, 0)
 guard_true(i100, descr=...)
-i102 = 
call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), 
p55, i83, 1, i87, descr=)
+i102 = 
call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), 
p55, i83, 1, i89, descr=)
 guard_true(i102, descr=...)
 i104 = int_add(i74, 1)
 --TICK--
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2019-02-16 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r96028:63c291824396
Date: 2019-02-16 15:17 +0100
http://bitbucket.org/pypy/pypy/changeset/63c291824396/

Log:Fix test

diff --git a/pypy/module/cpyext/test/test_typeobject.py 
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -528,7 +528,8 @@
 
 py_type = rffi.cast(PyTypeObjectPtr, ref)
 assert py_type.c_tp_alloc
-assert from_ref(space, py_type.c_tp_mro).wrappeditems is w_class.mro_w
+w_tup = from_ref(space, py_type.c_tp_mro)
+assert space.fixedview(w_tup) == w_class.mro_w
 
 decref(space, ref)
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2019-02-16 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r96027:7fad2f4ca232
Date: 2019-02-16 14:30 +0100
http://bitbucket.org/pypy/pypy/changeset/7fad2f4ca232/

Log:Fix test

diff --git a/pypy/module/cpyext/test/test_sequence.py 
b/pypy/module/cpyext/test/test_sequence.py
--- a/pypy/module/cpyext/test/test_sequence.py
+++ b/pypy/module/cpyext/test/test_sequence.py
@@ -5,7 +5,7 @@
 from pypy.module.cpyext.sequence import (
 PySequence_Fast, PySequence_Contains, PySequence_Index,
 PySequence_GetItem, PySequence_SetItem, PySequence_DelItem)
-from pypy.module.cpyext.pyobject import get_w_obj_and_decref
+from pypy.module.cpyext.pyobject import get_w_obj_and_decref, from_ref
 from pypy.module.cpyext.state import State
 import pytest
 
@@ -22,7 +22,7 @@
 assert api.PySequence_Fast(w_l, "message") is w_l
 
 py_result = api.PySequence_Fast_GET_ITEM(w_l, 1)
-w_result = get_w_obj_and_decref(space, py_result)
+w_result = from_ref(space, py_result)
 assert space.int_w(w_result) == 2
 assert api.PySequence_Fast_GET_SIZE(w_l) == 4
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, logic was backwards

2019-02-15 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r96012:98b12ab55f09
Date: 2019-02-15 12:21 +0200
http://bitbucket.org/pypy/pypy/changeset/98b12ab55f09/

Log:fix test, logic was backwards

diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py
--- a/rpython/rlib/test/test_rutf8.py
+++ b/rpython/rlib/test/test_rutf8.py
@@ -152,7 +152,7 @@
 @example([u'\ud800', u'\udc00'])
 def test_surrogate_in_utf8(unichars):
 uni = ''.join([u.encode('utf8') for u in unichars])
-result = rutf8.surrogate_in_utf8(uni) < 0
+result = rutf8.surrogate_in_utf8(uni) >= 0
 expected = any(uch for uch in unichars if u'\ud800' <= uch <= u'\udfff')
 assert result == expected
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test for linux 32

2019-02-12 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r95968:20486c92ed2a
Date: 2019-02-12 12:54 +0200
http://bitbucket.org/pypy/pypy/changeset/20486c92ed2a/

Log:fix test for linux 32

diff --git a/rpython/memory/gc/test/test_direct.py 
b/rpython/memory/gc/test/test_direct.py
--- a/rpython/memory/gc/test/test_direct.py
+++ b/rpython/memory/gc/test/test_direct.py
@@ -781,7 +781,7 @@
 def large_malloc():
 # malloc an object which is large enough to trigger a major 
collection
 threshold = self.gc.next_major_collection_threshold
-self.malloc(VAR, int(threshold/8))
+self.malloc(VAR, int(threshold/4))
 summary = debuglog.summary()
 debuglog.reset()
 return summary
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2019-01-08 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r95587:0916788c705e
Date: 2019-01-08 09:10 +0100
http://bitbucket.org/pypy/pypy/changeset/0916788c705e/

Log:Fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py 
b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
--- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
@@ -407,6 +407,7 @@
 i138 = call_i(ConstClass(_ll_1_raw_malloc_varsize_zero__Signed), 6, 
descr=...)
 check_memory_error(i138)
 setfield_gc(p132, i138, descr=...)
+setfield_gc(p132, 0, descr=...)
 setfield_gc(p132, ConstPtr(ptr139), descr=...)
 setfield_gc(p132, -1, descr=...)
 setfield_gc(p0, p133, descr=...)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2018-11-30 Thread cfbolz
Author: Carl Friedrich Bolz-Tereick 
Branch: 
Changeset: r95389:a2d417aec82f
Date: 2018-11-30 16:15 +0100
http://bitbucket.org/pypy/pypy/changeset/a2d417aec82f/

Log:fix test

diff --git a/rpython/translator/c/test/test_standalone.py 
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -521,11 +521,9 @@
 assert path.check(file=0)
 
 def test_debug_start_stop_timestamp(self):
-import sys
-import time
 from rpython.rlib.rtimer import read_timestamp
 def entry_point(argv):
-timestamp = int(argv[1])
+timestamp = bool(int(argv[1]))
 ts1 = debug_start("foo", timestamp=timestamp)
 ts2 = read_timestamp()
 ts3 = debug_stop("foo", timestamp=timestamp)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test on win32, also cleanup uneeded export of function from libpypy

2018-11-10 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r95291:286138f59bc3
Date: 2018-11-10 20:55 -0800
http://bitbucket.org/pypy/pypy/changeset/286138f59bc3/

Log:fix test on win32, also cleanup uneeded export of function from
libpypy

diff --git a/pypy/module/sys/initpath.py b/pypy/module/sys/initpath.py
--- a/pypy/module/sys/initpath.py
+++ b/pypy/module/sys/initpath.py
@@ -188,8 +188,8 @@
 #endif
 #include 
 #include 
+#include 
 
-RPY_EXPORTED
 char *_pypy_init_home(void)
 {
 HMODULE hModule = 0;
@@ -225,7 +225,6 @@
 #include 
 #include 
 
-RPY_EXPORTED
 char *_pypy_init_home(void)
 {
 Dl_info info;
@@ -243,11 +242,27 @@
 }
 """
 
+_source_code += """
+inline
+void _pypy_init_free(char *p)
+{
+free(p);
+}
+"""
+
+if we_are_translated():
+   post_include_bits = []
+else:
+# for tests 
+post_include_bits=['RPY_EXPORTED char *_pypy_init_home(void);',
+   'RPY_EXPORTED void _pypy_init_free(char*);',
+  ]
+
 _eci = ExternalCompilationInfo(separate_module_sources=[_source_code],
-post_include_bits=['RPY_EXPORTED char *_pypy_init_home(void);'])
+   post_include_bits=post_include_bits)
 _eci = _eci.merge(rdynload.eci)
 
 pypy_init_home = rffi.llexternal("_pypy_init_home", [], rffi.CCHARP,
  _nowrapper=True, compilation_info=_eci)
-pypy_init_free = rffi.llexternal("free", [rffi.CCHARP], lltype.Void,
+pypy_init_free = rffi.llexternal("_pypy_init_free", [rffi.CCHARP], lltype.Void,
  _nowrapper=True, compilation_info=_eci)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2018-10-26 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r95250:b01d1db30165
Date: 2018-10-26 12:01 +0200
http://bitbucket.org/pypy/pypy/changeset/b01d1db30165/

Log:fix test

diff --git a/pypy/module/cpyext/test/test_misc.py 
b/pypy/module/cpyext/test/test_misc.py
--- a/pypy/module/cpyext/test/test_misc.py
+++ b/pypy/module/cpyext/test/test_misc.py
@@ -16,7 +16,7 @@
 '''),
 ], prologue='''
 static long my_flag = 0;
-static int my_callback(void) { my_flag++; }
+static int my_callback(void) { return ++my_flag; }
 ''')
 
 try:
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2018-09-19 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r95145:4ffcc8f9acd4
Date: 2018-09-19 17:22 +0200
http://bitbucket.org/pypy/pypy/changeset/4ffcc8f9acd4/

Log:fix test

diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -36,3 +36,6 @@
 .. branch: pyparser-improvements-3
 
 Small refactorings in the Python parser.
+
+.. branch: fix-readme-typo
+
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2018-06-29 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r94785:435136eb0bac
Date: 2018-06-29 07:36 -0700
http://bitbucket.org/pypy/pypy/changeset/435136eb0bac/

Log:fix test

diff --git a/pypy/module/cpyext/test/test_object.py 
b/pypy/module/cpyext/test/test_object.py
--- a/pypy/module/cpyext/test/test_object.py
+++ b/pypy/module/cpyext/test/test_object.py
@@ -5,7 +5,7 @@
 from rpython.rtyper.lltypesystem import rffi, lltype
 from pypy.module.cpyext.pyobject import get_w_obj_and_decref
 from pypy.module.cpyext.api import (
-Py_LT, Py_LE, Py_NE, Py_EQ, Py_GE, Py_GT)
+Py_LT, Py_LE, Py_NE, Py_EQ, Py_GE, Py_GT, INTP_real)
 from pypy.module.cpyext.object import (
 PyObject_IsTrue, PyObject_Not, PyObject_GetAttrString,
 PyObject_DelAttrString, PyObject_GetAttr, PyObject_DelAttr,
@@ -205,7 +205,7 @@
 
 def test_cmp(self, space, api):
 w = space.wrap
-with lltype.scoped_alloc(rffi.INTP.TO, 1) as ptr:
+with lltype.scoped_alloc(INTP_real.TO, 1) as ptr:
 assert api.PyObject_Cmp(w(42), w(72), ptr) == 0
 assert ptr[0] == -1
 assert api.PyObject_Cmp(w("a"), w("a"), ptr) == 0
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test for python3, remove implemented functions from stubs.py

2018-05-14 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r94570:a8e6b2583cbc
Date: 2018-05-14 14:39 +0300
http://bitbucket.org/pypy/pypy/changeset/a8e6b2583cbc/

Log:fix test for python3, remove implemented functions from stubs.py

diff --git a/pypy/module/cpyext/stubs.py b/pypy/module/cpyext/stubs.py
--- a/pypy/module/cpyext/stubs.py
+++ b/pypy/module/cpyext/stubs.py
@@ -1261,13 +1261,6 @@
 version indicates the file format."""
 raise NotImplementedError
 
-@cpython_api([PyObject, rffi.INT_real], PyObject)
-def PyMarshal_WriteObjectToString(space, value, version):
-"""Return a string object containing the marshalled representation of 
value.
-
-version indicates the file format."""
-raise NotImplementedError
-
 @cpython_api([FILE], lltype.Signed, error=CANNOT_FAIL)
 def PyMarshal_ReadLongFromFile(space, file):
 """Return a C long from the data stream in a FILE* opened
@@ -1301,17 +1294,6 @@
 (EOFError or TypeError) and returns NULL."""
 raise NotImplementedError
 
-@cpython_api([rffi.CCHARP, Py_ssize_t], PyObject)
-def PyMarshal_ReadObjectFromString(space, string, len):
-"""Return a Python object from the data stream in a character buffer
-containing len bytes pointed to by string.  On error, sets the
-appropriate exception (EOFError or TypeError) and returns
-NULL.
-
-This function used an int type for len. This might require
-changes in your code for properly supporting 64-bit systems."""
-raise NotImplementedError
-
 @cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
 def PyMethod_ClearFreeList(space):
 """Clear the free list. Return the total number of freed items.
diff --git a/pypy/module/cpyext/test/test_marshal.py 
b/pypy/module/cpyext/test/test_marshal.py
--- a/pypy/module/cpyext/test/test_marshal.py
+++ b/pypy/module/cpyext/test/test_marshal.py
@@ -6,8 +6,8 @@
 module = self.import_extension('foo', [
 ("mloads", "METH_O",
  """
- char *input = PyString_AsString(args);
- Py_ssize_t length = PyString_Size(args);
+ char *input = PyBytes_AsString(args);
+ Py_ssize_t length = PyBytes_Size(args);
  return PyMarshal_ReadObjectFromString(input, length);
  """)],
 prologue='#include ')
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2018-02-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r93780:14abb2e081c8
Date: 2018-02-07 15:47 +0200
http://bitbucket.org/pypy/pypy/changeset/14abb2e081c8/

Log:fix test

diff --git a/pypy/module/cpyext/test/test_object.py 
b/pypy/module/cpyext/test/test_object.py
--- a/pypy/module/cpyext/test/test_object.py
+++ b/pypy/module/cpyext/test/test_object.py
@@ -244,7 +244,7 @@
 
 if not cls.runappdirect:
 cls.total_mem = 0
-def add_memory_pressure(estimate):
+def add_memory_pressure(estimate, object=None):
 assert estimate >= 0
 cls.total_mem += estimate
 cls.orig_add_memory_pressure = [rgc.add_memory_pressure]
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test (hopefully, 2nd try)

2018-01-21 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r93694:c40886d72bc2
Date: 2018-01-21 10:53 +0100
http://bitbucket.org/pypy/pypy/changeset/c40886d72bc2/

Log:fix test (hopefully, 2nd try)

diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py 
b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -76,7 +76,7 @@
 i23 = strgetitem(p10, i19)
 p25 = newstr(1)
 strsetitem(p25, 0, i23)
-p93 = call_r(ConstClass(fromstr), p25, 16, 0, descr=)
+p93 = call_r(ConstClass(fromstr), p25, 16, 0, descr=)
 guard_no_exception(descr=...)
 i95 = getfield_gc_i(p93, descr=)
 i96 = int_gt(i95, #)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test: missing incref

2017-12-17 Thread rlamy
Author: Ronan Lamy 
Branch: 
Changeset: r93448:a560a9381f17
Date: 2017-12-17 13:22 +
http://bitbucket.org/pypy/pypy/changeset/a560a9381f17/

Log:Fix test: missing incref

diff --git a/pypy/module/cpyext/test/test_tupleobject.py 
b/pypy/module/cpyext/test/test_tupleobject.py
--- a/pypy/module/cpyext/test/test_tupleobject.py
+++ b/pypy/module/cpyext/test/test_tupleobject.py
@@ -1,6 +1,7 @@
 import py
 
-from pypy.module.cpyext.pyobject import PyObject, PyObjectP, make_ref, from_ref
+from pypy.module.cpyext.pyobject import (
+PyObject, PyObjectP, make_ref, from_ref, incref)
 from pypy.module.cpyext.test.test_api import BaseApiTest, raises_w
 from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
 from rpython.rtyper.lltypesystem import rffi, lltype
@@ -14,6 +15,7 @@
 def test_tupleobject(self, space):
 assert not PyTuple_Check(space, space.w_None)
 with raises_w(space, SystemError):
+incref(space, space.w_None)
 PyTuple_SetItem(space, space.w_None, 0, space.w_None)
 atuple = space.newtuple([space.wrap(0), space.wrap(1),
  space.wrap('yay')])
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test use of eci for vmprof_start_sampling, vmprof_start_sampling

2017-11-23 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r93151:72001f56a97f
Date: 2017-11-23 20:28 +0200
http://bitbucket.org/pypy/pypy/changeset/72001f56a97f/

Log:fix test use of eci for vmprof_start_sampling, vmprof_start_sampling

diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -9,6 +9,7 @@
 from rpython.rtyper.tool import rffi_platform as platform
 from rpython.rlib import rthread, jit
 from rpython.rlib.objectmodel import we_are_translated
+from rpython.config.translationoption import get_translation_config
 
 class VMProfPlatformUnsupported(Exception):
 pass
@@ -133,11 +134,17 @@
 #endif
 """])
 
+if get_translation_config() is None:
+# tests need the full eci here
+_eci = global_eci
+else:
+_eci = auto_eci
+
 vmprof_stop_sampling = rffi.llexternal("vmprof_stop_sampling", [],
-   rffi.INT, compilation_info=auto_eci,
+   rffi.INT, compilation_info=_eci,
_nowrapper=True)
 vmprof_start_sampling = rffi.llexternal("vmprof_start_sampling", [],
-lltype.Void, compilation_info=auto_eci,
+lltype.Void, compilation_info=_eci,
 _nowrapper=True)
 
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test to pass on win32

2017-09-20 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r92424:6a339c39b5eb
Date: 2017-09-20 17:36 +0300
http://bitbucket.org/pypy/pypy/changeset/6a339c39b5eb/

Log:fix test to pass on win32

diff --git a/pypy/module/cpyext/test/test_eval.py 
b/pypy/module/cpyext/test/test_eval.py
--- a/pypy/module/cpyext/test/test_eval.py
+++ b/pypy/module/cpyext/test/test_eval.py
@@ -344,7 +344,7 @@
 int recurse(void);
 res = 0;
 oldlimit = Py_GetRecursionLimit();
-Py_SetRecursionLimit(200);
+Py_SetRecursionLimit(oldlimit/100);
 res = recurse();
 Py_SetRecursionLimit(oldlimit);
 if (PyErr_Occurred())
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test on 32-bit

2017-06-04 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r91506:e2ba7d32b791
Date: 2017-06-04 10:27 +0200
http://bitbucket.org/pypy/pypy/changeset/e2ba7d32b791/

Log:Fix test on 32-bit

diff --git a/rpython/jit/backend/x86/test/test_runner.py 
b/rpython/jit/backend/x86/test/test_runner.py
--- a/rpython/jit/backend/x86/test/test_runner.py
+++ b/rpython/jit/backend/x86/test/test_runner.py
@@ -33,7 +33,7 @@
 add_loop_instructions = ('mov; '
  'lea; '# a nop, for the label
  'add; test; je; jmp;')   # plus some padding
-bridge_loop_instructions = 'cmp; jge; mov; mov; call; jmp;'
+bridge_loop_instructions = 'cmp; jl; jmp;'
 else:
 add_loop_instructions = ('mov; '
  'nop; '# for the label
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2017-05-28 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r91430:0d24dcc53f09
Date: 2017-05-28 16:43 +0200
http://bitbucket.org/pypy/pypy/changeset/0d24dcc53f09/

Log:Fix test

diff --git a/rpython/rtyper/llinterp.py b/rpython/rtyper/llinterp.py
--- a/rpython/rtyper/llinterp.py
+++ b/rpython/rtyper/llinterp.py
@@ -862,6 +862,9 @@
 def op_gc_adr_of_root_stack_top(self):
 raise NotImplementedError
 
+def op_gc_modified_shadowstack(self):
+raise NotImplementedError
+
 def op_gc_call_rtti_destructor(self, rtti, addr):
 if hasattr(rtti._obj, 'destructor_funcptr'):
 d = rtti._obj.destructor_funcptr
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2017-05-28 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r91429:659988b39888
Date: 2017-05-28 16:42 +0200
http://bitbucket.org/pypy/pypy/changeset/659988b39888/

Log:Fix test

diff --git a/rpython/jit/backend/llsupport/test/test_gc_integration.py 
b/rpython/jit/backend/llsupport/test/test_gc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_gc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_gc_integration.py
@@ -463,6 +463,21 @@
 def get_root_stack_top_addr(self):
 return rffi.cast(lltype.Signed, self.stack_addr)
 
+def getlength(self):
+top = self.stack_addr[0]
+base = rffi.cast(lltype.Signed, self.stack)
+n = (top - base) // WORD
+assert 0 <= n < 10
+return n
+
+def curtop(self):
+n = self.getlength()
+return self.stack[n - 1]
+
+def settop(self, newvalue):
+n = self.getlength()
+self.stack[n - 1] = newvalue
+
 class WriteBarrierDescr(AbstractDescr):
 jit_wb_cards_set = 0
 jit_wb_if_flag_singlebyte = 1
@@ -645,7 +660,7 @@
 frames = []
 
 def check(i):
-assert cpu.gc_ll_descr.gcrootmap.stack[0] == i
+assert cpu.gc_ll_descr.gcrootmap.curtop() == i
 frame = rffi.cast(JITFRAMEPTR, i)
 assert len(frame.jf_frame) == self.cpu.JITFRAME_FIXED_SIZE + 4
 # we "collect"
@@ -665,14 +680,14 @@
 assert gcmap == [22, 23, 24]
 for item, s in zip(gcmap, new_items):
 new_frame.jf_frame[item] = rffi.cast(lltype.Signed, s)
-assert cpu.gc_ll_descr.gcrootmap.stack[0] == 
rffi.cast(lltype.Signed, frame)
-cpu.gc_ll_descr.gcrootmap.stack[0] = rffi.cast(lltype.Signed, 
new_frame)
+assert cpu.gc_ll_descr.gcrootmap.curtop() == 
rffi.cast(lltype.Signed, frame)
+cpu.gc_ll_descr.gcrootmap.settop(rffi.cast(lltype.Signed, 
new_frame))
 print '"Collecting" moved the frame from %d to %d' % (
-i, cpu.gc_ll_descr.gcrootmap.stack[0])
+i, cpu.gc_ll_descr.gcrootmap.curtop())
 frames.append(new_frame)
 
 def check2(i):
-assert cpu.gc_ll_descr.gcrootmap.stack[0] == i
+assert cpu.gc_ll_descr.gcrootmap.curtop() == i
 frame = rffi.cast(JITFRAMEPTR, i)
 assert frame == frames[1]
 assert frame != frames[0]
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2017-05-16 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91312:e45afbe0ded7
Date: 2017-05-16 13:53 +0300
http://bitbucket.org/pypy/pypy/changeset/e45afbe0ded7/

Log:fix test

diff --git a/pypy/module/cpyext/test/test_dictobject.py 
b/pypy/module/cpyext/test/test_dictobject.py
--- a/pypy/module/cpyext/test/test_dictobject.py
+++ b/pypy/module/cpyext/test/test_dictobject.py
@@ -298,7 +298,7 @@
 while (PyDict_Next(arg, , , ))
 ret ++;
 /* test no crash if pos is not reset to 0*/
-while (PyDict_Next(args, , , ))
+while (PyDict_Next(arg, , , ))
 ret ++;
 }
 }
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test to make a bit more sense.

2017-04-22 Thread mjacob
Author: Manuel Jacob 
Branch: 
Changeset: r91116:9ef459636100
Date: 2017-04-22 23:06 +0200
http://bitbucket.org/pypy/pypy/changeset/9ef459636100/

Log:Fix test to make a bit more sense.

diff --git a/pypy/module/test_lib_pypy/test_md5_extra.py 
b/pypy/module/test_lib_pypy/test_md5_extra.py
--- a/pypy/module/test_lib_pypy/test_md5_extra.py
+++ b/pypy/module/test_lib_pypy/test_md5_extra.py
@@ -69,7 +69,7 @@
 
 # Update and compare...
 for i in range(len(cases)):
-message = cases[i][0]
+message = cases[i]
 
 m1c.update(message)
 d1 = m1c.hexdigest()
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test (expecting AssertionError now for out-of-bounds unsafe access)

2017-04-01 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r90888:e21e09d948c3
Date: 2017-04-01 10:45 +0200
http://bitbucket.org/pypy/pypy/changeset/e21e09d948c3/

Log:Fix test (expecting AssertionError now for out-of-bounds unsafe
access)

diff --git a/rpython/rlib/rstrategies/test/test_rstrategies.py 
b/rpython/rlib/rstrategies/test/test_rstrategies.py
--- a/rpython/rlib/rstrategies/test/test_rstrategies.py
+++ b/rpython/rlib/rstrategies/test/test_rstrategies.py
@@ -204,7 +204,7 @@
 if is_safe:
 py.test.raises(IndexError, s.fetch, l, -1)
 else:
-assert s.fetch(l, -1) == s.fetch(l, size - 1)
+py.test.raises(AssertionError, s.fetch, l, -1)
 
 def test_init_Empty():
 l = W_List(EmptyStrategy, 0)
@@ -249,7 +249,7 @@
 if is_safe:
 py.test.raises(IndexError, s.store, l, -1, stored_value)
 else:
-store_test(-1)
+py.test.raises(AssertionError, s.store, l, -1, stored_value)
 
 def test_store_Nil():
 do_test_store(NilStrategy, stored_value=w_nil)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix (test by running "py.test -A" on pypy enough times until it crashes,

2017-03-14 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r90668:5fd8b95992bb
Date: 2017-03-14 08:35 +0100
http://bitbucket.org/pypy/pypy/changeset/5fd8b95992bb/

Log:Fix (test by running "py.test -A" on pypy enough times until it
crashes, with options like MALLOC_CHECK_=7 to detect writes out of
bound)

diff --git a/pypy/module/cpyext/test/test_tupleobject.py 
b/pypy/module/cpyext/test/test_tupleobject.py
--- a/pypy/module/cpyext/test/test_tupleobject.py
+++ b/pypy/module/cpyext/test/test_tupleobject.py
@@ -154,5 +154,10 @@
 
 def test_tuple_subclass(self):
 module = self.import_module(name='foo')
-a = module.TupleLike([1, 2, 3])
+a = module.TupleLike(range(100, 400, 100))
 assert module.is_TupleLike(a) == 1
+assert isinstance(a, tuple)
+assert issubclass(type(a), tuple)
+assert list(a) == range(100, 400, 100)
+assert list(a) == range(100, 400, 100)
+assert list(a) == range(100, 400, 100)
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -418,8 +418,8 @@
 
 def inherit_special(space, pto, base_pto):
 # XXX missing: copy basicsize and flags in a magical way
-# (minimally, if tp_basicsize is zero we copy it from the base)
-if not pto.c_tp_basicsize:
+# (minimally, if tp_basicsize is zero or too low, we copy it from the base)
+if pto.c_tp_basicsize < base_pto.c_tp_basicsize:
 pto.c_tp_basicsize = base_pto.c_tp_basicsize
 if pto.c_tp_itemsize < base_pto.c_tp_itemsize:
 pto.c_tp_itemsize = base_pto.c_tp_itemsize
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test (mostly, but I'm not sure I understand why it doesn't seem to

2017-03-04 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r90550:1a55bff39061
Date: 2017-03-05 08:44 +0100
http://bitbucket.org/pypy/pypy/changeset/1a55bff39061/

Log:Fix test (mostly, but I'm not sure I understand why it doesn't seem
to crash in a full pypy)

diff --git a/rpython/jit/metainterp/optimizeopt/info.py 
b/rpython/jit/metainterp/optimizeopt/info.py
--- a/rpython/jit/metainterp/optimizeopt/info.py
+++ b/rpython/jit/metainterp/optimizeopt/info.py
@@ -773,24 +773,33 @@
 from rpython.jit.metainterp.optimizeopt.intutils import ConstIntBound,\
 IntLowerBound
 
-if mode is None:
+length = self.getstrlen1(mode)
+if length < 0:
 # XXX we can do better if we know it's an array
 return IntLowerBound(0)
-else:
-return ConstIntBound(self.getstrlen1(mode))
+return ConstIntBound(length)
 
 def getstrlen(self, op, string_optimizer, mode):
-return ConstInt(self.getstrlen1(mode))
+length = self.getstrlen1(mode)
+if length < 0:
+return None
+return ConstInt(length)
 
 def getstrlen1(self, mode):
 from rpython.jit.metainterp.optimizeopt import vstring
-
+
 if mode is vstring.mode_string:
 s = self._unpack_str(vstring.mode_string)
+if s is None:
+return -1
+return len(s)
+elif mode is vstring.mode_unicode:
+s = self._unpack_str(vstring.mode_unicode)
+if s is None:
+return -1
 return len(s)
 else:
-s = self._unpack_str(vstring.mode_unicode)
-return len(s)
+return -1
 
 def getstrhash(self, op, mode):
 from rpython.jit.metainterp.optimizeopt import vstring
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test on my laptop

2017-02-23 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r90335:c5721c39a21f
Date: 2017-02-24 08:39 +0100
http://bitbucket.org/pypy/pypy/changeset/c5721c39a21f/

Log:fix test on my laptop

diff --git a/rpython/translator/c/test/test_newgc.py 
b/rpython/translator/c/test/test_newgc.py
--- a/rpython/translator/c/test/test_newgc.py
+++ b/rpython/translator/c/test/test_newgc.py
@@ -1730,7 +1730,11 @@
  (ulimitv, ' '.join(args),)]
 popen = subprocess.Popen(args1, stderr=subprocess.PIPE)
 _, child_stderr = popen.communicate()
-assert popen.wait() == 134 # aborted
+assert popen.wait() in (-6, 134) # aborted
+# note: it seems that on some systems we get 134 and on
+# others we get -6.  Bash is supposed to translate the
+# SIGABRT (signal 6) from the subprocess into the exit 
+# code 128+6, but I guess it may not always do so.
 assert 'out of memory:' in child_stderr
 return '42'
 #
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test: now only three residual calls instead of four

2017-02-06 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r89964:bff2e6940cc6
Date: 2017-02-06 09:00 +0100
http://bitbucket.org/pypy/pypy/changeset/bff2e6940cc6/

Log:fix test: now only three residual calls instead of four

diff --git a/rpython/jit/metainterp/test/test_dict.py 
b/rpython/jit/metainterp/test/test_dict.py
--- a/rpython/jit/metainterp/test/test_dict.py
+++ b/rpython/jit/metainterp/test/test_dict.py
@@ -364,7 +364,7 @@
 if n in mdict:
 raise Exception
 self.meta_interp(f, [10])
-self.check_simple_loop(call_may_force_i=0, call_i=3, call_n=1)
+self.check_simple_loop(call_may_force_i=0, call_i=2, call_n=1)
 
 def test_dict_virtual(self):
 myjitdriver = JitDriver(greens = [], reds = 'auto')
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2017-02-02 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r89903:cc6165679b16
Date: 2017-02-02 17:25 +0100
http://bitbucket.org/pypy/pypy/changeset/cc6165679b16/

Log:fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_misc.py 
b/pypy/module/pypyjit/test_pypy_c/test_misc.py
--- a/pypy/module/pypyjit/test_pypy_c/test_misc.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_misc.py
@@ -273,7 +273,7 @@
 i21 = getfield_gc_i(p17, descr=)
 i23 = int_lt(0, i21)
 guard_true(i23, descr=...)
-i24 = getfield_gc_i(p17, descr=)
+i24 = getfield_gc_i(p17, descr=)
 i25 = getarrayitem_raw_i(i24, 0, descr=<.*>)
 i27 = int_lt(1, i21)
 guard_false(i27, descr=...)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2017-01-26 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r89781:8ecc4591e7ec
Date: 2017-01-26 10:02 +0100
http://bitbucket.org/pypy/pypy/changeset/8ecc4591e7ec/

Log:fix test

diff --git a/pypy/interpreter/test/test_appinterp.py 
b/pypy/interpreter/test/test_appinterp.py
--- a/pypy/interpreter/test/test_appinterp.py
+++ b/pypy/interpreter/test/test_appinterp.py
@@ -23,7 +23,9 @@
 (): 
 y y 
 """)
-assert str(excinfo.value.errorstr(space)).find('y y') != -1 
+# NOTE: the following test only works because excinfo.value is not
+# normalized so far
+assert str(excinfo.value.get_w_value(space)).find('y y') != -1 
 
 def test_simple_applevel(space):
 app = appdef("""app(x,y): 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test - call Py_DecRef on PyObject to allow finalizer to run

2017-01-16 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r89621:13bdc04dc6d2
Date: 2017-01-16 23:20 +0200
http://bitbucket.org/pypy/pypy/changeset/13bdc04dc6d2/

Log:fix test - call Py_DecRef on PyObject to allow finalizer to run

diff --git a/pypy/module/cpyext/test/test_memoryobject.py 
b/pypy/module/cpyext/test/test_memoryobject.py
--- a/pypy/module/cpyext/test/test_memoryobject.py
+++ b/pypy/module/cpyext/test/test_memoryobject.py
@@ -30,13 +30,14 @@
 assert view.c_len == 5
 o = rffi.charp2str(view.c_buf)
 assert o == 'hello'
-w_mv = from_ref(space, api.PyMemoryView_FromBuffer(view))
+ref = api.PyMemoryView_FromBuffer(view)
+w_mv = from_ref(space, ref)
 for f in ('format', 'itemsize', 'ndim', 'readonly', 
   'shape', 'strides', 'suboffsets'):
 w_f = space.wrap(f)
 assert space.eq_w(space.getattr(w_mv, w_f), 
   space.getattr(w_memoryview, w_f))
-
+api.Py_DecRef(ref)
 
 class AppTestPyBuffer_FillInfo(AppTestCpythonExtensionBase):
 def test_fillWithObject(self):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2017-01-02 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r89308:aa9ae054b625
Date: 2017-01-02 18:00 +0100
http://bitbucket.org/pypy/pypy/changeset/aa9ae054b625/

Log:fix test

diff --git a/pypy/module/_socket/test/test_sock_app.py 
b/pypy/module/_socket/test/test_sock_app.py
--- a/pypy/module/_socket/test/test_sock_app.py
+++ b/pypy/module/_socket/test/test_sock_app.py
@@ -495,7 +495,8 @@
 def test_socket_connect_typeerrors(self):
 tests = [
 "",
-("80"),
+"80",
+("80",),
 ("80", "80"),
 (80, 80),
 ]
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-12-07 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r88924:e8f04195dde5
Date: 2016-12-07 09:33 +0100
http://bitbucket.org/pypy/pypy/changeset/e8f04195dde5/

Log:fix test

diff --git a/pypy/module/_cffi_backend/test/test_ffi_obj.py 
b/pypy/module/_cffi_backend/test/test_ffi_obj.py
--- a/pypy/module/_cffi_backend/test/test_ffi_obj.py
+++ b/pypy/module/_cffi_backend/test/test_ffi_obj.py
@@ -401,7 +401,8 @@
 retries += 1
 assert retries <= 5
 import gc; gc.collect()
-assert seen == [40, 40, raw1, raw2]
+assert (seen == [40, 40, raw1, raw2] or
+seen == [40, 40, raw2, raw1])
 assert repr(seen[2]) == ""
 assert repr(seen[3]) == ""
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-11-10 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r88285:76a9a43a1e8c
Date: 2016-11-10 09:45 +0100
http://bitbucket.org/pypy/pypy/changeset/76a9a43a1e8c/

Log:fix test

diff --git a/rpython/rlib/rarithmetic.py b/rpython/rlib/rarithmetic.py
--- a/rpython/rlib/rarithmetic.py
+++ b/rpython/rlib/rarithmetic.py
@@ -340,7 +340,10 @@
 def __mul__(self, other):
 x = long(self)
 y = other  # may be a float
-return self._widen(other, x * y)
+z = x * y
+if isinstance(z, (int, long)):
+z = self._widen(other, z)
+return z
 __rmul__ = __mul__
 
 def __div__(self, other):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-11-08 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r88204:95700489ad41
Date: 2016-11-08 11:36 +0100
http://bitbucket.org/pypy/pypy/changeset/95700489ad41/

Log:fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py 
b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
--- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
@@ -418,7 +418,7 @@
 guard_no_exception(descr=...)
 i112 = int_signext(i160, 2)
 setfield_gc(p167, ConstPtr(ptr85), descr=)
-setfield_gc(p167, -1, descr=)
+setfield_gc(p167, -1, descr=)
 i114 = int_ne(i160, i112)
 guard_false(i114, descr=...)
 --TICK--
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test on CPython: _PyObject_NewVar does not initialise the memory

2016-10-06 Thread rlamy
Author: Ronan Lamy 
Branch: 
Changeset: r87613:b0e70c0c2ac0
Date: 2016-10-06 16:43 +0100
http://bitbucket.org/pypy/pypy/changeset/b0e70c0c2ac0/

Log:fix test on CPython: _PyObject_NewVar does not initialise the memory

diff --git a/pypy/module/cpyext/test/test_bytesobject.py 
b/pypy/module/cpyext/test/test_bytesobject.py
--- a/pypy/module/cpyext/test/test_bytesobject.py
+++ b/pypy/module/cpyext/test/test_bytesobject.py
@@ -105,7 +105,7 @@
  '''),
 ])
 s = module.alloc_rw()
-assert s == b'works' + b'\x00' * 5
+assert s[:6] == b'works\0'  # s[6:10] contains random garbage
 s = module.tpalloc()
 assert s == b'\x00' * 10
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test for arm

2016-10-01 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r87499:87c5d21350cd
Date: 2016-10-01 15:46 +0200
http://bitbucket.org/pypy/pypy/changeset/87c5d21350cd/

Log:Fix test for arm

diff --git a/rpython/jit/backend/llsupport/test/test_gc_integration.py 
b/rpython/jit/backend/llsupport/test/test_gc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_gc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_gc_integration.py
@@ -323,13 +323,10 @@
 def test_malloc_slowpath(self):
 def check(frame):
 expected_size = 1
-idx = 0
 fixed_size = self.cpu.JITFRAME_FIXED_SIZE
 if self.cpu.backend_name.startswith('arm'):
 # jitframe fixed part is larger here
 expected_size = 2
-idx = 1
-fixed_size -= 32
 if self.cpu.backend_name.startswith('zarch') or \
self.cpu.backend_name.startswith('ppc'):
 # the allocation always allocates the register
@@ -342,7 +339,10 @@
 # registers (p0 and p1 are moved away when doing p2, but not
 # spilled, just moved to different registers)
 bits = [n for n in range(fixed_size)
-  if frame.jf_gcmap[idx] & (1< 1:
+bits += [n for n in range(32, fixed_size)
+   if frame.jf_gcmap[1] & (1<<(n - 32))]
 assert len(bits) == 2
 
 self.cpu = self.getcpu(check)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2016-09-26 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r87386:7472cf9b0cd7
Date: 2016-09-26 08:49 +0200
http://bitbucket.org/pypy/pypy/changeset/7472cf9b0cd7/

Log:Fix test

diff --git a/pypy/interpreter/test/test_app_main.py 
b/pypy/interpreter/test/test_app_main.py
--- a/pypy/interpreter/test/test_app_main.py
+++ b/pypy/interpreter/test/test_app_main.py
@@ -1030,8 +1030,8 @@
 # If we are running PyPy with a libpypy-c, the following
 # lines find the stdlib anyway.  Otherwise, it is not found.
 expected_found = (
-'__pypy__' in sys.builtin_module_names and
-sys.pypy_translation_info['translation.shared'])
+getattr(sys, 'pypy_translation_info', {})
+.get('translation.shared'))
 
 import app_main
 app_main.setup_bootstrap_path(tmp_pypy_c)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2016-08-22 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r86430:f8852bc52436
Date: 2016-08-23 01:00 +0200
http://bitbucket.org/pypy/pypy/changeset/f8852bc52436/

Log:Fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py 
b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
--- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
@@ -423,7 +423,7 @@
 guard_false(i114, descr=...)
 --TICK--
 i123 = arraylen_gc(p67, descr=)
-i119 = call_i(ConstClass(_ll_1_raw_malloc_varsize__Signed), 6, 
descr=)
+i119 = call_i(ConstClass(_ll_1_raw_malloc_varsize_zero__Signed), 6, 
descr=)
 check_memory_error(i119)
 raw_store(i119, 0, i160, descr=)
 raw_store(i119, 2, i160, descr=)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, realloc frees the input ptr if it is realloc() ed

2016-08-08 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r86086:cffad389be1e
Date: 2016-08-08 20:07 +0300
http://bitbucket.org/pypy/pypy/changeset/cffad389be1e/

Log:fix test, realloc frees the input ptr if it is realloc() ed

diff --git a/pypy/module/cpyext/test/test_object.py 
b/pypy/module/cpyext/test/test_object.py
--- a/pypy/module/cpyext/test/test_object.py
+++ b/pypy/module/cpyext/test/test_object.py
@@ -245,12 +245,11 @@
  char *copy, *orig = PyObject_MALLOC(12);
  memcpy(orig, "hello world", 12);
  copy = PyObject_REALLOC(orig, 15);
+ /* realloc() takes care of freeing orig, if changed */
  if (copy == NULL)
  Py_RETURN_NONE;
  ret = PyString_FromStringAndSize(copy, 12);
- if (copy != orig)
- PyObject_Free(copy);
- PyObject_Free(orig);
+ PyObject_Free(copy);
  return ret;
  """)])
 x = module.realloctest()
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-07-19 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r85766:173f3d27bfdb
Date: 2016-07-19 11:05 +0200
http://bitbucket.org/pypy/pypy/changeset/173f3d27bfdb/

Log:fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py 
b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
--- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py
@@ -424,6 +424,7 @@
 --TICK--
 i123 = arraylen_gc(p67, descr=)
 i119 = call_i(ConstClass(_ll_1_raw_malloc_varsize__Signed), 6, 
descr=)
+check_memory_error(i119)
 raw_store(i119, 0, i160, descr=)
 raw_store(i119, 2, i160, descr=)
 raw_store(i119, 4, i160, descr=)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test (after 4e4fa6046959, which gets rid of these unexpected

2016-06-13 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r85142:8030d6268539
Date: 2016-06-13 21:06 +0200
http://bitbucket.org/pypy/pypy/changeset/8030d6268539/

Log:Fix test (after 4e4fa6046959, which gets rid of these unexpected
getarrayitem_raw)

diff --git a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py 
b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
--- a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
@@ -163,14 +163,10 @@
 guard_not_invalidated(descr=...)
 i32 = float_ne(f31, 0.00)
 guard_true(i32, descr=...)
-i34 = getarrayitem_raw_i(#, #, descr=)  # XXX what are 
these?
-guard_value(i34, #, descr=...)  # XXX don't appear 
in
-i35 = getarrayitem_raw_i(#, #, descr=)  # XXX equiv 
test_zjit
 i36 = int_add(i24, 1)
 i37 = int_add(i29, 8)
 i38 = int_ge(i36, i30)
 guard_false(i38, descr=...)
-guard_value(i35, #, descr=...)  # XXX
 jump(..., descr=...)
 """)
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-06-10 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r85071:3586ac55f668
Date: 2016-06-10 11:39 +0200
http://bitbucket.org/pypy/pypy/changeset/3586ac55f668/

Log:fix test

diff --git a/rpython/memory/gc/test/test_direct.py 
b/rpython/memory/gc/test/test_direct.py
--- a/rpython/memory/gc/test/test_direct.py
+++ b/rpython/memory/gc/test/test_direct.py
@@ -554,6 +554,7 @@
 assert res # we optimized it
 assert hdr_dst.tid & minimark.GCFLAG_TRACK_YOUNG_PTRS == 0 # and we 
copied the flag
 #
+self.gc.card_page_indices = 128 # force > 0
 hdr_src.tid |= minimark.GCFLAG_TRACK_YOUNG_PTRS
 hdr_dst.tid |= minimark.GCFLAG_TRACK_YOUNG_PTRS
 hdr_src.tid |= minimark.GCFLAG_HAS_CARDS
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-04-07 Thread rlamy
Author: Ronan Lamy 
Branch: 
Changeset: r83575:e4e5f038ebbf
Date: 2016-04-07 16:58 +0100
http://bitbucket.org/pypy/pypy/changeset/e4e5f038ebbf/

Log:fix test

diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py
--- a/rpython/rlib/test/test_rposix.py
+++ b/rpython/rlib/test/test_rposix.py
@@ -104,7 +104,7 @@
 rposix.mkdir(filename, 0)
 assert excinfo.value.errno == errno.EEXIST
 if sys.platform == 'win32':
-assert exc.type is WindowsError
+assert excinfo.type is WindowsError
 
 @rposix_requires('mkdirat')
 def test_mkdirat(self):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2016-04-05 Thread Raemi
Author: Remi Meier 
Branch: 
Changeset: r83523:82e8cf34e4ab
Date: 2016-04-05 17:00 +0300
http://bitbucket.org/pypy/pypy/changeset/82e8cf34e4ab/

Log:fix test

diff --git a/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py 
b/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py
--- a/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py
+++ b/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py
@@ -6,6 +6,7 @@
 from rpython.rlib import rthread
 from rpython.translator.translator import TranslationContext
 from rpython.jit.backend.detect_cpu import getcpuclass
+from rpython.rlib.rweaklist import RWeakListMixin
 
 class CompiledVmprofTest(CCompiledMixin):
 CPUClass = getcpuclass()
@@ -21,6 +22,7 @@
 
 class MyCode:
 _vmprof_unique_id = 0
+_vmprof_weak_list = RWeakListMixin() ; 
_vmprof_weak_list.initialize()
 def __init__(self, name):
 self.name = name
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test after 3c4aee3b5f7a

2016-03-07 Thread mattip
Author: mattip 
Branch: 
Changeset: r82870:d3f6d015182f
Date: 2016-03-07 21:25 +0200
http://bitbucket.org/pypy/pypy/changeset/d3f6d015182f/

Log:fix test after 3c4aee3b5f7a

diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -240,6 +240,7 @@
   Kristjan Valur Jonsson
   David Lievens
   Neil Blakey-Milner
+  Sergey Matyunin
   Lutz Paelike
   Lucio Torre
   Lars Wassermann
@@ -271,6 +272,7 @@
   Aaron Tubbs
   Ben Darnell
   Roberto De Ioris
+  Logan Chien
   Juan Francisco Cantero Hurtado
   Ruochen Huang
   Jeong YunWon
diff --git a/pypy/doc/contributor.rst b/pypy/doc/contributor.rst
--- a/pypy/doc/contributor.rst
+++ b/pypy/doc/contributor.rst
@@ -210,6 +210,7 @@
   Kristjan Valur Jonsson
   David Lievens
   Neil Blakey-Milner
+  Sergey Matyunin
   Lutz Paelike
   Lucio Torre
   Lars Wassermann
@@ -241,6 +242,7 @@
   Aaron Tubbs
   Ben Darnell
   Roberto De Ioris
+  Logan Chien
   Juan Francisco Cantero Hurtado
   Ruochen Huang
   Jeong YunWon
diff --git a/rpython/translator/c/test/test_genc.py 
b/rpython/translator/c/test/test_genc.py
--- a/rpython/translator/c/test/test_genc.py
+++ b/rpython/translator/c/test/test_genc.py
@@ -596,7 +596,7 @@
 t.context._graphof(foobar_fn).inhibit_tail_call = True
 t.source_c()
 lines = t.driver.cbuilder.c_source_filename.join('..',
-  
'rpython_translator_c_test_test_genc.c').readlines()
+  'rpython_translator_c_test.c').readlines()
 for i, line in enumerate(lines):
 if '= pypy_g_foobar_fn' in line:
 break
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test by testing with a less commonly used module.

2016-02-22 Thread mjacob
Author: Manuel Jacob 
Branch: 
Changeset: r82411:9a5c6a749b49
Date: 2016-02-22 23:27 +0100
http://bitbucket.org/pypy/pypy/changeset/9a5c6a749b49/

Log:Fix test by testing with a less commonly used module.

diff --git a/pypy/module/imp/test/test_import.py 
b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -1061,12 +1061,12 @@
 py.test.skip("unresolved issues with win32 shell quoting rules")
 from pypy.interpreter.test.test_zpy import pypypath 
 extrapath = udir.ensure("pythonpath", dir=1) 
-extrapath.join("urllib.py").write("print 42\n")
+extrapath.join("sched.py").write("print 42\n")
 old = os.environ.get('PYTHONPATH', None)
 oldlang = os.environ.pop('LANG', None)
 try:
 os.environ['PYTHONPATH'] = str(extrapath)
-output = py.process.cmdexec('''"%s" "%s" -c "import urllib"''' %
+output = py.process.cmdexec('''"%s" "%s" -c "import sched"''' %
  (sys.executable, pypypath))
 assert output.strip() == '42'
 finally:
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test.

2015-12-29 Thread amauryfa
Author: Amaury Forgeot d'Arc 
Branch: 
Changeset: r81494:d3465d7f76a2
Date: 2015-12-30 00:38 +0100
http://bitbucket.org/pypy/pypy/changeset/d3465d7f76a2/

Log:Fix test.

diff --git a/pypy/module/cpyext/test/test_typeobject.py 
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -648,7 +648,7 @@
 IntLikeObject *intObj;
 long intval;
 
-if (!PyArg_ParseTuple(args, "i", ))
+if (!PyArg_ParseTuple(args, "l", ))
 return NULL;
 
 IntLike_Type.tp_as_number = _as_number;
@@ -668,7 +668,7 @@
 IntLikeObjectNoOp *intObjNoOp;
 long intval;
 
-if (!PyArg_ParseTuple(args, "i", ))
+if (!PyArg_ParseTuple(args, "l", ))
 return NULL;
 
 IntLike_Type_NoOp.tp_flags |= Py_TPFLAGS_CHECKTYPES;
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test if specialized_zip_2_lists isn't importable.

2015-11-14 Thread mjacob
Author: Manuel Jacob 
Branch: 
Changeset: r80675:e2a9b91eb60c
Date: 2015-11-14 18:34 +0100
http://bitbucket.org/pypy/pypy/changeset/e2a9b91eb60c/

Log:Fix test if specialized_zip_2_lists isn't importable.

diff --git a/pypy/objspace/std/test/test_tupleobject.py 
b/pypy/objspace/std/test/test_tupleobject.py
--- a/pypy/objspace/std/test/test_tupleobject.py
+++ b/pypy/objspace/std/test/test_tupleobject.py
@@ -413,8 +413,9 @@
 from __pypy__ import specialized_zip_2_lists
 except ImportError:
 specialized_zip_2_lists = zip
-raises(TypeError, specialized_zip_2_lists, [], ())
-raises(TypeError, specialized_zip_2_lists, (), [])
+else:
+raises(TypeError, specialized_zip_2_lists, [], ())
+raises(TypeError, specialized_zip_2_lists, (), [])
 assert specialized_zip_2_lists([], []) == [
 ]
 assert specialized_zip_2_lists([2, 3], []) == [
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-11-08 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r80604:2e371c1bb8f8
Date: 2015-11-09 08:46 +0100
http://bitbucket.org/pypy/pypy/changeset/2e371c1bb8f8/

Log:fix test

diff --git a/rpython/jit/backend/llsupport/descr.py 
b/rpython/jit/backend/llsupport/descr.py
--- a/rpython/jit/backend/llsupport/descr.py
+++ b/rpython/jit/backend/llsupport/descr.py
@@ -41,11 +41,11 @@
 def __init__(self, size, gc_fielddescrs=None, all_fielddescrs=None,
  vtable=lltype.nullptr(rclass.OBJECT_VTABLE),
  immutable_flag=False):
+assert lltype.typeOf(vtable) == lltype.Ptr(rclass.OBJECT_VTABLE)
 self.size = size
 self.gc_fielddescrs = gc_fielddescrs
 self.all_fielddescrs = all_fielddescrs
 self.vtable = vtable
-assert vtable is not None
 self.immutable_flag = immutable_flag
 
 def get_all_fielddescrs(self):
diff --git a/rpython/jit/backend/llsupport/test/test_zrpy_gc_direct.py 
b/rpython/jit/backend/llsupport/test/test_zrpy_gc_direct.py
--- a/rpython/jit/backend/llsupport/test/test_zrpy_gc_direct.py
+++ b/rpython/jit/backend/llsupport/test/test_zrpy_gc_direct.py
@@ -34,8 +34,8 @@
 rclass = getclassrepr(rtyper, classdef)
 rinstance = getinstancerepr(rtyper, classdef)
 LLB = rinstance.lowleveltype.TO
-vtable_B = rclass.getvtable()
-adr_vtable_B = llmemory.cast_ptr_to_adr(vtable_B)
+ptr_vtable_B = rclass.getvtable()
+adr_vtable_B = llmemory.cast_ptr_to_adr(ptr_vtable_B)
 vtable_B = llmemory.cast_adr_to_int(adr_vtable_B, mode="symbolic")
 
 CPU = getcpuclass()
@@ -46,7 +46,7 @@
 finaldescr = BasicFinalDescr()
 faildescr = BasicFailDescr()
 
-descr_B = cpu.sizeof(LLB, vtable_B)
+descr_B = cpu.sizeof(LLB, ptr_vtable_B)
 typeid_B = descr_B.get_type_id()
 
 loop1 = parse("""
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test (didn't run on 64-bit, and failed on Win32)

2015-10-07 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r80030:7a55c3196936
Date: 2015-10-08 06:31 +0200
http://bitbucket.org/pypy/pypy/changeset/7a55c3196936/

Log:Fix test (didn't run on 64-bit, and failed on Win32)

diff --git a/rpython/jit/metainterp/test/test_ajit.py 
b/rpython/jit/metainterp/test/test_ajit.py
--- a/rpython/jit/metainterp/test/test_ajit.py
+++ b/rpython/jit/metainterp/test/test_ajit.py
@@ -4046,8 +4046,11 @@
 def test_external_call(self):
 from rpython.rlib.objectmodel import invoke_around_extcall
 
-T = rffi.CArrayPtr(rffi.TIME_T)
-external = rffi.llexternal("time", [T], rffi.TIME_T)
+TIME_T = lltype.Signed
+# ^^^ some 32-bit platforms have a 64-bit rffi.TIME_T, but we
+# don't want that here; we just want always a Signed value
+T = rffi.CArrayPtr(TIME_T)
+external = rffi.llexternal("time", [T], TIME_T)
 
 class Oups(Exception):
 pass
@@ -4071,9 +4074,9 @@
 external(lltype.nullptr(T.TO))
 return len(state.l)
 
-res = self.interp_operations(f, [], supports_longlong=True)
+res = self.interp_operations(f, [])
 assert res == 2
-res = self.interp_operations(f, [], supports_longlong=True)
+res = self.interp_operations(f, [])
 assert res == 2
 self.check_operations_history(call_release_gil_i=1, call_may_force_i=0)
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-08-12 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r78955:7abd45f9e434
Date: 2015-08-13 07:05 +0300
http://bitbucket.org/pypy/pypy/changeset/7abd45f9e434/

Log:fix test

diff --git a/pypy/module/micronumpy/test/test_dtypes.py 
b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -350,8 +350,8 @@
 assert np.dtype(xyz).name == 'xyz'
 # another obscure API, used in numpy record.py
 # it seems numpy throws away the subclass type and parses the spec
-a = np.dtype((xyz, [('x', int), ('y', float)]))
-assert repr(a) == dtype([('x', 'i8'), ('y', 'f8')])
+a = np.dtype((xyz, [('x', 'int32'), ('y', 'float32')]))
+assert repr(a) == dtype([('x', 'i4'), ('y', 'f4')])
 
 def test_index(self):
 import numpy as np
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test after changes in 36a1899115e0

2015-07-04 Thread rlamy
Author: Ronan Lamy ronan.l...@gmail.com
Branch: 
Changeset: r78428:75d199ee1dc7
Date: 2015-07-04 19:23 +0200
http://bitbucket.org/pypy/pypy/changeset/75d199ee1dc7/

Log:fix test after changes in 36a1899115e0

diff --git a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py 
b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
--- a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
@@ -14,42 +14,45 @@
 assert len(log.loops) == 1
 loop = log._filter(log.loops[0])
 assert loop.match(
-guard_class(p0, #, descr=...)
-p4 = getfield_gc_pure(p0, descr=FieldP 
pypy.module.micronumpy.iterators.ArrayIter.inst_array \d+)
-i5 = getfield_gc(p2, descr=FieldS 
pypy.module.micronumpy.iterators.IterState.inst_offset \d+)
+guard_class(p1, #, descr=...)
+p4 = getfield_gc_pure(p1, descr=FieldP 
pypy.module.micronumpy.iterators.ArrayIter.inst_array \d+)
+i5 = getfield_gc(p0, descr=FieldS 
pypy.module.micronumpy.iterators.IterState.inst_offset \d+)
 p6 = getfield_gc_pure(p4, descr=FieldP 
pypy.module.micronumpy.concrete.BaseConcreteArray.inst_dtype \d+)
 p7 = getfield_gc_pure(p6, descr=FieldP 
pypy.module.micronumpy.descriptor.W_Dtype.inst_itemtype \d+)
 guard_class(p7, ConstClass(Float64), descr=...)
 i9 = getfield_gc_pure(p4, descr=FieldU 
pypy.module.micronumpy.concrete.BaseConcreteArray.inst_storage \d+)
-f10 = raw_load(i9, i5, descr=ArrayF \d+)
-i11 = getfield_gc_pure(p7, descr=FieldU 
pypy.module.micronumpy.types.BaseType.inst_native \d+)
-guard_true(i11, descr=...)
+i10 = getfield_gc_pure(p6, descr=FieldU 
pypy.module.micronumpy.descriptor.W_Dtype.inst_byteorder \d+)
+i12 = int_eq(i10, 61)
+i14 = int_eq(i10, 60)
+i15 = int_or(i12, i14)
+f16 = raw_load(i9, i5, descr=ArrayF \d+)
+guard_true(i15, descr=...)
 guard_not_invalidated(descr=...)
-i12 = cast_float_to_int(f10)
-i14 = int_and(i12, 255)
-guard_true(i14, descr=...)
-i15 = getfield_gc_pure(p1, descr=FieldU 
pypy.module.micronumpy.boxes.W_BoolBox.inst_value \d+)
-i16 = int_is_true(i15)
-guard_false(i16, descr=...)
-i20 = getfield_gc(p2, descr=FieldS 
pypy.module.micronumpy.iterators.IterState.inst_index \d+)
-i21 = getfield_gc_pure(p0, descr=FieldU 
pypy.module.micronumpy.iterators.ArrayIter.inst_track_index \d+)
-guard_true(i21, descr=...)
-i23 = int_add(i20, 1)
-p24 = getfield_gc_pure(p2, descr=FieldP 
pypy.module.micronumpy.iterators.IterState.inst__indices \d+)
-i25 = getfield_gc_pure(p0, descr=FieldS 
pypy.module.micronumpy.iterators.ArrayIter.inst_contiguous \d+)
-i26 = int_is_true(i25)
-guard_true(i26, descr=...)
-i27 = getfield_gc_pure(p6, descr=FieldS 
pypy.module.micronumpy.descriptor.W_Dtype.inst_elsize \d+)
-i28 = int_add(i5, i27)
-i29 = getfield_gc_pure(p0, descr=FieldS 
pypy.module.micronumpy.iterators.ArrayIter.inst_size \d+)
-i30 = int_ge(i23, i29)
-guard_false(i30, descr=...)
-p32 = new_with_vtable(#)
+i17 = cast_float_to_int(f16)
+i19 = int_and(i17, 255)
+guard_true(i19, descr=...)
+i20 = getfield_gc_pure(p2, descr=FieldU 
pypy.module.micronumpy.boxes.W_BoolBox.inst_value \d+)
+i21 = int_is_true(i20)
+guard_false(i21, descr=...)
+i22 = getfield_gc(p0, descr=FieldS 
pypy.module.micronumpy.iterators.IterState.inst_index \d+)
+i23 = getfield_gc_pure(p1, descr=FieldU 
pypy.module.micronumpy.iterators.ArrayIter.inst_track_index \d+)
+guard_true(i23, descr=...)
+i25 = int_add(i22, 1)
+p26 = getfield_gc_pure(p0, descr=FieldP 
pypy.module.micronumpy.iterators.IterState.inst__indices \d+)
+i27 = getfield_gc_pure(p1, descr=FieldS 
pypy.module.micronumpy.iterators.ArrayIter.inst_contiguous \d+)
+i28 = int_is_true(i27)
+guard_true(i28, descr=...)
+i29 = getfield_gc_pure(p6, descr=FieldS 
pypy.module.micronumpy.descriptor.W_Dtype.inst_elsize \d+)
+i30 = int_add(i5, i29)
+i31 = getfield_gc_pure(p1, descr=FieldS 
pypy.module.micronumpy.iterators.ArrayIter.inst_size \d+)
+i32 = int_ge(i25, i31)
+guard_false(i32, descr=...)
+p34 = new_with_vtable(#)
 {{{
-setfield_gc(p32, i23, descr=FieldS 
pypy.module.micronumpy.iterators.IterState.inst_index \d+)
-setfield_gc(p32, p24, descr=FieldP 
pypy.module.micronumpy.iterators.IterState.inst__indices \d+)
-setfield_gc(p32, i28, descr=FieldS 

[pypy-commit] pypy default: Fix test

2015-07-03 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r78420:b1635c72d2d4
Date: 2015-07-04 00:06 +0200
http://bitbucket.org/pypy/pypy/changeset/b1635c72d2d4/

Log:Fix test

diff --git a/rpython/rlib/test/test_compilerinfo.py 
b/rpython/rlib/test/test_compilerinfo.py
--- a/rpython/rlib/test/test_compilerinfo.py
+++ b/rpython/rlib/test/test_compilerinfo.py
@@ -3,7 +3,7 @@
 
 
 def test_untranslated():
-assert get_compiler_info() == untranslated
+assert get_compiler_info() == (untranslated)
 
 def fn(index):
 cc = get_compiler_info()
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2015-05-20 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r77420:2c648d4310f1
Date: 2015-05-20 10:40 +0200
http://bitbucket.org/pypy/pypy/changeset/2c648d4310f1/

Log:Fix test

diff --git a/pypy/module/_cffi_backend/test/test_file.py 
b/pypy/module/_cffi_backend/test/test_file.py
--- a/pypy/module/_cffi_backend/test/test_file.py
+++ b/pypy/module/_cffi_backend/test/test_file.py
@@ -20,7 +20,8 @@
 from pypy.module._cffi_backend import VERSION
 line = Version: %s\n % VERSION
 eggfile = py.path.local(__file__).join('..', '..', '..', '..', '..',
-   'lib_pypy', 'cffi.egg-info')
+   'lib_pypy', 'cffi.egg-info',
+   'PKG-INFO')
 assert line in eggfile.readlines()
 
 def test_app_version():
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, specify int size when examining strides

2015-05-14 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r77324:076b58687070
Date: 2015-05-15 05:26 +0300
http://bitbucket.org/pypy/pypy/changeset/076b58687070/

Log:fix test, specify int size when examining strides

diff --git a/pypy/module/micronumpy/test/test_ufuncs.py 
b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -246,7 +246,7 @@
 dtypes=[dtype(int), dtype(int)],
 stack_inputs=True,
   )
-ai = arange(12*3*3, dtype=int).reshape(12,3,3)
+ai = arange(12*3*3, dtype='int32').reshape(12,3,3)
 exc = raises(ValueError, ufunc, ai[:,:,0])
 assert perand 0 has a mismatch in its core dimension 1 in 
exc.value.message
 ai3 = ufunc(ai[0,:,:])
@@ -254,7 +254,7 @@
 assert (ai2 == ai * 2).all()
 # view
 aiV = ai[::-2, :, :]
-assert aiV.strides == (-144, 24, 8)
+assert aiV.strides == (-72, 12, 4)
 ai2 = ufunc(aiV)
 assert (ai2 == aiV * 2).all()
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-05-10 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r77284:2d95ca250540
Date: 2015-05-10 21:39 +0300
http://bitbucket.org/pypy/pypy/changeset/2d95ca250540/

Log:fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_call.py 
b/pypy/module/pypyjit/test_pypy_c/test_call.py
--- a/pypy/module/pypyjit/test_pypy_c/test_call.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_call.py
@@ -435,7 +435,6 @@
 guard_value(i4, 1, descr=...)
 guard_isnull(p5, descr=...)
 guard_nonnull_class(p12, ConstClass(W_IntObject), descr=...)
-guard_value(i8, 0, descr=...)
 guard_value(p2, ConstPtr(ptr21), descr=...)
 i22 = getfield_gc_pure(p12, descr=FieldS 
pypy.objspace.std.intobject.W_IntObject.inst_intval .*)
 i24 = int_lt(i22, 5000)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test when run alone

2015-05-04 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r77025:354ff4ef1593
Date: 2015-05-04 09:27 +0200
http://bitbucket.org/pypy/pypy/changeset/354ff4ef1593/

Log:Fix test when run alone

diff --git a/pypy/interpreter/test/test_pyframe.py 
b/pypy/interpreter/test/test_pyframe.py
--- a/pypy/interpreter/test/test_pyframe.py
+++ b/pypy/interpreter/test/test_pyframe.py
@@ -64,6 +64,8 @@
 f.f_lineno += 1
 return x
 
+open# force fetching of this name now
+
 def function():
 xyz
 with open(self.tempfile1, 'w') as f:
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test on Windows

2015-05-02 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r76974:0d5be1c2a04d
Date: 2015-05-02 14:30 +0200
http://bitbucket.org/pypy/pypy/changeset/0d5be1c2a04d/

Log:Fix test on Windows

diff --git a/rpython/jit/backend/test/runner_test.py 
b/rpython/jit/backend/test/runner_test.py
--- a/rpython/jit/backend/test/runner_test.py
+++ b/rpython/jit/backend/test/runner_test.py
@@ -3239,7 +3239,7 @@
   types.slong)
 #
 for saveerr in [rffi.RFFI_ERR_ALL,
-rffi.RFFI_ERR_ALL | rffi.RFFI_ALT_ERRNO, 
+rffi.RFFI_ERR_ALL | rffi.RFFI_ALT_ERRNO,
]:
 faildescr = BasicFailDescr(1)
 inputargs = [BoxInt() for i in range(7)]
@@ -3256,19 +3256,34 @@
 looptoken = JitCellToken()
 self.cpu.compile_loop(inputargs, ops, looptoken)
 #
-if saveerr  rffi.RFFI_ALT_ERRNO:
-llerrno.set_debug_saved_alterrno(self.cpu, 8)
-else:
-llerrno.set_debug_saved_errno(self.cpu, 8)
+llerrno.set_debug_saved_errno(self.cpu, 8)
+llerrno.set_debug_saved_alterrno(self.cpu, 5)
 llerrno.set_debug_saved_lasterror(self.cpu, 9)
+llerrno.set_debug_saved_altlasterror(self.cpu, 4)
 deadframe = self.cpu.execute_token(looptoken, 1, 2, 3, 4, 5, 6, 7)
 result = self.cpu.get_int_value(deadframe, 0)
-assert llerrno.get_debug_saved_errno(self.cpu) == 42
+got_errno = llerrno.get_debug_saved_errno(self.cpu)
+got_alter = llerrno.get_debug_saved_alterrno(self.cpu)
+if saveerr  rffi.RFFI_ALT_ERRNO:
+assert (got_errno, got_alter) == (8, 42)
+else:
+assert (got_errno, got_alter) == (42, 5)
 if sys.platform != 'win32':
-assert result == 765432108
+if saveerr  rffi.RFFI_ALT_ERRNO:
+assert result == 765432105
+else:
+assert result == 765432108
 else:
-assert llerrno.get_debug_saved_lasterror(self.cpu) == 43
-assert result == 765432198
+if saveerr  rffi.RFFI_ALT_ERRNO:
+assert result == 765432145
+else:
+assert result == 765432198
+got_lasterror = llerrno.get_debug_saved_lasterror(self.cpu)
+got_altlaster = llerrno.get_debug_saved_altlasterror(self.cpu)
+if saveerr  rffi.RFFI_ALT_ERRNO:
+assert (got_lasterror, got_altlaster) == (9, 43)
+else:
+assert (got_lasterror, got_altlaster) == (43, 4)
 
 def test_guard_not_invalidated(self):
 cpu = self.cpu
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-04-11 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r76773:60de3e60e9d5
Date: 2015-04-11 10:42 +0200
http://bitbucket.org/pypy/pypy/changeset/60de3e60e9d5/

Log:fix test

diff --git a/rpython/translator/c/gcc/test/test_trackgcroot.py 
b/rpython/translator/c/gcc/test/test_trackgcroot.py
--- a/rpython/translator/c/gcc/test/test_trackgcroot.py
+++ b/rpython/translator/c/gcc/test/test_trackgcroot.py
@@ -159,7 +159,8 @@
 expectedlines.insert(i-2, 'PUBLIC\t%s\n' % (label,))
 expectedlines.insert(i-1, '%s::\n' % (label,))
 else:
-expectedlines.insert(i-2, '\t.globl\t%s\n' % (label,))
+expectedlines.insert(i-3, '\t.globl\t%s\n' % (label,))
+expectedlines.insert(i-2, '\t.hidden\t%s\n' % (label,))
 expectedlines.insert(i-1, '%s=.+%d\n' % (label,
  
tracker.OFFSET_LABELS))
 if format == 'msvc' and r_gcroot_constant.match(line):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: 'fix' test

2015-04-03 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r76702:b58c996fdef5
Date: 2015-04-03 16:15 +0200
http://bitbucket.org/pypy/pypy/changeset/b58c996fdef5/

Log:'fix' test

diff --git a/rpython/jit/metainterp/test/test_string.py 
b/rpython/jit/metainterp/test/test_string.py
--- a/rpython/jit/metainterp/test/test_string.py
+++ b/rpython/jit/metainterp/test/test_string.py
@@ -897,7 +897,9 @@
 m -= 1
 return 42
 self.meta_interp(f, [6, 7])
-self.check_resops(unicodesetitem=2, newunicode=2, call=4,
+# xxx used to be 'call=4', but the two extra calls in the loop
+# are not safe to remove; see 56eebe9dd813
+self.check_resops(unicodesetitem=2, newunicode=2, call=6,
   copyunicodecontent=2, unicodegetitem=0)
 
 def test_str2unicode_fold(self):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test to also work in lldebug mode (it used to fail because

2015-03-16 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r76411:7926ef4fb172
Date: 2015-03-16 17:21 +0100
http://bitbucket.org/pypy/pypy/changeset/7926ef4fb172/

Log:Fix test to also work in lldebug mode (it used to fail because the C
hack to allocate does not track the allocation)

diff --git a/rpython/rtyper/lltypesystem/test/test_rffi.py 
b/rpython/rtyper/lltypesystem/test/test_rffi.py
--- a/rpython/rtyper/lltypesystem/test/test_rffi.py
+++ b/rpython/rtyper/lltypesystem/test/test_rffi.py
@@ -102,24 +102,19 @@
 #include string.h
 #include src/mem.h
 
-char *f(char* arg)
+void f(char *target, char* arg)
 {
-char *ret;
-/* lltype.free uses OP_RAW_FREE, we must allocate
- * with the matching function
- */
-OP_RAW_MALLOC(strlen(arg) + 1, ret, char*)
-strcpy(ret, arg);
-return ret;
+strcpy(target, arg);
 }
 )
 eci = ExternalCompilationInfo(separate_module_sources=[c_source],
-  post_include_bits=['char *f(char*);'])
-z = llexternal('f', [CCHARP], CCHARP, compilation_info=eci)
+ post_include_bits=['void 
f(char*,char*);'])
+z = llexternal('f', [CCHARP, CCHARP], lltype.Void, 
compilation_info=eci)
 
 def f():
 s = str2charp(xxx)
-l_res = z(s)
+l_res = lltype.malloc(CCHARP.TO, 10, flavor='raw')
+z(l_res, s)
 res = charp2str(l_res)
 lltype.free(l_res, flavor='raw')
 free_charp(s)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test after translation

2015-03-04 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r76237:7517b098f581
Date: 2015-03-04 10:39 +0100
http://bitbucket.org/pypy/pypy/changeset/7517b098f581/

Log:Fix test after translation

diff --git a/pypy/module/sys/test/test_sysmodule.py 
b/pypy/module/sys/test/test_sysmodule.py
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -521,9 +521,11 @@
 
 def test_reload_doesnt_override_sys_executable(self):
 import sys
-sys.executable = 'from_test_sysmodule'
+if not hasattr(sys, 'executable'):# if not translated
+sys.executable = 'from_test_sysmodule'
+previous = sys.executable
 reload(sys)
-assert sys.executable == 'from_test_sysmodule'
+assert sys.executable == previous
 
 def test_settrace(self):
 import sys
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-02-25 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r76123:648124294bf5
Date: 2015-02-25 12:01 +0100
http://bitbucket.org/pypy/pypy/changeset/648124294bf5/

Log:fix test

diff --git a/rpython/jit/backend/llsupport/test/test_asmmemmgr.py 
b/rpython/jit/backend/llsupport/test/test_asmmemmgr.py
--- a/rpython/jit/backend/llsupport/test/test_asmmemmgr.py
+++ b/rpython/jit/backend/llsupport/test/test_asmmemmgr.py
@@ -178,7 +178,11 @@
 assert p[3] == 'y'
 assert p[4] == 'Z'
 assert p[5] == 'z'
-assert allblocks == [(rawstart, rawstart + 6)]
+# 'allblocks' should be one block of length 6 + 15
+# (15 = alignment - 1) containing the range(rawstart, rawstart + 6)
+[(blockstart, blockend)] = allblocks
+assert blockend == blockstart + 6 + (mc.ALIGN_MATERIALIZE - 1)
+assert blockstart = rawstart  rawstart + 6 = blockend
 assert puts == [(rawstart + 2, ['a', 'b', 'c', 'd']),
 (rawstart + 4, ['e', 'f', 'g'])]
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test: the cond_call=0 was actually a long-standing bug that the new

2015-02-22 Thread cfbolz
Author: Carl Friedrich Bolz cfb...@gmx.de
Branch: 
Changeset: r76046:3930b6579b7e
Date: 2015-02-22 17:26 +0100
http://bitbucket.org/pypy/pypy/changeset/3930b6579b7e/

Log:fix test: the cond_call=0 was actually a long-standing bug that the
new heapcache fixes

diff --git a/rpython/jit/metainterp/test/test_recursive.py 
b/rpython/jit/metainterp/test/test_recursive.py
--- a/rpython/jit/metainterp/test/test_recursive.py
+++ b/rpython/jit/metainterp/test/test_recursive.py
@@ -794,7 +794,7 @@
 return frame.thing.val + s
 
 res = self.meta_interp(main, [0], inline=True)
-self.check_resops(call=0, cond_call=0) # got removed by optimization
+self.check_resops(call=0, cond_call=2)
 assert res == main(0)
 
 def test_directly_call_assembler_virtualizable_reset_token(self):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-02-15 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r75898:956c35f6c0e4
Date: 2015-02-15 16:12 +0100
http://bitbucket.org/pypy/pypy/changeset/956c35f6c0e4/

Log:fix test

diff --git a/pypy/module/_cffi_backend/test/test_handle.py 
b/pypy/module/_cffi_backend/test/test_handle.py
--- a/pypy/module/_cffi_backend/test/test_handle.py
+++ b/pypy/module/_cffi_backend/test/test_handle.py
@@ -19,7 +19,7 @@
 pwr = PseudoWeakRef()
 expected_content[index] = pwr
 ch.handles[index] = pwr
-assert len(ch.handles)  13500
+assert len(ch.handles) = 16384
 for index, pwr in expected_content.items():
 assert ch.handles[index] is pwr
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, 2nd step

2015-01-22 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r75475:6bfb35a7371e
Date: 2015-01-22 10:03 +0100
http://bitbucket.org/pypy/pypy/changeset/6bfb35a7371e/

Log:fix test, 2nd step

diff --git a/pypy/module/pypyjit/test_pypy_c/test_containers.py 
b/pypy/module/pypyjit/test_pypy_c/test_containers.py
--- a/pypy/module/pypyjit/test_pypy_c/test_containers.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_containers.py
@@ -78,7 +78,7 @@
 {{{
 setfield_gc(p13, 0, descr=FieldS dicttable.lookup_function_no .+)
 setfield_gc(p13, 0, descr=FieldS dicttable.num_live_items .+)
-setfield_gc(p13, 16, descr=FieldS dicttable.resize_counter .+)
+setfield_gc(p13, 32, descr=FieldS dicttable.resize_counter .+)
 }}}
 guard_no_exception(descr=...)
 p20 = new_with_vtable(ConstClass(W_IntObject))
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2015-01-19 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r75446:2e861a37e530
Date: 2015-01-20 00:57 +0100
http://bitbucket.org/pypy/pypy/changeset/2e861a37e530/

Log:fix test

diff --git a/pypy/module/termios/test/test_termios.py 
b/pypy/module/termios/test/test_termios.py
--- a/pypy/module/termios/test/test_termios.py
+++ b/pypy/module/termios/test/test_termios.py
@@ -43,6 +43,10 @@
 child.sendline('import termios')
 child.expect(' ')
 child.sendline('termios.tcgetattr(0)')
+# output of the first time is ignored: it contains the compilation
+# of more C stuff relating to errno
+child.expect(' ')
+child.sendline('termios.tcgetattr(0)')
 child.expect('\[.*?\[.*?\]\]')
 lst = eval(child.match.group(0))
 assert len(lst) == 7
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2015-01-19 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r75433:b6913a381bf9
Date: 2015-01-19 12:05 +0100
http://bitbucket.org/pypy/pypy/changeset/b6913a381bf9/

Log:Fix test

diff --git a/rpython/translator/tool/test/test_staticsizereport.py 
b/rpython/translator/tool/test/test_staticsizereport.py
--- a/rpython/translator/tool/test/test_staticsizereport.py
+++ b/rpython/translator/tool/test/test_staticsizereport.py
@@ -59,7 +59,7 @@
 assert guess_size(func.builder.db, dictvalnode, set())  100
 assert guess_size(func.builder.db, dictvalnode2, set()) == (
 (4 * S + 2 * P) + # struct dicttable
-(S + 8) + # indexes, length 8
+(S + 16) +# indexes, length 16
 (S + S + S))  # entries, length 1
 r_set = set()
 dictnode_size = guess_size(db, test_dictnode, r_set)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test after b9d53b23c50b

2015-01-16 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r75383:dcbbd83e551c
Date: 2015-01-16 14:28 +0200
http://bitbucket.org/pypy/pypy/changeset/dcbbd83e551c/

Log:fix test after b9d53b23c50b

diff --git a/pypy/interpreter/test/test_targetpypy.py 
b/pypy/interpreter/test/test_targetpypy.py
--- a/pypy/interpreter/test/test_targetpypy.py
+++ b/pypy/interpreter/test/test_targetpypy.py
@@ -27,6 +27,6 @@
 pypy_setup_home = d['pypy_setup_home']
 lls = rffi.str2charp(__file__)
 res = pypy_setup_home(lls, rffi.cast(rffi.INT, 1))
-assert lltype.typeOf(res) == rffi.LONG
+assert lltype.typeOf(res) == rffi.INT
 assert rffi.cast(lltype.Signed, res) == 0
 lltype.free(lls, flavor='raw')
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, coercing values to records - reduces numpy incompatability

2014-12-11 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r74892:218d49b0e351
Date: 2014-12-11 23:30 +0200
http://bitbucket.org/pypy/pypy/changeset/218d49b0e351/

Log:fix test, coercing values to records - reduces numpy incompatability

diff --git a/pypy/module/micronumpy/test/test_ndarray.py 
b/pypy/module/micronumpy/test/test_ndarray.py
--- a/pypy/module/micronumpy/test/test_ndarray.py
+++ b/pypy/module/micronumpy/test/test_ndarray.py
@@ -2923,11 +2923,7 @@
 a = empty(10, dtype=[(_, int) for _ in 'abcde'])
 a.fill(123)
 for i in a:
-import sys
-if '__pypy__' in sys.builtin_module_names:
-assert tuple(i) == (123,) + (0,) * 4
-else:
-assert tuple(i) == (123,) * 5
+assert tuple(i) == (123,) * 5
 
 a = zeros(3, dtype=dtype(complex).newbyteorder())
 a.fill(1.5+2.5j)
@@ -3857,7 +3853,7 @@
 a = np.array([b, b, b], dtype=dt)
 assert a.shape == (3, 2)
 for i in a.flat:
-assert tuple(i) == (True, False)
+assert tuple(i) == (True, True)
 
 dt = np.dtype([('A', 'i8'), ('B', 'f8'), ('C', 'c16')])
 b = np.array((99, 1e+20, 1e+20+0j), dtype=dt)
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -311,26 +311,26 @@
 BoxType = boxes.W_BoolBox
 format_code = ?
 
-True = BoxType(True)
-False = BoxType(False)
+_True = BoxType(True)
+_False = BoxType(False)
 
 @specialize.argtype(1)
 def box(self, value):
 box = Primitive.box(self, value)
 if box.value:
-return self.True
+return self._True
 else:
-return self.False
+return self._False
 
 @specialize.argtype(1, 2)
 def box_complex(self, real, imag):
 box = Primitive.box(self, real)
 if box.value:
-return self.True
+return self._True
 box = Primitive.box(self, imag)
 if box.value:
-return self.True
-return self.False
+return self._True
+return self._False
 
 def coerce_subtype(self, space, w_subtype, w_item):
 # Doesn't return subclasses so it can return the constants.
@@ -1869,7 +1869,7 @@
 items_w = space.fixedview(w_item.get_scalar_value())
 else:
 # XXX support initializing from readable buffers
-items_w = [w_item]
+items_w = [w_item] * len(dtype.fields)
 else:
 items_w = [None] * len(dtype.fields)
 arr = VoidBoxStorage(dtype.elsize, dtype)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-11-28 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r74751:4a150158f334
Date: 2014-11-28 14:19 +0100
http://bitbucket.org/pypy/pypy/changeset/4a150158f334/

Log:fix test

diff --git a/rpython/jit/codewriter/test/test_flatten.py 
b/rpython/jit/codewriter/test/test_flatten.py
--- a/rpython/jit/codewriter/test/test_flatten.py
+++ b/rpython/jit/codewriter/test/test_flatten.py
@@ -297,21 +297,27 @@
 int_return $-1
 ---
 L1:
+-live-
 int_return $61
 ---
 L2:
+-live-
 int_return $511
 ---
 L3:
+-live-
 int_return $-22
 ---
 L4:
+-live-
 int_return $81
 ---
 L5:
+-live-
 int_return $17
 ---
 L6:
+-live-
 int_return $54
 )
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-11-28 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r74752:32796dba665f
Date: 2014-11-28 14:24 +0100
http://bitbucket.org/pypy/pypy/changeset/32796dba665f/

Log:fix test

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py 
b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -1,4 +1,4 @@
-import py
+import py, sys
 from rpython.rlib.objectmodel import instantiate
 from rpython.jit.metainterp import compile, resume
 from rpython.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt, 
TreeLoop
@@ -190,6 +190,11 @@
 args = []
 for _ in range(oparity[opnum]):
 args.append(random.randrange(1, 20))
+if opnum == rop.INT_SIGNEXT:
+# 2nd arg is number of bytes to extend from ---
+# must not be too random
+args[-1] = random.choice([1, 2] if sys.maxint  2**32 else
+ [1, 2, 4])
 ops = 
 []
 i1 = %s(%s)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-11-28 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r74754:ec0b383167ab
Date: 2014-11-28 14:56 +0100
http://bitbucket.org/pypy/pypy/changeset/ec0b383167ab/

Log:fix test

diff --git a/pypy/module/micronumpy/test/test_zjit.py 
b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -127,12 +127,13 @@
 assert result == 3 ** 2
 self.check_trace_count(1)
 self.check_simple_loop({
-'call': 3,
+'call': 1,
 'float_add': 1,
 'float_eq': 3,
 'float_mul': 2,
 'float_ne': 1,
 'getarrayitem_gc': 1,
+'getarrayitem_raw': 1, # read the errno
 'guard_false': 4,
 'guard_not_invalidated': 1,
 'guard_true': 3,
@@ -144,6 +145,7 @@
 'raw_load': 2,
 'raw_store': 1,
 'setarrayitem_gc': 1,
+'setarrayitem_raw': 1, # write the errno
 })
 
 def define_pow_int():
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2014-11-22 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r74630:79565c62bfae
Date: 2014-11-22 11:39 +0100
http://bitbucket.org/pypy/pypy/changeset/79565c62bfae/

Log:Fix test

diff --git a/rpython/rtyper/lltypesystem/test/test_rffi.py 
b/rpython/rtyper/lltypesystem/test/test_rffi.py
--- a/rpython/rtyper/lltypesystem/test/test_rffi.py
+++ b/rpython/rtyper/lltypesystem/test/test_rffi.py
@@ -100,7 +100,6 @@
 def test_string_reverse(self):
 c_source = py.code.Source(
 #include string.h
-#include src/allocator.h
 #include src/mem.h
 
 char *f(char* arg)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2014-09-04 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r73297:b15ac44c3739
Date: 2014-09-04 14:21 +0200
http://bitbucket.org/pypy/pypy/changeset/b15ac44c3739/

Log:Fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_cprofile.py 
b/pypy/module/pypyjit/test_pypy_c/test_cprofile.py
--- a/pypy/module/pypyjit/test_pypy_c/test_cprofile.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_cprofile.py
@@ -1,4 +1,4 @@
-import py, sys
+import py, sys, re
 from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
 
 class TestCProfile(BaseTestPyPyC):
@@ -28,8 +28,18 @@
 print loop.ops_by_id(method)
 # on 32-bit, there is f1=call(read_timestamp); ...;
 # f2=call(read_timestamp); f3=call(llong_sub,f1,f2)
-# but all calls can be special-cased by the backend if supported
-if sys.maxint != 2147483647:
-assert ' call(' not in repr(loop.ops_by_id(method))
+# but all calls can be special-cased by the backend if
+# supported.  On 64-bit there is only the two calls to
+# read_timestamp.
+r = re.compile(r call[(]ConstClass[(](.+?)[)])
+calls = r.findall(repr(loop.ops_by_id(method)))
+if sys.maxint == 2147483647:
+assert len(calls) == 6
+else:
+assert len(calls) == 2
+for x in calls:
+assert ('ll_read_timestamp' in x or 'llong_sub' in x
+or 'llong_add' in x)
+#
 assert ' call_may_force(' not in repr(loop.ops_by_id(method))
 assert ' cond_call(' in repr(loop.ops_by_id(method))
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test, and improve it to check that a non-executable fake exe is not

2014-09-02 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r73283:912dd9df99a8
Date: 2014-09-02 20:33 +0200
http://bitbucket.org/pypy/pypy/changeset/912dd9df99a8/

Log:Fix test, and improve it to check that a non-executable fake exe is
not picked up any more, but an executable one is (after issue
#1856).

diff --git a/pypy/interpreter/test/test_app_main.py 
b/pypy/interpreter/test/test_app_main.py
--- a/pypy/interpreter/test/test_app_main.py
+++ b/pypy/interpreter/test/test_app_main.py
@@ -985,6 +985,11 @@
 assert sys.path == old_sys_path + [self.goal_dir]
 
 app_main.setup_bootstrap_path(self.fake_exe)
+assert sys.executable == ''  # not executable!
+assert sys.path == old_sys_path + [self.goal_dir]
+
+os.chmod(self.fake_exe, 0755)
+app_main.setup_bootstrap_path(self.fake_exe)
 assert sys.executable == self.fake_exe
 assert self.goal_dir not in sys.path
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test for the 'trace-limit-hack' merge

2014-09-01 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r73260:fc98972622d7
Date: 2014-09-01 09:32 +0200
http://bitbucket.org/pypy/pypy/changeset/fc98972622d7/

Log:Fix test for the 'trace-limit-hack' merge

diff --git a/pypy/module/pypyjit/test_pypy_c/test_call.py 
b/pypy/module/pypyjit/test_pypy_c/test_call.py
--- a/pypy/module/pypyjit/test_pypy_c/test_call.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_call.py
@@ -17,13 +17,18 @@
 # now we can inline it as call assembler
 i = 0
 j = 0
-while i  20:
+while i  25:
 i += 1
 j += rec(100) # ID: call_rec
 return j
 #
-log = self.run(fn, [], threshold=18)
-loop, = log.loops_by_filename(self.filepath)
+# NB. the parameters below are a bit ad-hoc.  After 16 iterations,
+# the we trace from the while and reach a trace too long.  Then
+# in the next execution, we trace the rec function from start;
+# that's functrace below.  Then after one or two extra iterations
+# we try again from while, and this time we succeed.
+log = self.run(fn, [], threshold=20)
+functrace, loop = log.loops_by_filename(self.filepath)
 assert loop.match_by_id('call_rec', 
 ...
 p53 = call_assembler(..., descr=...)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test for windows

2014-06-13 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r72040:9cf39ce9af62
Date: 2014-06-13 12:12 +0300
http://bitbucket.org/pypy/pypy/changeset/9cf39ce9af62/

Log:fix test for windows

diff --git a/pypy/tool/release/test/test_package.py 
b/pypy/tool/release/test/test_package.py
--- a/pypy/tool/release/test/test_package.py
+++ b/pypy/tool/release/test/test_package.py
@@ -18,9 +18,16 @@
 pypy_c = py.path.local(pypydir).join('goal', basename)
 if not pypy_c.check():
 if sys.platform == 'win32':
-assert False, test on win32 requires exe
-pypy_c.write(#!/bin/sh)
-pypy_c.chmod(0755)
+import os, shutil
+for d in os.environ['PATH'].split(';'):
+if os.path.exists(os.path.join(d, 'cmd.exe')):
+shutil.copy(os.path.join(d, 'cmd.exe'), str(pypy_c))
+break
+else:
+assert False, 'could not find cmd.exe'
+else:
+pypy_c.write(#!/bin/sh)
+pypy_c.chmod(0755)
 fake_pypy_c = True
 else:
 fake_pypy_c = False
@@ -108,7 +115,7 @@
 check(pypy,  0755)
 
 def test_generate_license():
-from os.path import dirname, abspath
+from os.path import dirname, abspath, join
 class Options(object):
 pass
 options = Options()
@@ -116,7 +123,7 @@
 options.no_tk = False
 if sys.platform == 'win32':
  # as on buildbot YMMV
-options.license_base = os.path.join(basedir, r'..\..\..\local')
+options.license_base = join(basedir, r'..\..\..\local')
 else:
 options.license_base = '/usr/share/doc'
 license = package.generate_license(py.path.local(basedir), options)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-06-12 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r72038:c2bd8af00b27
Date: 2014-06-13 00:57 +0300
http://bitbucket.org/pypy/pypy/changeset/c2bd8af00b27/

Log:fix test

diff --git a/pypy/tool/release/test/test_package.py 
b/pypy/tool/release/test/test_package.py
--- a/pypy/tool/release/test/test_package.py
+++ b/pypy/tool/release/test/test_package.py
@@ -115,9 +115,8 @@
 basedir = dirname(dirname(dirname(dirname(dirname(abspath(__file__))
 options.no_tk = False
 if sys.platform == 'win32':
-# Following recommended build setup at
-# 
http://doc.pypy.org/en/latest/windows.html#abridged-method-for-ojit-builds-using-visual-studio-2008
-options.license_base = dirname(basedir) + '/local'
+ # as on buildbot YMMV
+options.license_base = os.path.join(basedir, r'..\..\..\local')
 else:
 options.license_base = '/usr/share/doc'
 license = package.generate_license(py.path.local(basedir), options)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, raise instead of assert

2014-06-11 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r72019:6046a1811363
Date: 2014-06-11 19:06 +0300
http://bitbucket.org/pypy/pypy/changeset/6046a1811363/

Log:fix test, raise instead of assert

diff --git a/rpython/config/test/test_translationoption.py 
b/rpython/config/test/test_translationoption.py
--- a/rpython/config/test/test_translationoption.py
+++ b/rpython/config/test/test_translationoption.py
@@ -1,3 +1,4 @@
+import sys
 import py
 from rpython.config.translationoption import get_combined_translation_config
 from rpython.config.translationoption import set_opt_level
@@ -10,8 +11,8 @@
 config.translation.gcrootfinder = shadowstack
 py.test.raises(ConflictConfigError, set_opt_level, config, '0')
 
-if compiler.name == 'msvc':
+if compiler.name == 'msvc' or sys.platform == 'darwin':
 def test_no_asmgcrot_on_msvc():
 config = get_combined_translation_config()
-py.test.raises(ConfigError, config.translation.setoption, 
-'gcrootfinder', 'asmgcc', 'user') 
+config.translation.gcrootfinder = asmgcc
+py.test.raises(ConfigError, set_opt_level, config, 'jit') 
diff --git a/rpython/config/translationoption.py 
b/rpython/config/translationoption.py
--- a/rpython/config/translationoption.py
+++ b/rpython/config/translationoption.py
@@ -369,8 +369,8 @@
 
 # disallow asmgcc on OS/X and on Win32
 if config.translation.gcrootfinder == asmgcc:
-assert sys.platform != darwin, 'asmgcc' not supported on OS/X
-assert sys.platform != win32,  'asmgcc' not supported on Win32
+if sys.platform == darwin or sys.platform ==win32:
+raise ConfigError('asmgcc' not supported on this platform)
 
 # 
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test for windows, document and fix test for : in PYPYLOG filename

2014-05-14 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r71517:9ab80e27fa27
Date: 2014-05-14 22:31 +0300
http://bitbucket.org/pypy/pypy/changeset/9ab80e27fa27/

Log:fix test for windows, document and fix test for : in PYPYLOG
filename

diff --git a/pypy/doc/man/pypy.1.rst b/pypy/doc/man/pypy.1.rst
--- a/pypy/doc/man/pypy.1.rst
+++ b/pypy/doc/man/pypy.1.rst
@@ -100,6 +100,8 @@
 ``debug_start``/``debug_stop`` but not any nested
 ``debug_print``.
 *fname* can be ``-`` to log to *stderr*.
+Note that using a : in fname is a bad idea, Windows
+users, beware.
 
 ``:``\ *fname*
 Full logging, including ``debug_print``.
diff --git a/rpython/translator/c/test/test_standalone.py 
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -304,8 +304,13 @@
 assert   ll_strtod.o in makefile
 
 def test_debug_print_start_stop(self):
+import sys
 from rpython.rtyper.lltypesystem import rffi
-
+if sys.platform == 'win32':
+# ftell(stderr) is a bit different under subprocess.Popen
+tell = 0
+else:
+tell = -1
 def entry_point(argv):
 x = got:
 debug_start  (mycat)
@@ -327,7 +332,7 @@
 t, cbuilder = self.compile(entry_point)
 # check with PYPYLOG undefined
 out, err = cbuilder.cmdexec(, err=True, env={})
-assert out.strip() == 'got:a.-1.'
+assert out.strip() == 'got:a.%d.' % tell
 assert 'toplevel' in err
 assert 'mycat' not in err
 assert 'foo 2 bar 3' not in err
@@ -336,7 +341,7 @@
 assert 'bok' not in err
 # check with PYPYLOG defined to an empty string (same as undefined)
 out, err = cbuilder.cmdexec(, err=True, env={'PYPYLOG': ''})
-assert out.strip() == 'got:a.-1.'
+assert out.strip() == 'got:a.%d.' % tell
 assert 'toplevel' in err
 assert 'mycat' not in err
 assert 'foo 2 bar 3' not in err
@@ -345,7 +350,7 @@
 assert 'bok' not in err
 # check with PYPYLOG=:- (means print to stderr)
 out, err = cbuilder.cmdexec(, err=True, env={'PYPYLOG': ':-'})
-assert out.strip() == 'got:bcda.-1.'
+assert out.strip() == 'got:bcda.%d.' % tell
 assert 'toplevel' in err
 assert '{mycat' in err
 assert 'mycat}' in err
@@ -374,20 +379,24 @@
 assert 'bok' in data
 # check with PYPYLOG=somefilename
 path = udir.join('test_debug_xxx_prof.log')
-out, err = cbuilder.cmdexec(, err=True, env={'PYPYLOG': str(path)})
-size = os.stat(str(path)).st_size
-assert out.strip() == 'got:a.' + str(size) + '.'
-assert not err
-assert path.check(file=1)
-data = path.read()
-assert 'toplevel' in data
-assert '{mycat' in data
-assert 'mycat}' in data
-assert 'foo 2 bar 3' not in data
-assert '{cat2' in data
-assert 'cat2}' in data
-assert 'baz' not in data
-assert 'bok' not in data
+if str(path).find(':')=0:
+# bad choice of udir, there is a ':' in it which messes up the test
+pass
+else:
+out, err = cbuilder.cmdexec(, err=True, env={'PYPYLOG': 
str(path)})
+size = os.stat(str(path)).st_size
+assert out.strip() == 'got:a.' + str(size) + '.'
+assert not err
+assert path.check(file=1)
+data = path.read()
+assert 'toplevel' in data
+assert '{mycat' in data
+assert 'mycat}' in data
+assert 'foo 2 bar 3' not in data
+assert '{cat2' in data
+assert 'cat2}' in data
+assert 'baz' not in data
+assert 'bok' not in data
 # check with PYPYLOG=myc:somefilename   (includes mycat but not cat2)
 path = udir.join('test_debug_xxx_myc.log')
 out, err = cbuilder.cmdexec(, err=True,
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-05-05 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: 
Changeset: r71315:777bfc76bd25
Date: 2014-05-06 08:41 +0300
http://bitbucket.org/pypy/pypy/changeset/777bfc76bd25/

Log:fix test

diff --git a/rpython/translator/goal/richards.py 
b/rpython/translator/goal/richards.py
--- a/rpython/translator/goal/richards.py
+++ b/rpython/translator/goal/richards.py
@@ -102,13 +102,13 @@
 self.task_waiting = False
 self.task_holding = False
 return self
-
+
 def waitingWithPacket(self):
 self.packet_pending = True
 self.task_waiting = True
 self.task_holding = False
 return self
-
+
 def isPacketPending(self):
 return self.packet_pending
 
@@ -154,6 +154,7 @@
 self.holdCount = 0
 self.qpktCount = 0
 
+taskWorkArea = TaskWorkArea()
 
 class Task(TaskState):
 
@@ -235,7 +236,7 @@
 if t is None:
 raise Exception(Bad task id %d % id)
 return t
-
+
 
 # DeviceTask
 
@@ -309,7 +310,7 @@
 else:
 i.control = i.control/2 ^ 0xd008
 return self.release(I_DEVB)
-
+
 
 # WorkTask
 
@@ -384,7 +385,7 @@
 wkq = None;
 DeviceTask(I_DEVA, 4000, wkq, TaskState().waiting(), 
DeviceTaskRec());
 DeviceTask(I_DEVB, 5000, wkq, TaskState().waiting(), 
DeviceTaskRec());
-
+
 schedule()
 
 if taskWorkArea.holdCount == 9297 and taskWorkArea.qpktCount == 
23246:
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test collection crash on msvc

2014-04-27 Thread mattip
Author: Matti Picus matti.pi...@gmail.com
Branch: 
Changeset: r71031:83ace05284a9
Date: 2014-04-27 23:00 +0300
http://bitbucket.org/pypy/pypy/changeset/83ace05284a9/

Log:fix test collection crash on msvc

diff --git a/pypy/module/cppyy/src/dummy_backend.cxx 
b/pypy/module/cppyy/src/dummy_backend.cxx
--- a/pypy/module/cppyy/src/dummy_backend.cxx
+++ b/pypy/module/cppyy/src/dummy_backend.cxx
@@ -521,6 +521,15 @@
 
 
 /* misc helpers --- */
+#if defined(_MSC_VER)
+long long cppyy_strtoll(const char* str) {
+return _strtoi64(str, NULL, 0);
+}
+
+extern C unsigned long long cppyy_strtoull(const char* str) {
+return _strtoui64(str, NULL, 0);
+}
+#else
 long long cppyy_strtoll(const char* str) {
 return strtoll(str, NULL, 0);
 }
@@ -528,6 +537,7 @@
 extern C unsigned long long cppyy_strtoull(const char* str) {
 return strtoull(str, NULL, 0);
 }
+#endif
 
 void cppyy_free(void* ptr) {
 free(ptr);
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test for cpython and pypy

2014-04-27 Thread mattip
Author: Matti Picus matti.pi...@gmail.com
Branch: 
Changeset: r71033:6b69d6b92167
Date: 2014-04-28 07:17 +0300
http://bitbucket.org/pypy/pypy/changeset/6b69d6b92167/

Log:fix test for cpython and pypy

diff --git a/pypy/module/zipimport/test/test_undocumented.py 
b/pypy/module/zipimport/test/test_undocumented.py
--- a/pypy/module/zipimport/test/test_undocumented.py
+++ b/pypy/module/zipimport/test/test_undocumented.py
@@ -135,8 +135,7 @@
 importer = zipimport.zipimporter(os.path.join(zip_path, '_pkg'))
 assert zip_path in zipimport._zip_directory_cache
 file_set = set(zipimport._zip_directory_cache[zip_path].iterkeys())
-compare_set = set(path.replace(os.path.sep, '/') + '.py'
-  for path in self.created_paths)
+compare_set = set(path + '.py' for path in self.created_paths)
 assert file_set == compare_set
 finally:
 self.cleanup_zipfile(self.created_paths)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-04-24 Thread mattip
Author: Matti Picus matti.pi...@gmail.com
Branch: 
Changeset: r70950:253828267285
Date: 2014-04-24 23:53 +0300
http://bitbucket.org/pypy/pypy/changeset/253828267285/

Log:fix test

diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py
--- a/rpython/rlib/test/test_rposix.py
+++ b/rpython/rlib/test/test_rposix.py
@@ -104,9 +104,11 @@
 def f():
 if isinstance(udir.as_unicode(), str):
 _udir = udir.as_unicode()
+_res = ', '
 else:
 _udir = udir
-return u', '.join(rposix.listdir(_udir))
+_res = u', '
+return _res.join(rposix.listdir(_udir))
 result = interpret(f, [])
 assert os.path.basename(self.ufilename) in ll_to_string(result)
 else:
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-04-18 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r70751:85e7dc6a1289
Date: 2014-04-18 09:44 +0200
http://bitbucket.org/pypy/pypy/changeset/85e7dc6a1289/

Log:fix test

diff --git a/rpython/rlib/test/test_rlocale.py 
b/rpython/rlib/test/test_rlocale.py
--- a/rpython/rlib/test/test_rlocale.py
+++ b/rpython/rlib/test/test_rlocale.py
@@ -40,5 +40,8 @@
 if sys.platform != darwin and not sys.platform.startswith(linux):
 py.test.skip(there is (maybe) no libintl here)
 _gettext = external('gettext', [rffi.CCHARP], rffi.CCHARP)
-res = _gettext(1234)
+p = rffi.str2charp(1234)
+res = _gettext(p)
+assert res == p
 assert rffi.charp2str(res) == 1234
+rffi.free_charp(p)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2014-04-15 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r70635:f0dfe097735a
Date: 2014-04-15 11:47 +0200
http://bitbucket.org/pypy/pypy/changeset/f0dfe097735a/

Log:Fix test

diff --git a/pypy/config/test/test_pypyoption.py 
b/pypy/config/test/test_pypyoption.py
--- a/pypy/config/test/test_pypyoption.py
+++ b/pypy/config/test/test_pypyoption.py
@@ -12,9 +12,9 @@
 assert conf.objspace.usemodules.gc
 
 conf.objspace.std.withmapdict = True
-assert conf.objspace.std.withmethodcache
+assert conf.objspace.std.withtypeversion
 conf = get_pypy_config()
-conf.objspace.std.withmethodcache = False
+conf.objspace.std.withtypeversion = False
 py.test.raises(ConfigError, conf.objspace.std.withmapdict = True)
 
 def test_conflicting_gcrootfinder():
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test on win32

2014-04-09 Thread bdkearns
Author: Brian Kearns bdkea...@gmail.com
Branch: 
Changeset: r70528:69db55ba6eaf
Date: 2014-04-09 18:20 -0700
http://bitbucket.org/pypy/pypy/changeset/69db55ba6eaf/

Log:fix test on win32

diff --git a/pypy/module/posix/test/test_posix2.py 
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -308,7 +308,11 @@
 def test_fdopen_directory(self):
 import errno
 os = self.posix
-fd = os.open('/', os.O_RDONLY)
+try:
+fd = os.open('/', os.O_RDONLY)
+except OSError as e:
+assert e.errno == errno.EACCES
+skip(system cannot open directories)
 exc = raises(IOError, os.fdopen, fd, 'r')
 assert exc.value.errno == errno.EISDIR
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test, now raises cpython compatible IOError

2014-04-03 Thread mattip
Author: Matti Picus matti.pi...@gmail.com
Branch: 
Changeset: r70423:50dedcdbad50
Date: 2014-04-03 21:39 +0300
http://bitbucket.org/pypy/pypy/changeset/50dedcdbad50/

Log:fix test, now raises cpython compatible IOError

diff --git a/pypy/module/_file/test/test_file_extra.py 
b/pypy/module/_file/test/test_file_extra.py
--- a/pypy/module/_file/test/test_file_extra.py
+++ b/pypy/module/_file/test/test_file_extra.py
@@ -528,7 +528,7 @@
 f = open(fn)
 exc = raises(EnvironmentError, f.truncate, 3)
 if sys.platform == 'win32':
-assert exc.value.winerror == 5 # ERROR_ACCESS_DENIED
+assert exc.value.errno == 5 # ERROR_ACCESS_DENIED
 else:
 # CPython explicitely checks the file mode
 # PyPy relies on the libc to raise the error
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-03-29 Thread mattip
Author: Matti Picus matti.pi...@gmail.com
Branch: 
Changeset: r70330:18d16e0a184b
Date: 2014-03-30 00:26 +0300
http://bitbucket.org/pypy/pypy/changeset/18d16e0a184b/

Log:fix test

diff --git a/pypy/module/test_lib_pypy/test_testcapi.py 
b/pypy/module/test_lib_pypy/test_testcapi.py
--- a/pypy/module/test_lib_pypy/test_testcapi.py
+++ b/pypy/module/test_lib_pypy/test_testcapi.py
@@ -3,14 +3,12 @@
 if '__pypy__' not in sys.builtin_module_names:
 py.test.skip('pypy only test')
 
-from lib_pypy import _testcapi #this should insure _testcapi is built
+from lib_pypy import _testcapi #make sure _testcapi is built
 
 def test_get_hashed_dir():
 import sys
-script = '''import _testcapi
-assert 'get_hashed_dir' in dir(_testcapi)
-return 0
-'''
+# This should not compile _testcapi, so the output is empty
+script = import _testcapi; assert 'get_hashed_dir' in dir(_testcapi)
 output = py.process.cmdexec('''%s -c %s''' %
  (sys.executable, script))
 assert output == ''
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix test

2014-03-22 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r70153:87d94ae4f90e
Date: 2014-03-22 08:09 +0100
http://bitbucket.org/pypy/pypy/changeset/87d94ae4f90e/

Log:fix test

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_util.py 
b/rpython/jit/metainterp/optimizeopt/test/test_util.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_util.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_util.py
@@ -319,6 +319,9 @@
 def log_loop(*args):
 pass
 
+class logger_ops:
+repr_of_resop = repr
+
 class warmrunnerdesc:
 class memory_manager:
 retrace_limit = 5
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2014-03-22 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r70154:aaf1ce9e21d0
Date: 2014-03-22 08:20 +0100
http://bitbucket.org/pypy/pypy/changeset/aaf1ce9e21d0/

Log:Fix test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_containers.py 
b/pypy/module/pypyjit/test_pypy_c/test_containers.py
--- a/pypy/module/pypyjit/test_pypy_c/test_containers.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_containers.py
@@ -70,14 +70,14 @@
 p13 = new(descr=...)
 p15 = new_array(8, descr=ArrayX .*)
 setfield_gc(p13, p15, descr=FieldP dicttable.entries .*)
-i17 = call(ConstClass(ll_dict_lookup_trampoline), p13, p10, i12, 
descr=Calli . rri EF=4)
+i17 = call(ConstClass(ll_dict_lookup_trampoline), p13, p10, i12, 
descr=Calli . rri EF=4 OS=4)
 setfield_gc(p13, 16, descr=FieldS dicttable.resize_counter .*)
 guard_no_exception(descr=...)
 p20 = new_with_vtable(ConstClass(W_IntObject))
 call(ConstClass(_ll_dict_setitem_lookup_done_trampoline), p13, 
p10, p20, i12, i17, descr=Callv 0 rrrii EF=4)
 setfield_gc(p20, i5, descr=FieldS .*W_IntObject.inst_intval .*)
 guard_no_exception(descr=...)
-i23 = call(ConstClass(ll_dict_lookup_trampoline), p13, p10, i12, 
descr=Calli . rri EF=4)
+i23 = call(ConstClass(ll_dict_lookup_trampoline), p13, p10, i12, 
descr=Calli . rri EF=4 OS=4)
 guard_no_exception(descr=...)
 i26 = int_and(i23, .*)
 i27 = int_is_true(i26)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test.

2014-03-22 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r70155:b03753b1bf5e
Date: 2014-03-22 08:29 +0100
http://bitbucket.org/pypy/pypy/changeset/b03753b1bf5e/

Log:Fix test.

A nice side-effect of the improve-consecutive-dict-lookups branch:
multiple loads or stores of attributes in an oldstyle class instance
are folded.

diff --git a/pypy/module/pypyjit/test_pypy_c/test_instance.py 
b/pypy/module/pypyjit/test_pypy_c/test_instance.py
--- a/pypy/module/pypyjit/test_pypy_c/test_instance.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_instance.py
@@ -141,15 +141,16 @@
 i = 0
 b = B(1)
 while i  100:
-b.x
-v = b.x # ID: loadattr
+v = b.x # ID: loadattr1
+v = b.x # ID: loadattr2
 i += v
 return i
 
 log = self.run(main, [], threshold=80)
 loop, = log.loops_by_filename(self.filepath)
-assert loop.match_by_id('loadattr',
+assert loop.match_by_id('loadattr1',
 '''
+guard_not_invalidated(descr=...)
 i19 = call(ConstClass(ll_dict_lookup), _, _, _, descr=...)
 guard_no_exception(descr=...)
 i21 = int_and(i19, _)
@@ -161,6 +162,7 @@
 i29 = int_is_true(i28)
 guard_true(i29, descr=...)
 ''')
+assert loop.match_by_id('loadattr2', )   # completely folded away
 
 def test_python_contains(self):
 def main():
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Fix test

2014-01-14 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r68657:5c1e61b82376
Date: 2014-01-14 09:36 +0100
http://bitbucket.org/pypy/pypy/changeset/5c1e61b82376/

Log:Fix test

diff --git a/pypy/module/test_lib_pypy/ctypes_tests/support.py 
b/pypy/module/test_lib_pypy/ctypes_tests/support.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/support.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/support.py
@@ -31,8 +31,10 @@
 import gc
 for _ in range(4):
 gc.collect()
-cls.old_num = _rawffi._num_of_allocated_objects()
-
+try:
+cls.old_num = _rawffi._num_of_allocated_objects()
+except RuntimeError:
+pass
 
 def teardown_class(cls):
 if sys.pypy_translation_info['translation.gc'] == 'boehm':
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


  1   2   >