mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
* Fix leak in the test_copy_move::test_move_fallback * Fix leaking PyMethodDef in test_class::test_implicit_conversion_life_support * Plumb leak in test_buffer, occuring when a mutable buffer is requested for a read-only object, and enable test_buffer.py * Fix weird return_value_policy::reference in test_stl_binders, and enable those tests * Cleanup nodelete holder objects in test_smart_ptr, and enable those tests
This commit is contained in:
@@ -86,13 +86,13 @@ TEST_SUBMODULE(stl_binders, m) {
|
||||
|
||||
// test_noncopyable_containers
|
||||
py::bind_vector<std::vector<E_nc>>(m, "VectorENC");
|
||||
m.def("get_vnc", &one_to_n<std::vector<E_nc>>, py::return_value_policy::reference);
|
||||
m.def("get_vnc", &one_to_n<std::vector<E_nc>>);
|
||||
py::bind_vector<std::deque<E_nc>>(m, "DequeENC");
|
||||
m.def("get_dnc", &one_to_n<std::deque<E_nc>>, py::return_value_policy::reference);
|
||||
m.def("get_dnc", &one_to_n<std::deque<E_nc>>);
|
||||
py::bind_map<std::map<int, E_nc>>(m, "MapENC");
|
||||
m.def("get_mnc", ×_ten<std::map<int, E_nc>>, py::return_value_policy::reference);
|
||||
m.def("get_mnc", ×_ten<std::map<int, E_nc>>);
|
||||
py::bind_map<std::unordered_map<int, E_nc>>(m, "UmapENC");
|
||||
m.def("get_umnc", ×_ten<std::unordered_map<int, E_nc>>, py::return_value_policy::reference);
|
||||
m.def("get_umnc", ×_ten<std::unordered_map<int, E_nc>>);
|
||||
// Issue #1885: binding nested std::map<X, Container<E>> with E non-copyable
|
||||
py::bind_map<std::map<int, std::vector<E_nc>>>(m, "MapVecENC");
|
||||
m.def("get_nvnc", [](int n)
|
||||
@@ -102,11 +102,11 @@ TEST_SUBMODULE(stl_binders, m) {
|
||||
for (int j = 1; j <= n; j++)
|
||||
(*m)[i].emplace_back(j);
|
||||
return m;
|
||||
}, py::return_value_policy::reference);
|
||||
});
|
||||
py::bind_map<std::map<int, std::map<int, E_nc>>>(m, "MapMapENC");
|
||||
m.def("get_nmnc", ×_hundred<std::map<int, std::map<int, E_nc>>>, py::return_value_policy::reference);
|
||||
m.def("get_nmnc", ×_hundred<std::map<int, std::map<int, E_nc>>>);
|
||||
py::bind_map<std::unordered_map<int, std::unordered_map<int, E_nc>>>(m, "UmapUmapENC");
|
||||
m.def("get_numnc", ×_hundred<std::unordered_map<int, std::unordered_map<int, E_nc>>>, py::return_value_policy::reference);
|
||||
m.def("get_numnc", ×_hundred<std::unordered_map<int, std::unordered_map<int, E_nc>>>);
|
||||
|
||||
// test_vector_buffer
|
||||
py::bind_vector<std::vector<unsigned char>>(m, "VectorUChar", py::buffer_protocol());
|
||||
|
||||
Reference in New Issue
Block a user