[pypy-commit] pypy default: remove tests for object size; not really clear what is it meant to test

mattip pypy.commits at gmail.com
Fri Jun 24 04:42:15 EDT 2016


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r85367:746d0c054448
Date: 2016-06-24 11:38 +0300
http://bitbucket.org/pypy/pypy/changeset/746d0c054448/

Log:	remove tests for object size; not really clear what is it meant to
	test

diff --git a/pypy/module/cpyext/test/test_bytearrayobject.py b/pypy/module/cpyext/test/test_bytearrayobject.py
--- a/pypy/module/cpyext/test/test_bytearrayobject.py
+++ b/pypy/module/cpyext/test/test_bytearrayobject.py
@@ -17,24 +17,10 @@
              """
                  PyObject* s = PyByteArray_FromStringAndSize("Hello world", 12);
                  int result = 0;
-                 size_t expected_size;
 
                  if(PyByteArray_Size(s) == 12) {
                      result = 1;
                  }
-                 #ifdef PYPY_VERSION
-                    expected_size = sizeof(void*)*3;
-                 #elif defined Py_DEBUG
-                    expected_size = 64;
-                 #else
-                    expected_size = 48;
-                 #endif
-                 if(s->ob_type->tp_basicsize != expected_size)
-                 {
-                     printf("tp_basicsize==%ld\\n",
-                            (long)s->ob_type->tp_basicsize);
-                     result = 0;
-                 }
                  Py_DECREF(s);
                  return PyBool_FromLong(result);
              """),
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
@@ -25,23 +25,8 @@
             ("test_Size", "METH_NOARGS",
              """
                  PyObject* s = PyString_FromString("Hello world");
-                 int result;
-                 size_t expected_size;
+                 int result = PyString_Size(s);
 
-                 result = PyString_Size(s);
-
-                 #ifdef PYPY_VERSION
-                    expected_size = 48;
-                 #elif defined Py_DEBUG
-                    expected_size = 53;
-                 #else
-                    expected_size = 37;
-                 #endif
-                 if(s->ob_type->tp_basicsize != expected_size)
-                 {
-                     printf("tp_basicsize==%zd\\n", s->ob_type->tp_basicsize);
-                     result = 0;
-                 }
                  Py_DECREF(s);
                  return PyLong_FromLong(result);
              """),


More information about the pypy-commit mailing list