Skip to content

Commit 2f77b90

Browse files
committed
add test case
1 parent 30788d7 commit 2f77b90

File tree

1 file changed

+13
-0
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests/cpyext

1 file changed

+13
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_object.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,19 @@ def test_new(self):
541541
tester = TestNew()
542542
assert tester.get_none() is None
543543

544+
def test_object_new_m_ml(self):
545+
ObjectNew = CPyExtType("ObjectNew_",
546+
'''
547+
static PyObject* get_flags(PyObject* cls, PyObject* func) {
548+
return PyLong_FromLong(PyCFunction_GetFlags(func));
549+
}
550+
551+
''',
552+
tp_methods='''{"get_flags", (PyCFunction)get_flags, METH_O | METH_CLASS, ""}''',
553+
)
554+
f = ObjectNew.get_flags(object.__new__)
555+
assert f == 3, "PyCFunction_GetFlags(object.__new__) 3 != %d" % f
556+
544557
def test_init(self):
545558
TestInit = CPyExtType("TestInit",
546559
'''static PyObject* testnew_new(PyTypeObject* cls, PyObject* a, PyObject* b) {

0 commit comments

Comments
 (0)