commit 1b36288f215072f52df01f04ae9f05f9e47b0018
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Sep 6 17:34:43 2011 -0400
cpychecker: remove a couple of long-redundant disabled selftests
testcpychecker.py | 59 -----------------------------------------------------
1 files changed, 0 insertions(+), 59 deletions(-)
---
diff --git a/testcpychecker.py b/testcpychecker.py
index d6d0659..33c4c7e 100644
--- a/testcpychecker.py
+++ b/testcpychecker.py
@@ -474,64 +474,5 @@ class PyArg_ParseTupleAndKeywordsTests(PyArg_ParseTupleTests):
'}\n') % locals()
return src, function_name
-(a)unittest.skip("Refcount tracker doesn't yet work")
-class RefcountErrorTests(AnalyzerTests):
- def add_method_table(self, cu, fn_name):
- methods = PyMethodTable('test_methods',
- [PyMethodDef('test_method', fn_name,
- METH_VARARGS, None)])
- cu.add_defn(methods.c_defn())
- return methods
-
- def add_module(self, sm, methods):
- sm.add_module_init('buggy', modmethods=methods, moddoc=None)
-
- def make_mod_method(self, function_name, body):
- sm = SimpleModule()
- sm.cu.add_defn(
- 'int val;\n'
- 'PyObject *\n'
- '%(function_name)s(PyObject *self, PyObject *args)\n' % locals()
- +'{\n'
- + body
- + '}\n')
- methods = self.add_method_table(sm.cu, function_name)
- self.add_module(sm, methods)
- return sm
-
- def test_missing_decref(self):
- sm = self.make_mod_method('missing_decref',
- ' PyObject *list;\n'
- ' PyObject *item;\n'
- ' list = PyList_New(1);\n'
- ' if (!list)\n'
- ' return NULL;\n'
- ' item = PyLong_FromLong(42);\n'
- ' /* This error handling is incorrect: it\'s missing an\n'
- ' invocation of Py_DECREF(list): */\n'
- ' if (!item)\n'
- ' return NULL;\n'
- ' PyList_SET_ITEM(list, 0, item);\n'
- ' return list;\n')
- experr = ('$(SRCFILE):21:10: error: leak of PyObject* reference acquired at call to PyList_New at $(SRCFILE):21 [-fpermissive]\n'
- ' $(SRCFILE):22: taking False path at if (!list)\n'
- ' $(SRCFILE):24: reaching here item = PyLong_FromLong(42);\n'
- ' $(SRCFILE):27: taking True path at if (!item)\n'
- ' $(SRCFILE):21: returning 0\n')
- self.assertFindsError(sm, experr)
-
-# Test disabled for now: we can't easily import this under gcc anymore:
-class TestArgParsing: # (unittest.TestCase):
- def assert_args(self, arg_str, exp_result):
- result = get_types(None, arg_str)
- self.assertEquals(result, exp_result)
-
- def test_fcntlmodule_fcntl_flock(self):
- # FIXME: somewhat broken, we can't know what the converter callback is
- self.assert_args("O&i:flock",
- ['int ( PyObject * object , int * target )',
- 'int *',
- 'int *'])
-
if __name__ == '__main__':
unittest.main()