MCPcopy Create free account
hub / github.com/apache/arrow / TestOwnedRefMoves

Function TestOwnedRefMoves

python/pyarrow/src/arrow/python/python_test.cc:135–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133namespace {
134
135Status TestOwnedRefMoves() {
136 std::vector<OwnedRef> vec;
137 PyObject *u, *v;
138 u = PyList_New(0);
139 v = PyList_New(0);
140
141 {
142 OwnedRef ref(u);
143 vec.push_back(std::move(ref));
144 ASSERT_EQ(ref.obj(), nullptr);
145 }
146 vec.emplace_back(v);
147 ASSERT_EQ(Py_REFCNT(u), 1);
148 ASSERT_EQ(Py_REFCNT(v), 1);
149 return Status::OK();
150}
151
152Status TestOwnedRefNoGILMoves() {
153 PyAcquireGIL lock;

Callers

nothing calls this directly

Calls 3

push_backMethod · 0.80
emplace_backMethod · 0.80
OKFunction · 0.50

Tested by

no test coverage detected